-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): continuous matrix testing support (#2631)
- Loading branch information
Showing
4 changed files
with
158 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
# set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
DRIVER_VERSION=$1 | ||
echo "MONGODB_URI=$MONGODB_URI VERSION=$VERSION TOPOLOGY=$TOPOLOGY AUTH=$AUTH SSL=$SSL" | ||
echo "PLATFORM=$PLATFORM DRIVER_VERSION=$DRIVER_VERSION" | ||
|
||
ADDITIONAL_DEPS=: | ||
|
||
case $DRIVER_VERSION in | ||
'3.6') | ||
VERSION_DESC="v3.6" | ||
TEST_COMMAND='npm run test-nolint' | ||
;; | ||
'fix-srv-test-timeout') | ||
VERSION_DESC="v3.6 (debug branch)" | ||
TEST_COMMAND='npm run test-nolint' | ||
;; | ||
'3.3') | ||
VERSION_DESC="v3.3" | ||
TEST_COMMAND='npm run test-nolint' | ||
;; | ||
'3.1') | ||
VERSION_DESC="v3.1" | ||
if [[ $TOPOLOGY == "server" ]]; then | ||
MONGODB_ENVIRONMENT='single' | ||
else | ||
MONGODB_ENVIRONMENT=$TOPOLOGY | ||
fi | ||
export MONGODB_ENVIRONMENT | ||
export MONGODB_VERSION=$VERSION | ||
ADDITIONAL_DEPS="npm install emadum/mongodb-test-runner#continuous-matrix-testing" | ||
TEST_COMMAND="./node_modules/.bin/mongodb-test-runner -s -l test/unit test/functional" | ||
;; | ||
*) | ||
echo "Unsupported driver version: $DRIVER_VERSION" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Testing NodeJS driver $VERSION_DESC" | ||
echo "TEST_COMMAND=$TEST_COMMAND" | ||
|
||
export PROJECT_DIRECTORY=$(cd $(dirname ${BASH_SOURCE[0]}) && cd .. && pwd) | ||
export NODE_LTS_NAME=dubnium | ||
export SKIP_INSTALL=1 | ||
|
||
if [[ $OS == "Windows_NT" || $PLATFORM == "windows-64" ]]; then | ||
export PROJECT_DIRECTORY=`cygpath -w "$PROJECT_DIRECTORY"` | ||
fi | ||
|
||
echo "PROJECT_DIRECTORY=$PROJECT_DIRECTORY NODE_LTS_NAME=$NODE_LTS_NAME" | ||
|
||
cd $PROJECT_DIRECTORY | ||
|
||
echo "1. Installing driver depenencies" | ||
bash .evergreen/install-dependencies.sh | ||
echo "2. Driver dependencies installed, running test suite" | ||
|
||
git checkout $DRIVER_VERSION | ||
echo "3. Checked out version branch, running dependency installation" | ||
|
||
npm install --unsafe-perm | ||
echo "4. Library dependencies installed, running test suite" | ||
$ADDITIONAL_DEPS | ||
$TEST_COMMAND |