Skip to content

Commit b7f2385

Browse files
authored
chore(ci): test on windows (#2633)
NODE-1458
1 parent d442aac commit b7f2385

19 files changed

+571
-444
lines changed

.evergreen/config.yml

+90-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ functions:
1111
- command: git.get_project
1212
params:
1313
directory: src
14-
- command: git.apply_patch
14+
shallow_clone: true
1515
- command: shell.exec
1616
params:
1717
working_dir: src
@@ -24,11 +24,20 @@ functions:
2424
fi
2525
2626
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
27+
2728
export PROJECT_DIRECTORY="$(pwd)"
2829
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
2930
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
3031
export UPLOAD_BUCKET="${project}"
3132
33+
# fix paths on windows
34+
if [ "Windows_NT" = "$OS" ]; then
35+
export DRIVERS_TOOLS=$(cygpath -m -a $DRIVERS_TOOLS)
36+
export MONGO_ORCHESTRATION_HOME=$(cygpath -m -a $MONGO_ORCHESTRATION_HOME)
37+
export MONGODB_BINARIES=$(cygpath -m -a $MONGODB_BINARIES)
38+
export PROJECT_DIRECTORY=$(cygpath -m -a $PROJECT_DIRECTORY)
39+
fi
40+
3241
cat <<EOT > expansion.yml
3342
CURRENT_VERSION: "$CURRENT_VERSION"
3443
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
@@ -60,14 +69,7 @@ functions:
6069
script: >
6170
${PREPARE_SHELL}
6271
63-
rm -rf $DRIVERS_TOOLS
64-
65-
if [ "${project}" = "drivers-tools" ]; then
66-
# If this was a patch build, doing a fresh clone would not actually test the patch
67-
cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
68-
else
69-
git clone git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
70-
fi
72+
git clone --depth 1 git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
7173
7274
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" >
7375
$MONGO_ORCHESTRATION_HOME/orchestration.config
@@ -113,6 +115,7 @@ functions:
113115
type: test
114116
params:
115117
working_dir: src
118+
timeout_secs: 60
116119
script: |
117120
${PREPARE_SHELL}
118121
@@ -124,7 +127,8 @@ functions:
124127
fi
125128
126129
AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} MONGODB_URI="${MONGODB_URI}" \
127-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
130+
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=1 NO_EXIT=1 \
131+
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
128132
run checks:
129133
- command: shell.exec
130134
type: test
@@ -136,20 +140,35 @@ functions:
136140
cleanup:
137141
- command: shell.exec
138142
params:
143+
silent: true
139144
script: |
140145
${PREPARE_SHELL}
141146
rm -rf $DRIVERS_TOOLS || true
142147
fix absolute paths:
143148
- command: shell.exec
144149
params:
150+
silent: true
145151
script: |
146152
${PREPARE_SHELL}
147153
for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do
148154
perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename
149155
done
156+
windows fix:
157+
- command: shell.exec
158+
params:
159+
silent: true
160+
script: |
161+
${PREPARE_SHELL}
162+
# for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
163+
# cat $i | tr -d '\r' > $i.new
164+
# mv $i.new $i
165+
# done
166+
# Copy client certificate because symlinks do not work on Windows.
167+
cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
150168
make files executable:
151169
- command: shell.exec
152170
params:
171+
silent: true
153172
script: |
154173
${PREPARE_SHELL}
155174
for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
@@ -162,7 +181,11 @@ functions:
162181
working_dir: src
163182
script: |
164183
${PREPARE_SHELL}
165-
NODE_LTS_NAME=${NODE_LTS_NAME} bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
184+
NODE_LTS_NAME=${NODE_LTS_NAME} MSVS_VERSION=${MSVS_VERSION} \
185+
bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
186+
- command: expansions.update
187+
params:
188+
file: src/deps-expansion.yml
166189
run atlas tests:
167190
- command: shell.exec
168191
type: test
@@ -439,11 +462,14 @@ functions:
439462
pre:
440463
- func: fetch source
441464
- func: prepare resources
465+
- func: windows fix
442466
- func: fix absolute paths
443467
- func: make files executable
444468
post:
445469
- func: upload test results
446470
- func: cleanup
471+
ignore:
472+
- '*.md'
447473
tasks:
448474
- name: test-latest-server
449475
tags:
@@ -1186,7 +1212,7 @@ buildvariants:
11861212
tasks: *ref_0
11871213
- name: ubuntu-14.04-dubnium
11881214
display_name: Ubuntu 14.04 Node Dubnium
1189-
run_on: ubuntu1404-test
1215+
run_on: ubuntu1404-large
11901216
expansions:
11911217
NODE_LTS_NAME: dubnium
11921218
tasks: &ref_1
@@ -1214,13 +1240,13 @@ buildvariants:
12141240
- test-auth-ldap
12151241
- name: ubuntu-14.04-erbium
12161242
display_name: Ubuntu 14.04 Node Erbium
1217-
run_on: ubuntu1404-test
1243+
run_on: ubuntu1404-large
12181244
expansions:
12191245
NODE_LTS_NAME: erbium
12201246
tasks: *ref_1
12211247
- name: ubuntu-18.04-dubnium
12221248
display_name: Ubuntu 18.04 Node Dubnium
1223-
run_on: ubuntu1804-test
1249+
run_on: ubuntu1804-large
12241250
expansions:
12251251
NODE_LTS_NAME: dubnium
12261252
CLIENT_ENCRYPTION: true
@@ -1274,11 +1300,60 @@ buildvariants:
12741300
- test-4.4-ocsp-malicious-no-responder-mustStaple-server-does-not-staple
12751301
- name: ubuntu-18.04-erbium
12761302
display_name: Ubuntu 18.04 Node Erbium
1277-
run_on: ubuntu1804-test
1303+
run_on: ubuntu1804-large
12781304
expansions:
12791305
NODE_LTS_NAME: erbium
12801306
CLIENT_ENCRYPTION: true
12811307
tasks: *ref_2
1308+
- name: windows-64-vs2015-dubnium
1309+
display_name: Windows (VS2015) Node Dubnium
1310+
run_on: windows-64-vs2015-large
1311+
expansions:
1312+
NODE_LTS_NAME: dubnium
1313+
MSVS_VERSION: 2015
1314+
tasks: &ref_3
1315+
- test-4.2-server
1316+
- test-4.2-replica_set
1317+
- test-4.2-sharded_cluster
1318+
- test-4.0-server
1319+
- test-4.0-replica_set
1320+
- test-4.0-sharded_cluster
1321+
- test-3.6-server
1322+
- test-3.6-replica_set
1323+
- test-3.6-sharded_cluster
1324+
- test-3.4-server
1325+
- test-3.4-replica_set
1326+
- test-3.4-sharded_cluster
1327+
- test-3.2-server
1328+
- test-3.2-replica_set
1329+
- test-3.2-sharded_cluster
1330+
- test-3.0-server
1331+
- test-3.0-replica_set
1332+
- test-3.0-sharded_cluster
1333+
- test-2.6-server
1334+
- test-2.6-replica_set
1335+
- test-2.6-sharded_cluster
1336+
- name: windows-64-vs2015-erbium
1337+
display_name: Windows (VS2015) Node Erbium
1338+
run_on: windows-64-vs2015-large
1339+
expansions:
1340+
NODE_LTS_NAME: erbium
1341+
MSVS_VERSION: 2015
1342+
tasks: *ref_3
1343+
- name: windows-64-vs2017-dubnium
1344+
display_name: Windows (VS2017) Node Dubnium
1345+
run_on: windows-64-vs2017-large
1346+
expansions:
1347+
NODE_LTS_NAME: dubnium
1348+
MSVS_VERSION: 2017
1349+
tasks: *ref_3
1350+
- name: windows-64-vs2017-erbium
1351+
display_name: Windows (VS2017) Node Erbium
1352+
run_on: windows-64-vs2017-large
1353+
expansions:
1354+
NODE_LTS_NAME: erbium
1355+
MSVS_VERSION: 2017
1356+
tasks: *ref_3
12821357
- name: lint
12831358
display_name: lint
12841359
run_on: rhel70

