Skip to content

chore(ci): continuous matrix integration [3.6] #2667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ functions:
fi

AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} MONGODB_URI="${MONGODB_URI}" \
NODE_VERSION=${NODE_VERSION} bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=1 NO_EXIT=1 \
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
run checks:
- command: shell.exec
type: test
Expand Down Expand Up @@ -1672,11 +1673,11 @@ buildvariants:
NODE_LTS_NAME: argon
CLIENT_ENCRYPTION: true
tasks: *ref_2
- name: windows-64-vs2013-erbium
display_name: Windows (VS2013) Node Erbium
- name: windows-64-vs2013-carbon
display_name: Windows (VS2013) Node Carbon
run_on: windows-64-vs2013-large
expansions:
NODE_LTS_NAME: erbium
NODE_LTS_NAME: carbon
MSVS_VERSION: 2013
tasks: &ref_3
- test-4.2-server
Expand Down Expand Up @@ -1721,20 +1722,6 @@ buildvariants:
- test-2.6-server-unified
- test-2.6-replica_set-unified
- test-2.6-sharded_cluster-unified
- name: windows-64-vs2013-dubnium
display_name: Windows (VS2013) Node Dubnium
run_on: windows-64-vs2013-large
expansions:
NODE_LTS_NAME: dubnium
MSVS_VERSION: 2013
tasks: *ref_3
- name: windows-64-vs2013-carbon
display_name: Windows (VS2013) Node Carbon
run_on: windows-64-vs2013-large
expansions:
NODE_LTS_NAME: carbon
MSVS_VERSION: 2013
tasks: *ref_3
- name: windows-64-vs2013-boron
display_name: Windows (VS2013) Node Boron
run_on: windows-64-vs2013-large
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ functions:
fi

AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} MONGODB_URI="${MONGODB_URI}" \
NODE_VERSION=${NODE_VERSION} bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=1 NO_EXIT=1 \
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

"run checks":
- command: shell.exec
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const OPERATING_SYSTEMS = [
display_name: 'Windows (VS2013)',
run_on: 'windows-64-vs2013-large',
msvsVersion: 2013,
mongoVersion: '<4.4'
mongoVersion: '<4.4',
nodeVersions: ['carbon', 'boron', 'argon']
},
{
name: 'windows-64-vs2015',
Expand Down
10 changes: 2 additions & 8 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ EOT
else
curl -o- $NVM_URL | bash
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
nvm install --no-progress --lts=${NODE_LTS_NAME}
nvm install --no-progress $NODE_VERSION

# setup npm cache in a local directory
cat <<EOT > .npmrc
Expand All @@ -101,10 +101,4 @@ fi
# NOTE: registry was overridden to not use artifactory, remove the `registry` line when
# BUILD-6774 is resolved.

# install node dependencies
if [[ "$SKIP_INSTALL" == "1" ]]; then
echo "Skipping npm install"
else
echo "Running npm install"
npm install --unsafe-perm
fi
npm install --unsafe-perm
37 changes: 23 additions & 14 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,44 @@ set -o errexit # Exit the script with error if any of the commands fail
# UNIFIED Set to enable the Unified SDAM topology for the node driver
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
# MARCH Machine Architecture. Defaults to lowercase uname -m
# TEST_NPM_SCRIPT Script to npm run. Defaults to "test-nolint"
# SKIP_DEPS Skip installing dependencies
# NO_EXIT Don't exit early from tests that leak resources

AUTH=${AUTH:-noauth}
UNIFIED=${UNIFIED:-}
UNIFIED=${UNIFIED:-0}
MONGODB_URI=${MONGODB_URI:-}
TEST_NPM_SCRIPT="test-nolint"
TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-test-nolint}
if [[ -z "${NO_EXIT}" ]]; then
TEST_NPM_SCRIPT="$TEST_NPM_SCRIPT -- --exit"
fi

# ssl setup
SSL=${SSL:-nossl}
if [ "$SSL" != "nossl" ]; then
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
fi

# run tests
echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI"

export PATH="/opt/mongodbtoolchain/v2/bin:$PATH"
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
if [[ "$OS" == "Windows_NT" ]]; then
export NVM_HOME=`cygpath -m -a "$NVM_DIR"`
export NVM_SYMLINK=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
export NVM_ARTIFACTS_PATH=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH
echo "updated path on windows PATH=$PATH"

if [[ -z "${SKIP_DEPS}" ]]; then
source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
else
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
if [[ "$OS" == "Windows_NT" ]]; then
export NVM_HOME=`cygpath -m -a "$NVM_DIR"`
export NVM_SYMLINK=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
export NVM_ARTIFACTS_PATH=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH
else
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
fi
echo "initializing NVM, NVM_DIR=$NVM_DIR"

# only run FLE tets on hosts we explicitly choose to test on
if [[ -z "${CLIENT_ENCRYPTION}" ]]; then
Expand Down
9 changes: 5 additions & 4 deletions test/functional/change_stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1601,20 +1601,21 @@ describe('Change Streams', function() {
const collection = database.collection('MongoNetworkErrorTestPromises');
const changeStream = collection.watch(pipeline);

const outStream = fs.createWriteStream(filename);
const outStream = fs.createWriteStream(filename, { flags: 'w' });
this.defer(() => outStream.close());

changeStream.stream({ transform: JSON.stringify }).pipe(outStream);
changeStream
.stream({ transform: change => JSON.stringify(change) + '\n' })
.pipe(outStream);
this.defer(() => changeStream.close());
// Listen for changes to the file
const watcher = fs.watch(filename, eventType => {
this.defer(() => watcher.close());
expect(eventType).to.equal('change');

const fileContents = fs.readFileSync(filename, 'utf8');
const parsedFileContents = JSON.parse(fileContents);
const parsedFileContents = JSON.parse(fileContents.split(/\n/)[0]);
expect(parsedFileContents).to.have.nested.property('fullDocument.a', 1);

done();
});
});
Expand Down