Skip to content

chore(ci): add xunit output to evergreen config #2596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ functions:
params:
working_dir: src
script: |
${PREPARE_SHELL}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason this was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing it was a change that was made directly to the config.yml and not to config.yml.in, so it was lost when regenerating the file. I can take a closer look.

MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
run tls tests:
Expand Down Expand Up @@ -433,12 +432,17 @@ functions:
-p 8100 \
-v \
--fault revoked
upload test results:
- command: attach.xunit_results
params:
file: src/xunit.xml
pre:
- func: fetch source
- func: prepare resources
- func: fix absolute paths
- func: make files executable
post:
- func: upload test results
- func: cleanup
tasks:
- name: test-latest-server
Expand Down
30 changes: 19 additions & 11 deletions .evergreen/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ functions:
params:
file: mo-expansion.yml

bootstrap mongohoused:
"bootstrap mongohoused":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make this change without all the whitespace (quotation mark) changes in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just added quotes to a few that were missing them for consistency - it makes the titles show up in a different color on syntax highlighting, which I thought was nice, but I can revert that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbroadst Just confirming, should I revert the quotation mark changes I made to improve consistency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that's fine, I just wondered what was going on

- command: shell.exec
params:
script: |
Expand Down Expand Up @@ -242,14 +242,16 @@ functions:
script: |
MONGODB_URI='${plain_auth_mongodb_uri}' NODE_LTS_NAME='${NODE_LTS_NAME}' \
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
run data lake tests:

"run data lake tests":
- command: shell.exec
type: test
params:
working_dir: src
script: |
MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh

"run tls tests":
- command: shell.exec
type: test
Expand Down Expand Up @@ -286,7 +288,7 @@ functions:
}
EOF

run aws auth test with regular aws credentials:
"run aws auth test with regular aws credentials":
- command: shell.exec
type: test
params:
Expand Down Expand Up @@ -315,7 +317,7 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

run aws auth test with assume role credentials:
"run aws auth test with assume role credentials":
- command: shell.exec
type: test
params:
Expand Down Expand Up @@ -348,7 +350,7 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

run aws auth test with aws EC2 credentials:
"run aws auth test with aws EC2 credentials":
- command: shell.exec
type: test
params:
Expand All @@ -365,7 +367,7 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

run aws auth test with aws credentials as environment variables:
"run aws auth test with aws credentials as environment variables":
- command: shell.exec
type: test
params:
Expand All @@ -385,7 +387,7 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

run aws auth test with aws credentials and session token as environment variables:
"run aws auth test with aws credentials and session token as environment variables":
- command: shell.exec
type: test
params:
Expand All @@ -406,7 +408,7 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

run aws ECS auth test:
"run aws ECS auth test":
- command: shell.exec
type: test
params:
Expand All @@ -433,7 +435,7 @@ functions:
cat setup.js
mongo --nodb setup.js aws_e2e_ecs.js

run-ocsp-test:
"run-ocsp-test":
- command: shell.exec
type: test
params:
Expand All @@ -446,7 +448,7 @@ functions:
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
bash ${PROJECT_DIRECTORY}/.evergreen/run-ocsp-tests.sh

run-valid-ocsp-server:
"run-valid-ocsp-server":
- command: shell.exec
params:
script: |
Expand All @@ -464,7 +466,7 @@ functions:
--ocsp_responder_key rsa/ca.key \
-p 8100 -v

run-revoked-ocsp-server:
"run-revoked-ocsp-server":
- command: shell.exec
params:
script: |
Expand All @@ -484,6 +486,11 @@ functions:
-v \
--fault revoked

"upload test results":
# Upload the xunit-format test results.
- command: attach.xunit_results
params:
file: "src/xunit.xml"

pre:
- func: "fetch source"
Expand All @@ -493,4 +500,5 @@ pre:
- func: "make files executable"

post:
- func: "upload test results"
- func: "cleanup"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ manual_tests/
docs/build
docs/Makefile

# xunit test output for CI
xunit.xml

# Directory for dbs
db

Expand Down
3 changes: 2 additions & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"file": "test/tools/runner",
"ui": "test/tools/runner/metadata_ui.js",
"recursive": true,
"timeout": 60000
"timeout": 60000,
"reporter": "spec-xunit-file"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"sinon": "^4.3.0",
"sinon-chai": "^3.2.0",
"snappy": "^6.3.0",
"spec-xunit-file": "0.0.1-3",
"source-map-support": "^0.5.19",
"standard-version": "^7.1.0",
"through2": "^3.0.1",
Expand Down
3 changes: 2 additions & 1 deletion test/manual/mocharc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"require": "ts-node/register"
"require": "ts-node/register",
"reporter": "spec-xunit-file"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm this is specified in the script above, can we reduce it to one place?

Copy link
Contributor Author

@emadum emadum Nov 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add --reporter spec-xunit-file to the npm scripts that use this file via the --config option in order to reduce verbosity. I can expand it out into the package scripts if desired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you add this same setting to .mocharc.json?

}