Skip to content

Commit

Permalink
ci(NODE-5652): move vars to expansions (#3877)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken authored Oct 4, 2023
1 parent 09f2a67 commit 33933ba
Show file tree
Hide file tree
Showing 3 changed files with 1,580 additions and 1,243 deletions.
162 changes: 90 additions & 72 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ functions:
is_patch: ${is_patch}
project: ${project}
args:
- .evergreen/prepare-shell.sh
- .evergreen/prepare-shell.sh

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


"reset aws instance profile":
- command: shell.exec
params:
Expand Down Expand Up @@ -503,14 +502,14 @@ functions:
done
"install dependencies":
- command: shell.exec
- command: subprocess.exec
type: setup
params:
working_dir: "src"
script: |
${PREPARE_SHELL}
NODE_LTS_VERSION=${NODE_LTS_VERSION} NPM_OPTIONS=${NPM_OPTIONS} NPM_VERSION=${NPM_VERSION}\
bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
binary: bash
add_expansions_to_env: true
args:
- .evergreen/install-dependencies.sh

"install aws-credential-providers":
- command: shell.exec
Expand Down Expand Up @@ -616,16 +615,16 @@ functions:
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
"run data lake tests":
- command: shell.exec
type: test
params:
working_dir: src
script: |
export PROJECT_DIRECTORY="$(pwd)"
export MONGODB_URI='mongodb://mhuser:pencil@localhost'
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
- command: shell.exec
type: test
params:
working_dir: src
script: |
export PROJECT_DIRECTORY="$(pwd)"
export MONGODB_URI='mongodb://mhuser:pencil@localhost'
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
"run tls tests":
- command: shell.exec
Expand Down Expand Up @@ -1060,7 +1059,7 @@ functions:
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/coverage/coverage-final.json
local_file: src/coverage/coverage-final.json
optional: true
# Upload the coverage report for all tasks in a single build to the same directory.
# TODO NODE-4707 - change upload directory to ${UPLOAD_BUCKET}
Expand Down Expand Up @@ -1107,7 +1106,7 @@ functions:
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/coverage-report/index.html
local_file: src/coverage-report/index.html
remote_file: mongo-node-driver/${revision}/${version_id}/coverage/index.html
bucket: mciuploads
permissions: public-read
Expand Down Expand Up @@ -1140,25 +1139,30 @@ tasks:
- performance
exec_timeout_secs: 3600
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NODE_LTS_VERSION, value: v18.16.0 }
- { key: NPM_VERSION, value: "9" }
- { key: VERSION, value: v6.0-perf }
- { key: TOPOLOGY, value: server }
- { key: AUTH, value: noauth }
- func: install dependencies
vars:
NODE_LTS_VERSION: v18.16.0
NPM_VERSION: 9
- func: bootstrap mongo-orchestration
vars:
VERSION: v6.0-perf
TOPOLOGY: server
AUTH: noauth
- func: run spec driver benchmarks
- command: perf.send
params:
file: src/results.json

- name: "test-gcpkms-task"
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- func: "install dependencies"
vars:
NPM_VERSION: 9
# Upload node driver to a GCP instance
- command: subprocess.exec
type: setup
Expand Down Expand Up @@ -1188,19 +1192,20 @@ tasks:
args:
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh


- name: "test-gcpkms-fail-task"
# test-gcpkms-fail-task runs in a non-GCE environment.
# It is expected to fail to obtain GCE credentials.
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- { key: VERSION, value: latest }
- { key: TOPOLOGY, value: server }
- { key: AUTH, value: noauth }
- func: "install dependencies"
vars:
NPM_VERSION: 9
- func: bootstrap mongo-orchestration
vars:
VERSION: latest
TOPOLOGY: server
AUTH: noauth
- command: subprocess.exec
type: test
params:
Expand All @@ -1210,12 +1215,14 @@ tasks:
args:
- src/.evergreen/run-gcp-kms-tests.sh


- name: "test-azurekms-task"
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- func: "install dependencies"
vars:
NPM_VERSION: 9
- command: subprocess.exec
type: setup
params:
Expand All @@ -1236,14 +1243,16 @@ tasks:

- name: "test-azurekms-fail-task"
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- { key: VERSION, value: latest }
- { key: TOPOLOGY, value: server }
- { key: AUTH, value: noauth }
- func: "install dependencies"
vars:
NPM_VERSION: 9
- func: bootstrap mongo-orchestration
vars:
VERSION: latest
TOPOLOGY: server
AUTH: noauth
- command: subprocess.exec
type: test
params:
Expand All @@ -1255,9 +1264,12 @@ tasks:

- name: "oidc-auth-test-azure-latest"
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- func: "install dependencies"
vars:
NPM_VERSION: 9
- command: subprocess.exec
params:
working_dir: src
Expand All @@ -1268,13 +1280,16 @@ tasks:
AZUREOIDC_CLIENTID: ${testazureoidc_clientid}
PROVIDER_NAME: azure
args:
- .evergreen/run-oidc-tests-azure.sh
- .evergreen/run-oidc-tests-azure.sh

- name: "test-aws-lambda-deployed"
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NPM_VERSION, value: "9" }
- func: "install dependencies"
vars:
NPM_VERSION: 9
- command: ec2.assume_role
params:
role_arn: ${LAMBDA_AWS_ROLE_ARN}
Expand All @@ -1292,9 +1307,12 @@ tasks:

- name: test-search-index-helpers
commands:
- command: expansions.update
type: setup
params:
updates:
- { key: NODE_LTS_VERSION, value: "20" }
- func: install dependencies
vars:
NODE_LTS_VERSION: 20
- command: subprocess.exec
params:
working_dir: src
Expand Down Expand Up @@ -1408,31 +1426,31 @@ task_groups:

- name: testazureoidc_task_group
setup_group:
- func: fetch source
- command: shell.exec
params:
shell: bash
script: |-
set -o errexit
${PREPARE_SHELL}
export AZUREOIDC_CLIENTID="${testazureoidc_clientid}"
export AZUREOIDC_TENANTID="${testazureoic_tenantid}"
export AZUREOIDC_SECRET="${testazureoidc_secret}"
export AZUREOIDC_KEYVAULT=${testazureoidc_keyvault}
export AZUREOIDC_DRIVERS_TOOLS="$DRIVERS_TOOLS"
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
- func: fetch source
- command: shell.exec
params:
shell: bash
script: |-
set -o errexit
${PREPARE_SHELL}
export AZUREOIDC_CLIENTID="${testazureoidc_clientid}"
export AZUREOIDC_TENANTID="${testazureoic_tenantid}"
export AZUREOIDC_SECRET="${testazureoidc_secret}"
export AZUREOIDC_KEYVAULT=${testazureoidc_keyvault}
export AZUREOIDC_DRIVERS_TOOLS="$DRIVERS_TOOLS"
export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER"
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
teardown_group:
- command: shell.exec
params:
shell: bash
script: |-
${PREPARE_SHELL}
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/delete-vm.sh
- command: shell.exec
params:
shell: bash
script: |-
${PREPARE_SHELL}
$DRIVERS_TOOLS/.evergreen/auth_oidc/azure/delete-vm.sh
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
tasks:
- oidc-auth-test-azure-latest
- oidc-auth-test-azure-latest

- name: test_atlas_task_group
setup_group:
Expand Down Expand Up @@ -1503,7 +1521,7 @@ post:
- func: "cleanup"

ignore:
- '*.md'
- "*.md"
buildvariants:
- name: performance-tests
display_name: Performance Test
Expand Down
Loading

0 comments on commit 33933ba

Please sign in to comment.