.evergreen/config.yml.in

+39-25
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ functions:
2626
- command: git.get_project
2727
params:
2828
directory: "src"
29-
# Applies the submitted patch, if any
30-
# Deprecated. Should be removed. But still needed for certain agents (ZAP)
31-
- command: git.apply_patch
32-
# Make an evergreen exapanstion file with dynamic values
29+
shallow_clone: true # speed things up by limiting clone depth to 100
30+
# Make an evergreen expansion file with dynamic values
3331
- command: shell.exec
3432
params:
3533
working_dir: "src"
@@ -42,11 +40,20 @@ functions:
4240
fi
4341

4442
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
43+
4544
export PROJECT_DIRECTORY="$(pwd)"
4645
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
4746
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
4847
export UPLOAD_BUCKET="${project}"
4948

49+
# fix paths on windows
50+
if [ "Windows_NT" = "$OS" ]; then
51+
export DRIVERS_TOOLS=$(cygpath -m -a $DRIVERS_TOOLS)
52+
export MONGO_ORCHESTRATION_HOME=$(cygpath -m -a $MONGO_ORCHESTRATION_HOME)
53+
export MONGODB_BINARIES=$(cygpath -m -a $MONGODB_BINARIES)
54+
export PROJECT_DIRECTORY=$(cygpath -m -a $PROJECT_DIRECTORY)
55+
fi
56+
5057
cat <<EOT > expansion.yml
5158
CURRENT_VERSION: "$CURRENT_VERSION"
5259
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
@@ -80,13 +87,7 @@ functions:
8087
params:
8188
script: |
8289
${PREPARE_SHELL}
83-
rm -rf $DRIVERS_TOOLS
84-
if [ "${project}" = "drivers-tools" ]; then
85-
# If this was a patch build, doing a fresh clone would not actually test the patch
86-
cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
87-
else
88-
git clone git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
89-
fi
90+
git clone --depth 1 git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
9091
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config
9192

