Skip to content

Commit f0b8739

Browse files
authored
test(NODE-6891): add coverage for all test runs (#4508)
1 parent c5bed5e commit f0b8739

File tree

3 files changed

+55
-37
lines changed

3 files changed

+55
-37
lines changed

.evergreen/config.in.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,7 @@ functions:
674674
# compression tests.
675675
aws s3 cp --recursive s3://mciuploads/mongo-node-driver/${revision}/${version_id}/ \
676676
coverage/ \
677-
--exclude "results.*.json" \
678-
--exclude "*rhel80-large*" \
679-
--include "*fermiun"
677+
--exclude "results.*.json"
680678
681679
# npx does not recognize the dependency so install it directly.
682680
npm install @istanbuljs/nyc-config-typescript
@@ -1066,6 +1064,7 @@ task_groups:
10661064
binary: bash
10671065
args:
10681066
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
1067+
- func: "upload coverage report"
10691068
tasks:
10701069
- test-gcpkms-task
10711070

@@ -1093,6 +1092,7 @@ task_groups:
10931092
binary: bash
10941093
args:
10951094
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh
1095+
- func: "upload coverage report"
10961096
tasks:
10971097
- test-azurekms-task
10981098

@@ -1107,7 +1107,8 @@ task_groups:
11071107
binary: bash
11081108
args:
11091109
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
1110-
teardown_task:
1110+
teardown_group:
1111+
- func: "upload coverage report"
11111112
- command: subprocess.exec
11121113
params:
11131114
binary: bash
@@ -1129,7 +1130,8 @@ task_groups:
11291130
binary: bash
11301131
args:
11311132
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
1132-
teardown_task:
1133+
teardown_group:
1134+
- func: "upload coverage report"
11331135
- command: subprocess.exec
11341136
params:
11351137
binary: bash
@@ -1151,7 +1153,8 @@ task_groups:
11511153
binary: bash
11521154
args:
11531155
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
1154-
teardown_task:
1156+
teardown_group:
1157+
- func: "upload coverage report"
11551158
- command: subprocess.exec
11561159
params:
11571160
binary: bash
@@ -1177,6 +1180,8 @@ task_groups:
11771180
MONGODB_VERSION: "8.0"
11781181
args:
11791182
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
1183+
teardown_task:
1184+
- func: "upload coverage report"
11801185
setup_group_can_fail_task: true
11811186
setup_group_timeout_secs: 1800
11821187
tasks:
@@ -1193,13 +1198,14 @@ task_groups:
11931198
${PREPARE_SHELL}
11941199
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
11951200
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/setup.sh
1196-
teardown_task:
1201+
teardown_group:
11971202
- command: shell.exec
11981203
params:
11991204
shell: bash
12001205
script: |-
12011206
${PREPARE_SHELL}
12021207
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/teardown.sh
1208+
- func: "upload coverage report"
12031209
setup_group_can_fail_task: true
12041210
setup_group_timeout_secs: 1800
12051211
tasks:
@@ -1216,13 +1222,14 @@ task_groups:
12161222
${PREPARE_SHELL}
12171223
export GCPOIDC_VMNAME_PREFIX="NODE_DRIVER"
12181224
$DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/setup.sh
1219-
teardown_task:
1225+
teardown_group:
12201226
- command: shell.exec
12211227
params:
12221228
shell: bash
12231229
script: |-
12241230
${PREPARE_SHELL}
12251231
$DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/teardown.sh
1232+
- func: "upload coverage report"
12261233
setup_group_can_fail_task: true
12271234
setup_group_timeout_secs: 1800
12281235
tasks:
@@ -1245,13 +1252,14 @@ task_groups:
12451252
- command: expansions.update
12461253
params:
12471254
file: src/atlas-expansion.yml
1248-
teardown_task:
1255+
teardown_group:
12491256
- command: subprocess.exec
12501257
params:
12511258
working_dir: src
12521259
binary: bash
12531260
args:
12541261
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
1262+
- func: "upload coverage report"
12551263
setup_group_can_fail_task: true
12561264
setup_group_timeout_secs: 1800
12571265
tasks:
@@ -1272,13 +1280,14 @@ task_groups:
12721280
- command: expansions.update
12731281
params:
12741282
file: src/atlas-expansion.yml
1275-
teardown_task:
1283+
teardown_group:
12761284
- command: subprocess.exec
12771285
params:
12781286
working_dir: src
12791287
binary: bash
12801288
args:
12811289
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
1290+
- func: "upload coverage report"
12821291
setup_group_can_fail_task: true
12831292
setup_group_timeout_secs: 1800
12841293
tasks:

.evergreen/config.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@ functions:
600600
# compression tests.
601601
aws s3 cp --recursive s3://mciuploads/mongo-node-driver/${revision}/${version_id}/ \
602602
coverage/ \
603-
--exclude "results.*.json" \
604-
--exclude "*rhel80-large*" \
605-
--include "*fermiun"
603+
--exclude "results.*.json"
606604
607605
# npx does not recognize the dependency so install it directly.
608606
npm install @istanbuljs/nyc-config-typescript
@@ -2926,6 +2924,7 @@ task_groups:
29262924
binary: bash
29272925
args:
29282926
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
2927+
- func: upload coverage report
29292928
tasks:
29302929
- test-gcpkms-task
29312930
- name: test_azurekms_task_group
@@ -2950,6 +2949,7 @@ task_groups:
29502949
binary: bash
29512950
args:
29522951
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh
2952+
- func: upload coverage report
29532953
tasks:
29542954
- test-azurekms-task
29552955
- name: testk8soidc_task_group_eks
@@ -2963,7 +2963,8 @@ task_groups:
29632963
binary: bash
29642964
args:
29652965
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
2966-
teardown_task:
2966+
teardown_group:
2967+
- func: upload coverage report
29672968
- command: subprocess.exec
29682969
params:
29692970
binary: bash
@@ -2984,7 +2985,8 @@ task_groups:
29842985
binary: bash
29852986
args:
29862987
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
2987-
teardown_task:
2988+
teardown_group:
2989+
- func: upload coverage report
29882990
- command: subprocess.exec
29892991
params:
29902992
binary: bash
@@ -3005,7 +3007,8 @@ task_groups:
30053007
binary: bash
30063008
args:
30073009
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
3008-
teardown_task:
3010+
teardown_group:
3011+
- func: upload coverage report
30093012
- command: subprocess.exec
30103013
params:
30113014
binary: bash
@@ -3032,6 +3035,8 @@ task_groups:
30323035
MONGODB_VERSION: '8.0'
30333036
args:
30343037
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
3038+
teardown_task:
3039+
- func: upload coverage report
30353040
setup_group_can_fail_task: true
30363041
setup_group_timeout_secs: 1800
30373042
tasks:
@@ -3047,13 +3052,14 @@ task_groups:
30473052
${PREPARE_SHELL}
30483053
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
30493054
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/setup.sh
3050-
teardown_task:
3055+
teardown_group:
30513056
- command: shell.exec
30523057
params:
30533058
shell: bash
30543059
script: |-
30553060
${PREPARE_SHELL}
30563061
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/teardown.sh
3062+
- func: upload coverage report
30573063
setup_group_can_fail_task: true
30583064
setup_group_timeout_secs: 1800
30593065
tasks:
@@ -3069,13 +3075,14 @@ task_groups:
30693075
${PREPARE_SHELL}
30703076
export GCPOIDC_VMNAME_PREFIX="NODE_DRIVER"
30713077
$DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/setup.sh
3072-
teardown_task:
3078+
teardown_group:
30733079
- command: shell.exec
30743080
params:
30753081
shell: bash
30763082
script: |-
30773083
${PREPARE_SHELL}
30783084
$DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/teardown.sh
3085+
- func: upload coverage report
30793086
setup_group_can_fail_task: true
30803087
setup_group_timeout_secs: 1800
30813088
tasks:
@@ -3097,13 +3104,14 @@ task_groups:
30973104
- command: expansions.update
30983105
params:
30993106
file: src/atlas-expansion.yml
3100-
teardown_task:
3107+
teardown_group:
31013108
- command: subprocess.exec
31023109
params:
31033110
working_dir: src
31043111
binary: bash
31053112
args:
31063113
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
3114+
- func: upload coverage report
31073115
setup_group_can_fail_task: true
31083116
setup_group_timeout_secs: 1800
31093117
tasks:
@@ -3123,13 +3131,14 @@ task_groups:
31233131
- command: expansions.update
31243132
params:
31253133
file: src/atlas-expansion.yml
3126-
teardown_task:
3134+
teardown_group:
31273135
- command: subprocess.exec
31283136
params:
31293137
working_dir: src
31303138
binary: bash
31313139
args:
31323140
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
3141+
- func: upload coverage report
31333142
setup_group_can_fail_task: true
31343143
setup_group_timeout_secs: 1800
31353144
tasks:

package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -131,34 +131,34 @@
131131
"check:bench": "npm --prefix test/benchmarks/driver_bench start",
132132
"check:coverage": "nyc npm run test:all",
133133
"check:integration-coverage": "nyc npm run check:test",
134-
"check:lambda": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js",
135-
"check:lambda:aws": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js",
134+
"check:lambda": "nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js",
135+
"check:lambda:aws": "nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js",
136136
"check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd",
137137
"check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test",
138138
"check:tsd": "tsd --version && tsd",
139139
"check:dependencies": "mocha test/action/dependency.test.ts",
140140
"check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd",
141141
"check:search-indexes": "nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts",
142142
"check:test": "mocha --config test/mocha_mongodb.js test/integration",
143-
"check:unit": "mocha test/unit",
143+
"check:unit": "nyc mocha test/unit",
144144
"check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
145-
"check:atlas": "mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts",
146-
"check:resource-management": "mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts",
147-
"check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts",
148-
"check:adl": "mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing",
145+
"check:atlas": "nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts",
146+
"check:resource-management": "nyc mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts",
147+
"check:drivers-atlas-testing": "nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts",
148+
"check:adl": "nyc mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing",
149149
"check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts",
150-
"check:oidc-auth": "mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts",
151-
"check:oidc-test": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts",
152-
"check:oidc-azure": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts",
153-
"check:oidc-gcp": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts",
154-
"check:oidc-k8s": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts",
150+
"check:oidc-auth": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts",
151+
"check:oidc-test": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts",
152+
"check:oidc-azure": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts",
153+
"check:oidc-gcp": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts",
154+
"check:oidc-k8s": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts",
155155
"check:kerberos": "nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts",
156-
"check:tls": "mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts",
156+
"check:tls": "nyc mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts",
157157
"check:ldap": "nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts",
158-
"check:socks5": "mocha --config test/manual/mocharc.js test/manual/socks5.test.ts",
159-
"check:csfle": "mocha --config test/mocha_mongodb.js test/integration/client-side-encryption",
160-
"check:snappy": "mocha test/unit/assorted/snappy.test.js",
161-
"check:x509": "mocha test/manual/x509_auth.test.ts",
158+
"check:socks5": "nyc mocha --config test/manual/mocharc.js test/manual/socks5.test.ts",
159+
"check:csfle": "nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption",
160+
"check:snappy": "nyc mocha test/unit/assorted/snappy.test.js",
161+
"check:x509": "nyc mocha test/manual/x509_auth.test.ts",
162162
"fix:eslint": "npm run check:eslint -- --fix",
163163
"prepare": "node etc/prepare.js",
164164
"preview:docs": "ts-node etc/docs/preview.ts",

0 commit comments

Comments
 (0)