diff --git a/.evergreen/config.yml b/.evergreen/config.yml index a67e252bfb9..4d203390a03 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -137,6 +137,14 @@ functions: script: | ${PREPARE_SHELL} bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh + run mongosh integration tests: + - command: shell.exec + type: test + params: + working_dir: src + script: | + ${PREPARE_SHELL} + bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh cleanup: - command: shell.exec params: @@ -1132,6 +1140,15 @@ tasks: vars: NODE_LTS_NAME: erbium - func: run checks + - name: run-mongosh-integration-tests + tags: + - run-mongosh-integration-tests + exec_timeout_secs: 3600 + commands: + - func: install dependencies + vars: + NODE_LTS_NAME: fermium + - func: run mongosh integration tests buildvariants: - name: macos-1014-dubnium display_name: macOS 10.14 Node Dubnium @@ -1359,6 +1376,11 @@ buildvariants: run_on: rhel70 tasks: - run-checks + - name: mongosh_integration_tests + display_name: mongosh integration tests + run_on: ubuntu1804-test + tasks: + - run-mongosh-integration-tests - name: ubuntu1804-test-mongodb-aws display_name: MONGODB-AWS Auth test run_on: ubuntu1804-test diff --git a/.evergreen/config.yml.in b/.evergreen/config.yml.in index 0a8e85f7c81..202cd9ef2a9 100644 --- a/.evergreen/config.yml.in +++ b/.evergreen/config.yml.in @@ -159,6 +159,15 @@ functions: ${PREPARE_SHELL} bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh + "run mongosh integration tests": + - command: shell.exec + type: test + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh + "cleanup": - command: shell.exec params: @@ -253,7 +262,7 @@ 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": - command: shell.exec type: test @@ -262,7 +271,7 @@ functions: 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 diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 7d061a2cad9..db59a6174eb 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -484,8 +484,30 @@ BUILD_VARIANTS.push({ tasks: ['run-checks'] }); -// special case for MONGODB-AWS authentication +// singleton build variant for mongosh integration tests +SINGLETON_TASKS.push({ + name: 'run-mongosh-integration-tests', + tags: ['run-mongosh-integration-tests'], + exec_timeout_secs: 3600, + commands: [ + { + func: 'install dependencies', + vars: { + NODE_LTS_NAME: 'fermium' + } + }, + { func: 'run mongosh integration tests' } + ] +}); +BUILD_VARIANTS.push({ + name: 'mongosh_integration_tests', + display_name: 'mongosh integration tests', + run_on: 'ubuntu1804-test', + tasks: ['run-mongosh-integration-tests'] +}); + +// special case for MONGODB-AWS authentication BUILD_VARIANTS.push({ name: 'ubuntu1804-test-mongodb-aws', display_name: 'MONGODB-AWS Auth test', diff --git a/.evergreen/run-mongosh-integration-tests.sh b/.evergreen/run-mongosh-integration-tests.sh new file mode 100644 index 00000000000..60d0eb75953 --- /dev/null +++ b/.evergreen/run-mongosh-integration-tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -o errexit # Exit the script with error if any of the commands fail +set -o xtrace # Write all commands first to stderr + +export PROJECT_DIRECTORY="$(pwd)" +NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" +export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + +npm pack | tee npm-pack.log +export TARBALL_FILENAME="$(tail -n1 npm-pack.log)" +cd /tmp +git clone --depth=10 https://github.com/mongodb-js/mongosh.git +cd mongosh +export REPLACE_PACKAGE="mongodb:${PROJECT_DIRECTORY}/${TARBALL_FILENAME}" +npm run test-nodedriver