From f81cda0e2200723837a43eb3995e050f3794074e Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Wed, 12 Jul 2023 09:41:31 -0700 Subject: [PATCH] PYTHON-3774 Update Evergreen run-atlas-tests to use tox + pytest (#1270) --- .evergreen/config.yml | 9 +++++++-- .evergreen/run-atlas-tests.sh | 21 --------------------- tox.ini | 10 ++++++++++ 3 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 .evergreen/run-atlas-tests.sh diff --git a/.evergreen/config.yml b/.evergreen/config.yml index daa68862d..cd6ff3803 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -553,12 +553,17 @@ functions: params: working_dir: "src" script: | - # Disable xtrace (just in case it was accidentally set). + # Disable xtrace for security reasons (just in case it was accidentally set). set +x + . ./prepare_atlas_connectivity.sh rm -f ./prepare_atlas_connectivity.sh - PYTHON_BINARY=${PYTHON_BINARY} bash ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh + set -o errexit + set -o xtrace + # This is required for pypy3.7 UTF encoding + export LC_ALL=en_US.UTF-8 + ${PYTHON_BINARY} -m tox -e test-atlas "add aws auth variables to file": - command: shell.exec diff --git a/.evergreen/run-atlas-tests.sh b/.evergreen/run-atlas-tests.sh deleted file mode 100644 index 4a39880d0..000000000 --- a/.evergreen/run-atlas-tests.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Exit on error and enable trace. -set -o errexit -set -o xtrace - -if [ -z "$PYTHON_BINARY" ]; then - echo "No python binary specified" - PYTHON_BINARY=$(command -v python3) || true - if [ -z "$PYTHON_BINARY" ]; then - echo "Cannot test without python3 installed!" - exit 1 - fi -fi - -. .evergreen/utils.sh -createvirtualenv $PYTHON_BINARY atlastest -trap "deactivate; rm -rf atlastest" EXIT HUP - -python -m pip install . -python test/atlas/test_connection.py diff --git a/tox.ini b/tox.ini index ac65ed1ad..7c39540fe 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,7 @@ envlist = doc-test, # Linkcheck sphinx docs linkcheck + labels = # Use labels and -m instead of -e so that tox -m