Skip to content

Commit 5343102

Browse files
Ace Nassribcoe
Ace Nassri
andauthored
Add .mocharc to create test XML results. (#1588)
* Add mocharc to export test XML * Take 2: use sponge_log.xml for test result filename * Add XUnit exports to ALL node tests Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent 41d170a commit 5343102

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

.kokoro/.mocharc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reporter: xunit
2+
reporter-option:
3+
- output=./sponge_log.xml

.kokoro/appengine/common.cfg

-7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,4 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
1313
env_vars: {
1414
key: "TRAMPOLINE_BUILD_FILE"
1515
value: "github/nodejs-docs-samples/.kokoro/build.sh"
16-
}
17-
18-
# Export XUnit test results for further analysis
19-
action {
20-
define_artifacts {
21-
regex: "**/all-tests.xml"
22-
}
2316
}

.kokoro/build-with-appengine.sh

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ set -e;
1818

1919
export GCLOUD_PROJECT=nodejs-docs-samples-tests
2020

21+
# Activate mocha config
22+
pushd github/nodejs-docs-samples
23+
mv .kokoro/.mocharc.yml .
24+
popd
25+
2126
# Update gcloud
2227
gcloud components update --quiet
2328

.kokoro/build-with-run.sh

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
set -eo pipefail
1818

19+
# Activate mocha config
20+
pushd github/nodejs-docs-samples
21+
mv .kokoro/.mocharc.yml .
22+
popd
23+
1924
export GOOGLE_CLOUD_PROJECT=nodejs-docs-samples-tests
2025
pushd github/nodejs-docs-samples/${PROJECT}
2126

.kokoro/build.sh

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export NODEJS_IOT_RSA_PUBLIC_CERT=${KOKORO_GFILE_DIR}/rsa_cert.pem
7171
export BOT_ACCESS_TOKEN=${KOKORO_GFILE_DIR}/secrets-slack-bot-access-token.txt
7272
export CHANNEL=${KOKORO_GFILE_DIR}/secrets-slack-channel-id.txt
7373

74+
# Activate mocha config
75+
pushd github/nodejs-docs-samples
76+
mv .kokoro/.mocharc.yml .
77+
popd
78+
7479
cd github/nodejs-docs-samples/${PROJECT}
7580

7681
# Install dependencies

.kokoro/common.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
1313
env_vars: {
1414
key: "TRAMPOLINE_IMAGE"
1515
value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user"
16+
}
17+
18+
# Export XUnit test results for further analysis
19+
action {
20+
define_artifacts {
21+
regex: "**/sponge_log.xml"
22+
}
1623
}

.kokoro/functions/common.cfg

-7
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,4 @@ env_vars: {
1919
env_vars: {
2020
key: "BASE_URL"
2121
value: "http://localhost:8080"
22-
}
23-
24-
# Export XUnit test results for further analysis
25-
action {
26-
define_artifacts {
27-
regex: "**/all-tests.xml"
28-
}
2922
}

0 commit comments

Comments
 (0)