Skip to content

Commit f557c8a

Browse files
authored
chore(ci): continuous matrix integration [3.6] (#2667)
NODE-2914
1 parent a25b67c commit f557c8a

File tree

6 files changed

+39
-46
lines changed

6 files changed

+39
-46
lines changed

.evergreen/config.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ functions:
113113
fi
114114
115115
AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} MONGODB_URI="${MONGODB_URI}" \
116-
NODE_VERSION=${NODE_VERSION} bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
116+
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=1 NO_EXIT=1 \
117+
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
117118
run checks:
118119
- command: shell.exec
119120
type: test
@@ -1672,11 +1673,11 @@ buildvariants:
16721673
NODE_LTS_NAME: argon
16731674
CLIENT_ENCRYPTION: true
16741675
tasks: *ref_2
1675-
- name: windows-64-vs2013-erbium
1676-
display_name: Windows (VS2013) Node Erbium
1676+
- name: windows-64-vs2013-carbon
1677+
display_name: Windows (VS2013) Node Carbon
16771678
run_on: windows-64-vs2013-large
16781679
expansions:
1679-
NODE_LTS_NAME: erbium
1680+
NODE_LTS_NAME: carbon
16801681
MSVS_VERSION: 2013
16811682
tasks: &ref_3
16821683
- test-4.2-server
@@ -1721,20 +1722,6 @@ buildvariants:
17211722
- test-2.6-server-unified
17221723
- test-2.6-replica_set-unified
17231724
- test-2.6-sharded_cluster-unified
1724-
- name: windows-64-vs2013-dubnium
1725-
display_name: Windows (VS2013) Node Dubnium
1726-
run_on: windows-64-vs2013-large
1727-
expansions:
1728-
NODE_LTS_NAME: dubnium
1729-
MSVS_VERSION: 2013
1730-
tasks: *ref_3
1731-
- name: windows-64-vs2013-carbon
1732-
display_name: Windows (VS2013) Node Carbon
1733-
run_on: windows-64-vs2013-large
1734-
expansions:
1735-
NODE_LTS_NAME: carbon
1736-
MSVS_VERSION: 2013
1737-
tasks: *ref_3
17381725
- name: windows-64-vs2013-boron
17391726
display_name: Windows (VS2013) Node Boron
17401727
run_on: windows-64-vs2013-large

.evergreen/config.yml.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ functions:
132132
fi
133133

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

137138
"run checks":
138139
- command: shell.exec

.evergreen/generate_evergreen_tasks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ const OPERATING_SYSTEMS = [
4545
display_name: 'Windows (VS2013)',
4646
run_on: 'windows-64-vs2013-large',
4747
msvsVersion: 2013,
48-
mongoVersion: '<4.4'
48+
mongoVersion: '<4.4',
49+
nodeVersions: ['carbon', 'boron', 'argon']
4950
},
5051
{
5152
name: 'windows-64-vs2015',

.evergreen/install-dependencies.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ EOT
8686
else
8787
curl -o- $NVM_URL | bash
8888
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
89-
nvm install --no-progress --lts=${NODE_LTS_NAME}
89+
nvm install --no-progress $NODE_VERSION
9090

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

104-
# install node dependencies
105-
if [[ "$SKIP_INSTALL" == "1" ]]; then
106-
echo "Skipping npm install"
107-
else
108-
echo "Running npm install"
109-
npm install --unsafe-perm
110-
fi
104+
npm install --unsafe-perm

.evergreen/run-tests.sh

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,44 @@ set -o errexit # Exit the script with error if any of the commands fail
88
# UNIFIED Set to enable the Unified SDAM topology for the node driver
99
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
1010
# MARCH Machine Architecture. Defaults to lowercase uname -m
11+
# TEST_NPM_SCRIPT Script to npm run. Defaults to "test-nolint"
12+
# SKIP_DEPS Skip installing dependencies
13+
# NO_EXIT Don't exit early from tests that leak resources
1114

1215
AUTH=${AUTH:-noauth}
13-
UNIFIED=${UNIFIED:-}
16+
UNIFIED=${UNIFIED:-0}
1417
MONGODB_URI=${MONGODB_URI:-}
15-
TEST_NPM_SCRIPT="test-nolint"
18+
TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-test-nolint}
19+
if [[ -z "${NO_EXIT}" ]]; then
20+
TEST_NPM_SCRIPT="$TEST_NPM_SCRIPT -- --exit"
21+
fi
1622

1723
# ssl setup
1824
SSL=${SSL:-nossl}
1925
if [ "$SSL" != "nossl" ]; then
20-
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
21-
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
26+
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
27+
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
2228
fi
2329

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

2733
export PATH="/opt/mongodbtoolchain/v2/bin:$PATH"
28-
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
29-
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
30-
if [[ "$OS" == "Windows_NT" ]]; then
31-
export NVM_HOME=`cygpath -m -a "$NVM_DIR"`
32-
export NVM_SYMLINK=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
33-
export NVM_ARTIFACTS_PATH=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
34-
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH
35-
echo "updated path on windows PATH=$PATH"
34+
35+
if [[ -z "${SKIP_DEPS}" ]]; then
36+
source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
3637
else
37-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
38+
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
39+
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
40+
if [[ "$OS" == "Windows_NT" ]]; then
41+
export NVM_HOME=`cygpath -m -a "$NVM_DIR"`
42+
export NVM_SYMLINK=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
43+
export NVM_ARTIFACTS_PATH=`cygpath -m -a "$NODE_ARTIFACTS_PATH/bin"`
44+
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH
45+
else
46+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
47+
fi
3848
fi
39-
echo "initializing NVM, NVM_DIR=$NVM_DIR"
4049

4150
# only run FLE tets on hosts we explicitly choose to test on
4251
if [[ -z "${CLIENT_ENCRYPTION}" ]]; then

test/functional/change_stream.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,20 +1601,21 @@ describe('Change Streams', function() {
16011601
const collection = database.collection('MongoNetworkErrorTestPromises');
16021602
const changeStream = collection.watch(pipeline);
16031603

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

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

16141616
const fileContents = fs.readFileSync(filename, 'utf8');
1615-
const parsedFileContents = JSON.parse(fileContents);
1617+
const parsedFileContents = JSON.parse(fileContents.split(/\n/)[0]);
16161618
expect(parsedFileContents).to.have.nested.property('fullDocument.a', 1);
1617-
16181619
done();
16191620
});
16201621
});

0 commit comments

Comments
 (0)