From b71da997dc2471b91bc8415a79ff13d4f55619d7 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Fri, 9 Mar 2018 09:38:30 -0500 Subject: [PATCH] feat(evergreen): add evergreen config based on drivers skeleton This ditches my original custom configuration in favor of one based on the skeleton provided in drivers-evergreen-tools. NODE-884 --- .evergreen/config.yml | 760 +++++++++++++++++++++++++++++ .evergreen/install-dependencies.sh | 12 + .evergreen/run-tests.sh | 33 ++ 3 files changed, 805 insertions(+) create mode 100644 .evergreen/config.yml create mode 100644 .evergreen/install-dependencies.sh create mode 100755 .evergreen/run-tests.sh diff --git a/.evergreen/config.yml b/.evergreen/config.yml new file mode 100644 index 000000000..3af4afb9a --- /dev/null +++ b/.evergreen/config.yml @@ -0,0 +1,760 @@ +# When a task that used to pass starts to fail +# Go through all versions that may have been skipped to detect +# when the task started failing +stepback: true + +# Mark a failure as a system/bootstrap failure (purple box) rather then a task +# failure by default. +# Actual testing tasks are marked with `type: test` +command_type: system + +# Protect ourself against rogue test case, or curl gone wild, that runs forever +# Good rule of thumb: the averageish length a task takes, times 5 +# That roughly accounts for variable system performance for various buildvariants +exec_timeout_secs: 1800 # 6 minutes is the longest we'll ever run + +# What to do when evergreen hits the timeout (`post:` tasks are run automatically) +timeout: + - command: shell.exec + params: + script: | + ls -la + +functions: + "fetch source": + # Executes git clone and applies the submitted patch, if any + - command: git.get_project + params: + directory: "src" + # Applies the submitted patch, if any + # Deprecated. Should be removed. But still needed for certain agents (ZAP) + - command: git.apply_patch + # Make an evergreen exapanstion file with dynamic values + - command: shell.exec + params: + working_dir: "src" + script: | + # Get the current unique version of this checkout + if [ "${is_patch}" = "true" ]; then + CURRENT_VERSION=$(git describe)-patch-${version_id} + else + CURRENT_VERSION=latest + fi + + export DRIVERS_TOOLS="$(pwd)/../drivers-tools" + export PROJECT_DIRECTORY="$(pwd)" + + # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory + if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin + export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) + export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) + fi + + export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" + export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" + export UPLOAD_BUCKET="${project}" + + cat < expansion.yml + CURRENT_VERSION: "$CURRENT_VERSION" + DRIVERS_TOOLS: "$DRIVERS_TOOLS" + MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME" + MONGODB_BINARIES: "$MONGODB_BINARIES" + UPLOAD_BUCKET: "$UPLOAD_BUCKET" + PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" + PREPARE_SHELL: | + set -o errexit + set -o xtrace + export DRIVERS_TOOLS="$DRIVERS_TOOLS" + export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" + export MONGODB_BINARIES="$MONGODB_BINARIES" + export UPLOAD_BUCKET="$UPLOAD_BUCKET" + export PROJECT_DIRECTORY="$PROJECT_DIRECTORY" + + export TMPDIR="$MONGO_ORCHESTRATION_HOME/db" + export PATH="$MONGODB_BINARIES:$PATH" + export PROJECT="${project}" + EOT + # See what we've done + cat expansion.yml + + # Load the expansion file to make an evergreen variable with the current unique version + - command: expansions.update + params: + file: src/expansion.yml + + "prepare resources": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + rm -rf $DRIVERS_TOOLS + git clone git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS + echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config + + "upload release": + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: ${project}.tar.gz + remote_file: ${UPLOAD_BUCKET}/${project}-${CURRENT_VERSION}.tar.gz + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/x-gzip} + + "exec compile script" : + - command: shell.exec + type: test + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + [ -f ${PROJECT_DIRECTORY}/${file} ] && BUILDTOOL="${buildtool}" sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping" + + "exec script" : + - command: shell.exec + type: test + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + [ -f ${PROJECT_DIRECTORY}/${file} ] && sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping" + + "bootstrap mongo-orchestration": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh + # run-orchestration generates expansion file with the MONGODB_URI for the cluster + - command: expansions.update + params: + file: mo-expansion.yml + + "stop mongo-orchestration": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + sh ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh + + "run tests": + - command: shell.exec + type: test + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + AUTH=${AUTH} SSL=${SSL} MONGODB_URI="${MONGODB_URI}" sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh + + "cleanup": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + rm -rf $DRIVERS_TOOLS || true + + "fix absolute paths": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do + perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename + done + + "windows fix": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do + cat $i | tr -d '\r' > $i.new + mv $i.new $i + done + # Copy client certificate because symlinks do not work on Windows. + cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem + + "make files executable": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do + chmod +x $i + done + + "install dependencies": + - command: shell.exec + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh" + # Don't use ${file} syntax here because evergreen treats it as an empty expansion. + [ -f "$file" ] && sh $file || echo "$file not available, skipping" + +pre: + - func: "fetch source" + - func: "prepare resources" + - func: "windows fix" + - func: "fix absolute paths" + - func: "make files executable" + - func: "install dependencies" + +post: + - func: "stop mongo-orchestration" + - func: "cleanup" + +tasks: +# Standard test tasks {{{ + - name: "test-2.6-standalone" + tags: ["2.6", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "2.6" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-2.6-replica_set" + tags: ["2.6", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "2.6" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-2.6-sharded_cluster" + tags: ["2.6", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "2.6" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + + - name: "test-3.0-standalone" + tags: ["3.0", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.0" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-3.0-replica_set" + tags: ["3.0", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.0" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-3.0-sharded_cluster" + tags: ["3.0", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.0" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + + - name: "test-3.2-standalone" + tags: ["3.2", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.2" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-3.2-replica_set" + tags: ["3.2", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.2" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-3.2-sharded_cluster" + tags: ["3.2", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.2" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + + - name: "test-3.4-standalone" + tags: ["3.4", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.4" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-3.4-replica_set" + tags: ["3.4", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.4" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-3.4-sharded_cluster" + tags: ["3.4", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.4" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + - name: "test-3.6-standalone" + tags: ["3.6", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.6" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-3.6-replica_set" + tags: ["3.6", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.6" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-3.6-sharded_cluster" + tags: ["3.6", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "3.6" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + + - name: "test-latest-standalone" + tags: ["latest", "standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "latest" + TOPOLOGY: "server" + - func: "run tests" + + - name: "test-latest-replica_set" + tags: ["latest", "replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "latest" + TOPOLOGY: "replica_set" + - func: "run tests" + + - name: "test-latest-sharded_cluster" + tags: ["latest", "sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "latest" + TOPOLOGY: "sharded_cluster" + - func: "run tests" + +# }}} + +axes: + - id: versions + display_name: MongoDB Version + values: + - id: "latest" + display_name: "latest" + variables: + VERSION: "latest" + - id: "3.6" + display_name: "3.6" + variables: + VERSION: "3.6" + - id: "3.4" + display_name: "3.4" + variables: + VERSION: "3.4" + - id: "3.2" + display_name: "3.2" + variables: + VERSION: "3.2" + - id: "3.0" + display_name: "3.0" + variables: + VERSION: "3.0" + - id: "2.6" + display_name: "2.6" + variables: + VERSION: "2.6" + + - id: node-version + display_name: "Node.js Version" + values: + - id: "Argon" + display_name: "argon" + variables: + NODE_LTS_NAME: "argon" + - id: "Boron" + display_name: "boron" + variables: + NODE_LTS_NAME: "boron" + - id: "Carbon" + display_name: "carbon" + variables: + NODE_LTS_NAME: "carbon" + + # OSes that support versions of MongoDB>=2.6 with SSL. + - id: os-fully-featured + display_name: OS + values: + - id: ubuntu1204-test + display_name: "Ubuntu 12.04" + run_on: ubuntu1204-test + + - id: suse11-x86-64-test + display_name: "SUSE 11 (x86_64)" + run_on: suse11-test + + - id: linux-64-amzn-test + display_name: "Amazon Linux (Enterprise)" + run_on: linux-64-amzn-test + + # OSes that support versions of MongoDB without SSL. + - id: os-nossl + display_name: OS + values: + - id: archlinux-test + display_name: "Archlinux" + run_on: archlinux-test + + - id: macos-1012 + display_name: "macOS 10.12" + run_on: macos-1012 + + - id: os-windows + display_name: OS + values: + - id: windows-64-vs2010-test + display_name: "Windows (VS2010)" + run_on: windows-64-vs2010-test + + - id: windows-64-vs2013-test + display_name: "Windows (VS2013)" + run_on: windows-64-vs2013-test + + - id: windows-64-vs2015-test + display_name: "Windows (VS2015)" + run_on: windows-64-vs2015-test + + # OSes that support versions of MongoDB>=2.6 with SSL. + - id: os-requires-26 + display_name: OS + values: + - id: ubuntu-14.04 + display_name: "Ubuntu 14.04" + run_on: ubuntu1404-test + + - id: rhel70 + display_name: "RHEL 7.0" + run_on: rhel70-small + + - id: debian71-test + display_name: "Debian 7.1" + run_on: debian71-test + + # OSes that support versions of MongoDB>=3.2 with SSL. + - id: os-requires-32 + display_name: OS + values: + - id: suse12-x86-64-test + display_name: "SUSE 12 (x86_64)" + run_on: suse12-test + + - id: ubuntu-16.04 + display_name: "Ubuntu 16.04" + run_on: ubuntu1604-test + + - id: rhel71-power8-test + display_name: "RHEL 7.1 (POWER8)" + run_on: rhel71-power8-test + + # OSes that introduced support for SSL with MongoDB>=3.2. + - id: os-ssl-requires-32 + display_name: OS + values: + - id: macos-1012 + display_name: "macOS 10.12" + run_on: macos-1012 + + # OSes that support versions of MongoDB>=3.4 with SSL. + - id: os-requires-34 + display_name: OS + values: + - id: debian81-test + display_name: "Debian 8.1" + run_on: debian81-test + + - id: rhel72-zseries-test + display_name: "RHEL 7.2 (zSeries)" + run_on: rhel72-zseries-test + + - id: suse12-zseries-test + display_name: "SUSE 12 (zSeries)" + run_on: suse12-zseries-test + + - id: ubuntu1604-arm64-small + display_name: "Ubuntu 16.04 (ARM64)" + run_on: ubuntu1604-arm64-small + + - id: ubuntu1604-power8-test + display_name: "Ubuntu 16.04 (POWER8)" + run_on: ubuntu1604-power8-test + + - id: ubuntu1604-zseries-small + display_name: "Ubuntu 16.04 (zSeries)" + run_on: ubuntu1604-zseries-small + + # OSes that support versions of MongoDB>=4.0 with SSL. + - id: os-requires-40 + display_name: OS + values: + - id: debian92-test + display_name: "Debian 9.2" + run_on: debian92-test + + - id: topology + display_name: Topology + values: + - id: standalone + display_name: Standalone + variables: + TOPOLOGY: "server" + - id: replicaset + display_name: Replica Set + variables: + TOPOLOGY: "replica_set" + - id: sharded-cluster + display_name: Sharded Cluster + variables: + TOPOLOGY: "sharded_cluster" + - id: auth + display_name: Authentication + values: + - id: auth + display_name: Auth + variables: + AUTH: "auth" + - id: noauth + display_name: NoAuth + variables: + AUTH: "noauth" + - id: ssl + display_name: SSL + values: + - id: ssl + display_name: SSL + variables: + SSL: "ssl" + - id: nossl + display_name: NoSSL + variables: + SSL: "nossl" + - id: storage-engine + display_name: Storage + values: + - id: mmapv1 + display_name: MMAPv1 + variables: + STORAGE_ENGINE: "mmapv1" + - id: wiredtiger + display_name: WiredTiger + variables: + STORAGE_ENGINE: "wiredtiger" + - id: inmemory + display_name: InMemory + variables: + STORAGE_ENGINE: "inmemory" + + +buildvariants: +- matrix_name: "tests-all" + matrix_spec: {"os-fully-featured": "*", auth: "*", ssl: "*" } + display_name: "${os-fully-featured} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + - name: "test-3.0-replica_set" + - name: "test-3.0-sharded_cluster" + - name: "test-3.0-standalone" + - name: "test-2.6-replica_set" + - name: "test-2.6-sharded_cluster" + - name: "test-2.6-standalone" + +- matrix_name: "tests-nossl" + matrix_spec: {"os-nossl": "*", auth: "*", ssl: "nossl" } + display_name: "${os-nossl} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + - name: "test-3.0-replica_set" + - name: "test-3.0-sharded_cluster" + - name: "test-3.0-standalone" + - name: "test-2.6-replica_set" + - name: "test-2.6-sharded_cluster" + - name: "test-2.6-standalone" + +- matrix_name: "tests-os-requires-26" + matrix_spec: {"os-requires-26": "*", auth: "*", ssl: "*" } + display_name: "${os-requires-26} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + - name: "test-3.0-replica_set" + - name: "test-3.0-sharded_cluster" + - name: "test-3.0-standalone" + - name: "test-2.6-replica_set" + - name: "test-2.6-sharded_cluster" + - name: "test-2.6-standalone" + +- matrix_name: "tests-os-requires-32" + matrix_spec: {"os-requires-32": "*", auth: "*", ssl: "*" } + display_name: "${os-requires-32} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + +- matrix_name: "tests-ssl-requires-32" + matrix_spec: {"os-ssl-requires-32": "*", auth: "*", ssl: "ssl" } + display_name: "${os-ssl-requires-32} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + +- matrix_name: "tests-os-requires-34" + matrix_spec: {"os-requires-34": "*", auth: "*", ssl: "*" } + display_name: "${os-requires-34} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + +- matrix_name: "tests-os-requires-40" + matrix_spec: {"os-requires-40": "*", auth: "*", ssl: "*" } + display_name: "${os-requires-40} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + +# Storage Engine Tests on Amazon Linux (Enterprise) +- matrix_name: "tests-storage-engines" + matrix_spec: {"os-fully-featured": "linux-64-amzn-test", storage-engine: "*" } + display_name: "${os-fully-featured} ${storage-engine}" + rules: + - if: + os-fully-featured: "*" + storage-engine: ["mmapv1", "inmemory"] + then: + add_tasks: + - "test-latest-standalone" + - "test-3.6-standalone" + - "test-3.4-standalone" + - "test-3.2-standalone" + - if: + os-fully-featured: "*" + storage-engine: "wiredtiger" + then: + add_tasks: + - "test-3.0-standalone" + +- matrix_name: "tests-windows" + matrix_spec: {os-windows: "*", auth: "*", ssl: "*" } + display_name: "${os-windows} ${auth} ${ssl}" + tasks: + - name: "test-latest-replica_set" + - name: "test-latest-sharded_cluster" + - name: "test-latest-standalone" + - name: "test-3.6-replica_set" + - name: "test-3.6-sharded_cluster" + - name: "test-3.6-standalone" + - name: "test-3.4-replica_set" + - name: "test-3.4-sharded_cluster" + - name: "test-3.4-standalone" + - name: "test-3.2-replica_set" + - name: "test-3.2-sharded_cluster" + - name: "test-3.2-standalone" + - name: "test-3.0-replica_set" + - name: "test-3.0-sharded_cluster" + - name: "test-3.0-standalone" + - name: "test-2.6-replica_set" + - name: "test-2.6-sharded_cluster" + - name: "test-2.6-standalone" diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh new file mode 100644 index 000000000..1483ae2b3 --- /dev/null +++ b/.evergreen/install-dependencies.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -o xtrace # Write all commands first to stderr +set -o errexit # Exit the script with error if any of the commands fail + +# install Node.js +export NVM_DIR="$HOME/src/.nvm" +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm install --lts=${NODE_LTS_NAME} + +# install node dependencies +npm install diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh new file mode 100755 index 000000000..f5cc3bc7d --- /dev/null +++ b/.evergreen/run-tests.sh @@ -0,0 +1,33 @@ +#!/bin/sh +set -o xtrace # Write all commands first to stderr +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" + +export PATH="/opt/mongodbtoolchain/v2/bin:$PATH" +export NVM_DIR="$HOME/src/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +MONGODB_VERSION=${VERSION} MONGODB_ENVIRONMENT=${TOPOLOGY} npm test -- --skipStartup --local