forked from mongodb-labs/drivers-evergreen-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.sh
executable file
·45 lines (33 loc) · 1.33 KB
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -o errexit # Exit the script with error if any of the commands fail
# Supported/used environment variables:
# AUTH Set to enable authentication. Defaults to "noauth"
# SSL Set to enable SSL. Defaults to "nossl"
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
# MARCH Machine Architecture. Defaults to lowercase uname -m
AUTH=${AUTH:-noauth}
SSL=${SSL:-nossl}
MONGODB_URI=${MONGODB_URI:-}
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
if [ "$AUTH" != "noauth" ]; then
export MONGOC_TEST_USER="bob"
export MONGOC_TEST_PASSWORD="pwd123"
fi
if [ "$SSL" != "nossl" ]; then
export MONGOC_TEST_SSL_PEM_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
export MONGOC_TEST_SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
fi
echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI"
# Run the tests, and store the results in a Evergreen compatible JSON results file
case "$OS" in
cygwin*)
make test
;;
sunos)
gmake -o test-libmongoc test TEST_ARGS="--no-fork -d -F test-results.json"
;;
*)
make -o test-libmongoc test TEST_ARGS="--no-fork -d -F test-results.json"
;;
esac