Skip to content

Commit 7c23641

Browse files
committed
exit leaking test suites early by default
1 parent abe5b76 commit 7c23641

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 1 deletion
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} SKIP_DEPS=1 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

.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} SKIP_DEPS=1 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/run-tests.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -o xtrace # Write all commands first to stderr
2+
# set -o xtrace # Write all commands first to stderr
33
set -o errexit # Exit the script with error if any of the commands fail
44

55
# Supported/used environment variables:
@@ -10,17 +10,21 @@ set -o errexit # Exit the script with error if any of the commands fail
1010
# MARCH Machine Architecture. Defaults to lowercase uname -m
1111
# TEST_NPM_SCRIPT Script to npm run. Defaults to "test-nolint"
1212
# SKIP_DEPS Skip installing dependencies
13+
# NO_EXIT Don't exit early from tests that leak resources
1314

1415
AUTH=${AUTH:-noauth}
15-
UNIFIED=${UNIFIED:-}
16+
UNIFIED=${UNIFIED:-0}
1617
MONGODB_URI=${MONGODB_URI:-}
1718
TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-test-nolint}
19+
if [[ -z "${NO_EXIT}" ]]; then
20+
TEST_NPM_SCRIPT="$TEST_NPM_SCRIPT -- --exit"
21+
fi
1822

1923
# ssl setup
2024
SSL=${SSL:-nossl}
2125
if [ "$SSL" != "nossl" ]; then
22-
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
23-
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"
2428
fi
2529

2630
# run tests

0 commit comments

Comments
 (0)