Skip to content

Commit 62717a1

Browse files
authored
ci: add mongosh integration testing (#2698)
NODE-2940
1 parent 0b47a01 commit 62717a1

File tree

4 files changed

+72
-3
lines changed

4 files changed

+72
-3
lines changed

.evergreen/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ functions:
137137
script: |
138138
${PREPARE_SHELL}
139139
bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh
140+
run mongosh integration tests:
141+
- command: shell.exec
142+
type: test
143+
params:
144+
working_dir: src
145+
script: |
146+
${PREPARE_SHELL}
147+
bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
140148
cleanup:
141149
- command: shell.exec
142150
params:
@@ -1132,6 +1140,15 @@ tasks:
11321140
vars:
11331141
NODE_LTS_NAME: erbium
11341142
- func: run checks
1143+
- name: run-mongosh-integration-tests
1144+
tags:
1145+
- run-mongosh-integration-tests
1146+
exec_timeout_secs: 3600
1147+
commands:
1148+
- func: install dependencies
1149+
vars:
1150+
NODE_LTS_NAME: fermium
1151+
- func: run mongosh integration tests
11351152
buildvariants:
11361153
- name: macos-1014-dubnium
11371154
display_name: macOS 10.14 Node Dubnium
@@ -1359,6 +1376,11 @@ buildvariants:
13591376
run_on: rhel70
13601377
tasks:
13611378
- run-checks
1379+
- name: mongosh_integration_tests
1380+
display_name: mongosh integration tests
1381+
run_on: ubuntu1804-test
1382+
tasks:
1383+
- run-mongosh-integration-tests
13621384
- name: ubuntu1804-test-mongodb-aws
13631385
display_name: MONGODB-AWS Auth test
13641386
run_on: ubuntu1804-test

.evergreen/config.yml.in

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ functions:
159159
${PREPARE_SHELL}
160160
bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh
161161

162+
"run mongosh integration tests":
163+
- command: shell.exec
164+
type: test
165+
params:
166+
working_dir: "src"
167+
script: |
168+
${PREPARE_SHELL}
169+
bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
170+
162171
"cleanup":
163172
- command: shell.exec
164173
params:
@@ -253,7 +262,7 @@ functions:
253262
script: |
254263
MONGODB_URI='${plain_auth_mongodb_uri}' NODE_LTS_NAME='${NODE_LTS_NAME}' \
255264
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
256-
265+
257266
"run data lake tests":
258267
- command: shell.exec
259268
type: test
@@ -262,7 +271,7 @@ functions:
262271
script: |
263272
MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
264273
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
265-
274+
266275
"run tls tests":
267276
- command: shell.exec
268277
type: test

.evergreen/generate_evergreen_tasks.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,30 @@ BUILD_VARIANTS.push({
484484
tasks: ['run-checks']
485485
});
486486

487-
// special case for MONGODB-AWS authentication
487+
// singleton build variant for mongosh integration tests
488+
SINGLETON_TASKS.push({
489+
name: 'run-mongosh-integration-tests',
490+
tags: ['run-mongosh-integration-tests'],
491+
exec_timeout_secs: 3600,
492+
commands: [
493+
{
494+
func: 'install dependencies',
495+
vars: {
496+
NODE_LTS_NAME: 'fermium'
497+
}
498+
},
499+
{ func: 'run mongosh integration tests' }
500+
]
501+
});
488502

503+
BUILD_VARIANTS.push({
504+
name: 'mongosh_integration_tests',
505+
display_name: 'mongosh integration tests',
506+
run_on: 'ubuntu1804-test',
507+
tasks: ['run-mongosh-integration-tests']
508+
});
509+
510+
// special case for MONGODB-AWS authentication
489511
BUILD_VARIANTS.push({
490512
name: 'ubuntu1804-test-mongodb-aws',
491513
display_name: 'MONGODB-AWS Auth test',
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -o errexit # Exit the script with error if any of the commands fail
3+
set -o xtrace # Write all commands first to stderr
4+
5+
export PROJECT_DIRECTORY="$(pwd)"
6+
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
7+
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
8+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
9+
10+
npm pack | tee npm-pack.log
11+
export TARBALL_FILENAME="$(tail -n1 npm-pack.log)"
12+
cd /tmp
13+
git clone --depth=10 https://github.com/mongodb-js/mongosh.git
14+
cd mongosh
15+
export REPLACE_PACKAGE="mongodb:${PROJECT_DIRECTORY}/${TARBALL_FILENAME}"
16+
npm run test-nodedriver

0 commit comments

Comments
 (0)