diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 570b6a4c..2269cf76 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -22,3 +22,23 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/nodejs-logging-bunyan/.kokoro/test.sh" } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "nodejs" +} + +################################################### + diff --git a/.kokoro/common_env_vars.cfg b/.kokoro/common_env_vars.cfg new file mode 100644 index 00000000..803b0244 --- /dev/null +++ b/.kokoro/common_env_vars.cfg @@ -0,0 +1,19 @@ + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "nodejs" +} + +################################################### + diff --git a/.kokoro/continuous/node12/common.cfg b/.kokoro/continuous/node12/common.cfg index 570b6a4c..2269cf76 100644 --- a/.kokoro/continuous/node12/common.cfg +++ b/.kokoro/continuous/node12/common.cfg @@ -22,3 +22,23 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/nodejs-logging-bunyan/.kokoro/test.sh" } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "nodejs" +} + +################################################### + diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 3ba2eb09..02604bf1 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -6,3 +6,16 @@ before_action { } } } + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "nodejs" +} diff --git a/owlbot.py b/owlbot.py index c1d79cdb..d79fcfb2 100644 --- a/owlbot.py +++ b/owlbot.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import synthtool as s import synthtool.gcp as gcp import synthtool.languages.node as node @@ -24,3 +25,23 @@ templates = common_templates.node_library(source_location='build/src') s.move(templates, excludes=[".github/auto-label.yaml"]) node.fix_hermetic() + +# -------------------------------------------------------------------------- +# Modify test configs +# -------------------------------------------------------------------------- + +# add shared environment variables to test configs +s.move( + ".kokoro/common_env_vars.cfg", + ".kokoro/common.cfg", + merge=lambda src, dst, _, : f"{dst}\n{src}", +) +for path, subdirs, files in os.walk(f".kokoro/continuous"): + for name in files: + if name == "common.cfg": + file_path = os.path.join(path, name) + s.move( + ".kokoro/common_env_vars.cfg", + file_path, + merge=lambda src, dst, _, : f"{dst}\n{src}", + )