From 265fc0e49af76ed9f4edef248c7c1d829696815c Mon Sep 17 00:00:00 2001 From: ace-n Date: Fri, 10 Jan 2020 16:00:41 -0800 Subject: [PATCH 1/3] Add mocharc to export test XML --- .kokoro/.mocharc.yml | 3 +++ .kokoro/build-with-appengine.sh | 5 +++++ .kokoro/build-with-run.sh | 5 +++++ .kokoro/build.sh | 5 +++++ 4 files changed, 18 insertions(+) create mode 100644 .kokoro/.mocharc.yml diff --git a/.kokoro/.mocharc.yml b/.kokoro/.mocharc.yml new file mode 100644 index 0000000000..9267ddd176 --- /dev/null +++ b/.kokoro/.mocharc.yml @@ -0,0 +1,3 @@ +reporter: xunit +reporter-option: + - output=./all-tests.xml diff --git a/.kokoro/build-with-appengine.sh b/.kokoro/build-with-appengine.sh index 5cc73c220e..0e925eaf4b 100755 --- a/.kokoro/build-with-appengine.sh +++ b/.kokoro/build-with-appengine.sh @@ -18,6 +18,11 @@ set -e; export GCLOUD_PROJECT=nodejs-docs-samples-tests +# Activate mocha config +pushd github/nodejs-docs-samples +mv .kokoro/.mocharc.yml . +popd + # Update gcloud gcloud components update --quiet diff --git a/.kokoro/build-with-run.sh b/.kokoro/build-with-run.sh index 5b0a01426e..d25d8b66f0 100755 --- a/.kokoro/build-with-run.sh +++ b/.kokoro/build-with-run.sh @@ -16,6 +16,11 @@ set -eo pipefail +# Activate mocha config +pushd github/nodejs-docs-samples +mv .kokoro/.mocharc.yml . +popd + export GOOGLE_CLOUD_PROJECT=nodejs-docs-samples-tests pushd github/nodejs-docs-samples/${PROJECT} diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 2d38c5f838..56ee3b1fae 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,6 +71,11 @@ export NODEJS_IOT_RSA_PUBLIC_CERT=${KOKORO_GFILE_DIR}/rsa_cert.pem export BOT_ACCESS_TOKEN=${KOKORO_GFILE_DIR}/secrets-slack-bot-access-token.txt export CHANNEL=${KOKORO_GFILE_DIR}/secrets-slack-channel-id.txt +# Activate mocha config +pushd github/nodejs-docs-samples +mv .kokoro/.mocharc.yml . +popd + cd github/nodejs-docs-samples/${PROJECT} # Install dependencies From 53c0a57f0317b381f57aa1d1b57e6173fa92fb23 Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 13 Jan 2020 15:38:12 -0800 Subject: [PATCH 2/3] Take 2: use sponge_log.xml for test result filename --- .kokoro/.mocharc.yml | 2 +- .kokoro/appengine/common.cfg | 2 +- .kokoro/functions/common.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/.mocharc.yml b/.kokoro/.mocharc.yml index 9267ddd176..5c2a08dc2b 100644 --- a/.kokoro/.mocharc.yml +++ b/.kokoro/.mocharc.yml @@ -1,3 +1,3 @@ reporter: xunit reporter-option: - - output=./all-tests.xml + - output=./sponge_log.xml diff --git a/.kokoro/appengine/common.cfg b/.kokoro/appengine/common.cfg index 5b6a28efc5..8b24c7850a 100644 --- a/.kokoro/appengine/common.cfg +++ b/.kokoro/appengine/common.cfg @@ -18,6 +18,6 @@ env_vars: { # Export XUnit test results for further analysis action { define_artifacts { - regex: "**/all-tests.xml" + regex: "**/sponge_log.xml" } } \ No newline at end of file diff --git a/.kokoro/functions/common.cfg b/.kokoro/functions/common.cfg index 73ca2ffca1..204950b9d6 100644 --- a/.kokoro/functions/common.cfg +++ b/.kokoro/functions/common.cfg @@ -24,6 +24,6 @@ env_vars: { # Export XUnit test results for further analysis action { define_artifacts { - regex: "**/all-tests.xml" + regex: "**/sponge_log.xml" } } \ No newline at end of file From d7774e3a447bef586f67364dbab3fa8ca08cd34e Mon Sep 17 00:00:00 2001 From: ace-n Date: Wed, 15 Jan 2020 17:13:08 -0800 Subject: [PATCH 3/3] Add XUnit exports to ALL node tests --- .kokoro/appengine/common.cfg | 7 ------- .kokoro/common.cfg | 7 +++++++ .kokoro/functions/common.cfg | 7 ------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.kokoro/appengine/common.cfg b/.kokoro/appengine/common.cfg index 8b24c7850a..94b10385ef 100644 --- a/.kokoro/appengine/common.cfg +++ b/.kokoro/appengine/common.cfg @@ -13,11 +13,4 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/nodejs-docs-samples/.kokoro/build.sh" -} - -# Export XUnit test results for further analysis -action { - define_artifacts { - regex: "**/sponge_log.xml" - } } \ No newline at end of file diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 3e09e3a430..6fa7e084d8 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -13,4 +13,11 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" +} + +# Export XUnit test results for further analysis +action { + define_artifacts { + regex: "**/sponge_log.xml" + } } \ No newline at end of file diff --git a/.kokoro/functions/common.cfg b/.kokoro/functions/common.cfg index 204950b9d6..a0ffd6fe31 100644 --- a/.kokoro/functions/common.cfg +++ b/.kokoro/functions/common.cfg @@ -19,11 +19,4 @@ env_vars: { env_vars: { key: "BASE_URL" value: "http://localhost:8080" -} - -# Export XUnit test results for further analysis -action { - define_artifacts { - regex: "**/sponge_log.xml" - } } \ No newline at end of file