9293
"bootstrap mongo-orchestration":
@@ -134,6 +135,7 @@ functions:
134135
type: test
135136
params:
136137
working_dir: "src"
138+
timeout_secs: 60
137139
script: |
138140
${PREPARE_SHELL}
139141

@@ -145,7 +147,8 @@ functions:
145147
fi
146148

147149
AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} MONGODB_URI="${MONGODB_URI}" \
148-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
150+
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=1 NO_EXIT=1 \
151+
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
149152

150153
"run checks":
151154
- command: shell.exec
@@ -159,34 +162,38 @@ functions:
159162
"cleanup":
160163
- command: shell.exec
161164
params:
165+
silent: true
162166
script: |
163167
${PREPARE_SHELL}
164168
rm -rf $DRIVERS_TOOLS || true
165169

166170
"fix absolute paths":
167171
- command: shell.exec
168172
params:
173+
silent: true
169174
script: |
170175
${PREPARE_SHELL}
171176
for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do
172177
perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename
173178
done
174179

175-
# "windows fix":
176-
# - command: shell.exec
177-
# params:
178-
# script: |
179-
# ${PREPARE_SHELL}
180-
# for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
181-
# cat $i | tr -d '\r' > $i.new
182-
# mv $i.new $i
183-
# done
184-
# # Copy client certificate because symlinks do not work on Windows.
185-
# cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
180+
"windows fix":
181+
- command: shell.exec
182+
params:
183+
silent: true
184+
script: |
185+
${PREPARE_SHELL}
186+
# for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
187+
# cat $i | tr -d '\r' > $i.new
188+
# mv $i.new $i
189+
# done
190+
# Copy client certificate because symlinks do not work on Windows.
191+
cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
186192

187193
"make files executable":
188194
- command: shell.exec
189195
params:
196+
silent: true
190197
script: |
191198
${PREPARE_SHELL}
192199
for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
@@ -200,7 +207,11 @@ functions:
200207
working_dir: "src"
201208
script: |
202209
${PREPARE_SHELL}
203-
NODE_LTS_NAME=${NODE_LTS_NAME} bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
210+
NODE_LTS_NAME=${NODE_LTS_NAME} MSVS_VERSION=${MSVS_VERSION} \
211+
bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh
212+
- command: expansions.update
213+
params:
214+
file: src/deps-expansion.yml
204215

205216
"run atlas tests":
206217
- command: shell.exec
@@ -495,10 +506,13 @@ functions:
495506
pre:
496507
- func: "fetch source"
497508
- func: "prepare resources"
498-
# - func: "windows fix"
509+
- func: "windows fix"
499510
- func: "fix absolute paths"
500511
- func: "make files executable"
501512

502513
post:
503514
- func: "upload test results"
504515
- func: "cleanup"
516+
517+
ignore:
518+
- '*.md'

0 commit comments

Comments
 (0)