Skip to content

Commit 1cfe7a6

Browse files
authored
chore(ci): add xunit output to evergreen config
1 parent e01cafd commit 1cfe7a6

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
lines changed

.evergreen/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ functions:
207207
params:
208208
working_dir: src
209209
script: |
210-
${PREPARE_SHELL}
211210
MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
212211
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
213212
run tls tests:
@@ -433,12 +432,17 @@ functions:
433432
-p 8100 \
434433
-v \
435434
--fault revoked
435+
upload test results:
436+
- command: attach.xunit_results
437+
params:
438+
file: src/xunit.xml
436439
pre:
437440
- func: fetch source
438441
- func: prepare resources
439442
- func: fix absolute paths
440443
- func: make files executable
441444
post:
445+
- func: upload test results
442446
- func: cleanup
443447
tasks:
444448
- name: test-latest-server

.evergreen/config.yml.in

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ functions:
103103
params:
104104
file: mo-expansion.yml
105105

106-
bootstrap mongohoused:
106+
"bootstrap mongohoused":
107107
- command: shell.exec
108108
params:
109109
script: |
@@ -242,14 +242,16 @@ functions:
242242
script: |
243243
MONGODB_URI='${plain_auth_mongodb_uri}' NODE_LTS_NAME='${NODE_LTS_NAME}' \
244244
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
245-
run data lake tests:
245+
246+
"run data lake tests":
246247
- command: shell.exec
247248
type: test
248249
params:
249250
working_dir: src
250251
script: |
251252
MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
252253
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
254+
253255
"run tls tests":
254256
- command: shell.exec
255257
type: test
@@ -286,7 +288,7 @@ functions:
286288
}
287289
EOF
288290

289-
run aws auth test with regular aws credentials:
291+
"run aws auth test with regular aws credentials":
290292
- command: shell.exec
291293
type: test
292294
params:
@@ -315,7 +317,7 @@ functions:
315317
${PREPARE_SHELL}
316318
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh
317319

318-
run aws auth test with assume role credentials:
320+
"run aws auth test with assume role credentials":
319321
- command: shell.exec
320322
type: test
321323
params:
@@ -348,7 +350,7 @@ functions:
348350
${PREPARE_SHELL}
349351
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh
350352

351-
run aws auth test with aws EC2 credentials:
353+
"run aws auth test with aws EC2 credentials":
352354
- command: shell.exec
353355
type: test
354356
params:
@@ -365,7 +367,7 @@ functions:
365367
${PREPARE_SHELL}
366368
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh
367369

368-
run aws auth test with aws credentials as environment variables:
370+
"run aws auth test with aws credentials as environment variables":
369371
- command: shell.exec
370372
type: test
371373
params:
@@ -385,7 +387,7 @@ functions:
385387
${PREPARE_SHELL}
386388
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh
387389

388-
run aws auth test with aws credentials and session token as environment variables:
390+
"run aws auth test with aws credentials and session token as environment variables":
389391
- command: shell.exec
390392
type: test
391393
params:
@@ -406,7 +408,7 @@ functions:
406408
${PREPARE_SHELL}
407409
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh
408410

409-
run aws ECS auth test:
411+
"run aws ECS auth test":
410412
- command: shell.exec
411413
type: test
412414
params:
@@ -433,7 +435,7 @@ functions:
433435
cat setup.js
434436
mongo --nodb setup.js aws_e2e_ecs.js
435437

436-
run-ocsp-test:
438+
"run-ocsp-test":
437439
- command: shell.exec
438440
type: test
439441
params:
@@ -446,7 +448,7 @@ functions:
446448
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
447449
bash ${PROJECT_DIRECTORY}/.evergreen/run-ocsp-tests.sh
448450

449-
run-valid-ocsp-server:
451+
"run-valid-ocsp-server":
450452
- command: shell.exec
451453
params:
452454
script: |
@@ -464,7 +466,7 @@ functions:
464466
--ocsp_responder_key rsa/ca.key \
465467
-p 8100 -v
466468

467-
run-revoked-ocsp-server:
469+
"run-revoked-ocsp-server":
468470
- command: shell.exec
469471
params:
470472
script: |
@@ -484,6 +486,11 @@ functions:
484486
-v \
485487
--fault revoked
486488

489+
"upload test results":
490+
# Upload the xunit-format test results.
491+
- command: attach.xunit_results
492+
params:
493+
file: "src/xunit.xml"
487494

488495
pre:
489496
- func: "fetch source"
@@ -493,4 +500,5 @@ pre:
493500
- func: "make files executable"
494501

495502
post:
503+
- func: "upload test results"
496504
- func: "cleanup"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ manual_tests/
3131
docs/build
3232
docs/Makefile
3333

34+
# xunit test output for CI
35+
xunit.xml
36+
3437
# Directory for dbs
3538
db
3639

.mocharc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"file": "test/tools/runner",
55
"ui": "test/tools/runner/metadata_ui.js",
66
"recursive": true,
7-
"timeout": 60000
7+
"timeout": 60000,
8+
"reporter": "spec-xunit-file"
89
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"sinon": "^4.3.0",
6767
"sinon-chai": "^3.2.0",
6868
"snappy": "^6.3.0",
69+
"spec-xunit-file": "0.0.1-3",
6970
"source-map-support": "^0.5.19",
7071
"standard-version": "^7.1.0",
7172
"through2": "^3.0.1",

test/manual/mocharc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"require": "ts-node/register"
2+
"require": "ts-node/register",
3+
"reporter": "spec-xunit-file"
34
}

0 commit comments

Comments
 (0)