Skip to content

Commit 33933ba

Browse files
authored
ci(NODE-5652): move vars to expansions (#3877)
1 parent 09f2a67 commit 33933ba

File tree

3 files changed

+1580
-1243
lines changed

3 files changed

+1580
-1243
lines changed

.evergreen/config.in.yml

Lines changed: 90 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ functions:
3838
is_patch: ${is_patch}
3939
project: ${project}
4040
args:
41-
- .evergreen/prepare-shell.sh
41+
- .evergreen/prepare-shell.sh
4242

4343
# Load the expansion file to make an evergreen variable with the current unique version
4444
- command: expansions.update
@@ -448,7 +448,6 @@ functions:
448448
args:
449449
- "${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh"
450450

451-
452451
"reset aws instance profile":
453452
- command: shell.exec
454453
params:
@@ -503,14 +502,14 @@ functions:
503502
done
504503
505504
"install dependencies":
506-
- command: shell.exec
505+
- command: subprocess.exec
507506
type: setup
508507
params:
509508
working_dir: "src"
510-
script: |
511-
${PREPARE_SHELL}
512-
NODE_LTS_VERSION=${NODE_LTS_VERSION} NPM_OPTIONS=${NPM_OPTIONS} NPM_VERSION=${NPM_VERSION}\
513-
bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
509+
binary: bash
510+
add_expansions_to_env: true
511+
args:
512+
- .evergreen/install-dependencies.sh
514513

515514
"install aws-credential-providers":
516515
- command: shell.exec
@@ -616,16 +615,16 @@ functions:
616615
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
617616
618617
"run data lake tests":
619-
- command: shell.exec
620-
type: test
621-
params:
622-
working_dir: src
623-
script: |
624-
export PROJECT_DIRECTORY="$(pwd)"
625-
export MONGODB_URI='mongodb://mhuser:pencil@localhost'
626-
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
618+
- command: shell.exec
619+
type: test
620+
params:
621+
working_dir: src
622+
script: |
623+
export PROJECT_DIRECTORY="$(pwd)"
624+
export MONGODB_URI='mongodb://mhuser:pencil@localhost'
625+
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
627626
628-
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
627+
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
629628
630629
"run tls tests":
631630
- command: shell.exec
@@ -1060,7 +1059,7 @@ functions:
10601059
params:
10611060
aws_key: ${aws_key}
10621061
aws_secret: ${aws_secret}
1063-
local_file: src/coverage/coverage-final.json
1062+
local_file: src/coverage/coverage-final.json
10641063
optional: true
10651064
# Upload the coverage report for all tasks in a single build to the same directory.
10661065
# TODO NODE-4707 - change upload directory to ${UPLOAD_BUCKET}
@@ -1107,7 +1106,7 @@ functions:
11071106
params:
11081107
aws_key: ${aws_key}
11091108
aws_secret: ${aws_secret}
1110-
local_file: src/coverage-report/index.html
1109+
local_file: src/coverage-report/index.html
11111110
remote_file: mongo-node-driver/${revision}/${version_id}/coverage/index.html
11121111
bucket: mciuploads
11131112
permissions: public-read
@@ -1140,25 +1139,30 @@ tasks:
11401139
- performance
11411140
exec_timeout_secs: 3600
11421141
commands:
1142+
- command: expansions.update
1143+
type: setup
1144+
params:
1145+
updates:
1146+
- { key: NODE_LTS_VERSION, value: v18.16.0 }
1147+
- { key: NPM_VERSION, value: "9" }
1148+
- { key: VERSION, value: v6.0-perf }
1149+
- { key: TOPOLOGY, value: server }
1150+
- { key: AUTH, value: noauth }
11431151
- func: install dependencies
1144-
vars:
1145-
NODE_LTS_VERSION: v18.16.0
1146-
NPM_VERSION: 9
11471152
- func: bootstrap mongo-orchestration
1148-
vars:
1149-
VERSION: v6.0-perf
1150-
TOPOLOGY: server
1151-
AUTH: noauth
11521153
- func: run spec driver benchmarks
11531154
- command: perf.send
11541155
params:
11551156
file: src/results.json
11561157

11571158
- name: "test-gcpkms-task"
11581159
commands:
1160+
- command: expansions.update
1161+
type: setup
1162+
params:
1163+
updates:
1164+
- { key: NPM_VERSION, value: "9" }
11591165
- func: "install dependencies"
1160-
vars:
1161-
NPM_VERSION: 9
11621166
# Upload node driver to a GCP instance
11631167
- command: subprocess.exec
11641168
type: setup
@@ -1188,19 +1192,20 @@ tasks:
11881192
args:
11891193
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh
11901194

1191-
11921195
- name: "test-gcpkms-fail-task"
11931196
# test-gcpkms-fail-task runs in a non-GCE environment.
11941197
# It is expected to fail to obtain GCE credentials.
11951198
commands:
1199+
- command: expansions.update
1200+
type: setup
1201+
params:
1202+
updates:
1203+
- { key: NPM_VERSION, value: "9" }
1204+
- { key: VERSION, value: latest }
1205+
- { key: TOPOLOGY, value: server }
1206+
- { key: AUTH, value: noauth }
11961207
- func: "install dependencies"
1197-
vars:
1198-
NPM_VERSION: 9
11991208
- func: bootstrap mongo-orchestration
1200-
vars:
1201-
VERSION: latest
1202-
TOPOLOGY: server
1203-
AUTH: noauth
12041209
- command: subprocess.exec
12051210
type: test
12061211
params:
@@ -1210,12 +1215,14 @@ tasks:
12101215
args:
12111216
- src/.evergreen/run-gcp-kms-tests.sh
12121217

1213-
12141218
- name: "test-azurekms-task"
12151219
commands:
1220+
- command: expansions.update
1221+
type: setup
1222+
params:
1223+
updates:
1224+
- { key: NPM_VERSION, value: "9" }
12161225
- func: "install dependencies"
1217-
vars:
1218-
NPM_VERSION: 9
12191226
- command: subprocess.exec
12201227
type: setup
12211228
params:
@@ -1236,14 +1243,16 @@ tasks:
12361243

12371244
- name: "test-azurekms-fail-task"
12381245
commands:
1246+
- command: expansions.update
1247+
type: setup
1248+
params:
1249+
updates:
1250+
- { key: NPM_VERSION, value: "9" }
1251+
- { key: VERSION, value: latest }
1252+
- { key: TOPOLOGY, value: server }
1253+
- { key: AUTH, value: noauth }
12391254
- func: "install dependencies"
1240-
vars:
1241-
NPM_VERSION: 9
12421255
- func: bootstrap mongo-orchestration
1243-
vars:
1244-
VERSION: latest
1245-
TOPOLOGY: server
1246-
AUTH: noauth
12471256
- command: subprocess.exec
12481257
type: test
12491258
params:
@@ -1255,9 +1264,12 @@ tasks:
12551264

12561265
- name: "oidc-auth-test-azure-latest"
12571266
commands:
1267+
- command: expansions.update
1268+
type: setup
1269+
params:
1270+
updates:
1271+
- { key: NPM_VERSION, value: "9" }
12581272
- func: "install dependencies"
1259-
vars:
1260-
NPM_VERSION: 9
12611273
- command: subprocess.exec
12621274
params:
12631275
working_dir: src
@@ -1268,13 +1280,16 @@ tasks:
12681280
AZUREOIDC_CLIENTID: ${testazureoidc_clientid}
12691281
PROVIDER_NAME: azure
12701282
args:
1271-
- .evergreen/run-oidc-tests-azure.sh
1283+
- .evergreen/run-oidc-tests-azure.sh
12721284

12731285
- name: "test-aws-lambda-deployed"
12741286
commands:
1287+
- command: expansions.update
1288+
type: setup
1289+
params:
1290+
updates:
1291+
- { key: NPM_VERSION, value: "9" }
12751292
- func: "install dependencies"
1276-
vars:
1277-
NPM_VERSION: 9
12781293
- command: ec2.assume_role
12791294
params:
12801295
role_arn: ${LAMBDA_AWS_ROLE_ARN}
@@ -1292,9 +1307,12 @@ tasks:
12921307

12931308
- name: test-search-index-helpers
12941309
commands:
1310+
- command: expansions.update
1311+
type: setup
1312+
params:
1313+
updates:
1314+
- { key: NODE_LTS_VERSION, value: "20" }
12951315
- func: install dependencies
1296-
vars:
1297-
NODE_LTS_VERSION: 20
12981316
- command: subprocess.exec
12991317
params:
13001318
working_dir: src
@@ -1408,31 +1426,31 @@ task_groups:
14081426

14091427
- name: testazureoidc_task_group
14101428
setup_group:
1411-
- func: fetch source
1412-
- command: shell.exec
1413-
params:
1414-
shell: bash
1415-
script: |-
1416-
set -o errexit
1417-
${PREPARE_SHELL}
1418-
export AZUREOIDC_CLIENTID="${testazureoidc_clientid}"
1419-
export AZUREOIDC_TENANTID="${testazureoic_tenantid}"
1420-
export AZUREOIDC_SECRET="${testazureoidc_secret}"
1421-
export AZUREOIDC_KEYVAULT=${testazureoidc_keyvault}
1422-
export AZUREOIDC_DRIVERS_TOOLS="$DRIVERS_TOOLS"
1423-
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
1424-
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
1429+
- func: fetch source
1430+
- command: shell.exec
1431+
params:
1432+
shell: bash
1433+
script: |-
1434+
set -o errexit
1435+
${PREPARE_SHELL}
1436+
export AZUREOIDC_CLIENTID="${testazureoidc_clientid}"
1437+
export AZUREOIDC_TENANTID="${testazureoic_tenantid}"
1438+
export AZUREOIDC_SECRET="${testazureoidc_secret}"
1439+
export AZUREOIDC_KEYVAULT=${testazureoidc_keyvault}
1440+
export AZUREOIDC_DRIVERS_TOOLS="$DRIVERS_TOOLS"
1441+
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
1442+
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
14251443
teardown_group:
1426-
- command: shell.exec
1427-
params:
1428-
shell: bash
1429-
script: |-
1430-
${PREPARE_SHELL}
1431-
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/delete-vm.sh
1444+
- command: shell.exec
1445+
params:
1446+
shell: bash
1447+
script: |-
1448+
${PREPARE_SHELL}
1449+
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/delete-vm.sh
14321450
setup_group_can_fail_task: true
14331451
setup_group_timeout_secs: 1800
14341452
tasks:
1435-
- oidc-auth-test-azure-latest
1453+
- oidc-auth-test-azure-latest
14361454

14371455
- name: test_atlas_task_group
14381456
setup_group:
@@ -1503,7 +1521,7 @@ post:
15031521
- func: "cleanup"
15041522

15051523
ignore:
1506-
- '*.md'
1524+
- "*.md"
15071525
buildvariants:
15081526
- name: performance-tests
15091527
display_name: Performance Test

0 commit comments

Comments
 (0)