PYTHON-3774 Update Evergreen run-atlas-tests to use tox + pytest (#1270)

This commit is contained in:
Noah Stapp 2023-07-12 09:41:31 -07:00 committed by GitHub
parent 9a4911fca6
commit f81cda0e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 23 deletions

View File

@ -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

View File

@ -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

10
tox.ini
View File

@ -24,6 +24,7 @@ envlist =
doc-test,
# Linkcheck sphinx docs
linkcheck
labels = # Use labels and -m instead of -e so that tox -m <label> fails instantly if the label does not exist
test = test
test-encryption = test-encryption
@ -36,6 +37,7 @@ labels = # Use labels and -m instead of -e so that tox -m <label> fails instantl
doc = doc
doc-test = doc-test
linkcheck = linkcheck
test-atlas = test-atlas
test-mockupdb = test-mockupdb
[testenv:test]
@ -136,6 +138,14 @@ deps =
commands =
sphinx-build -E -b linkcheck doc ./doc/_build/linkcheck
[testenv:test-atlas]
description = run atlas connection tests
deps =
{[testenv:test]deps}
passenv = *
commands =
python -m pytest -v ./test/atlas/test_connection.py
[testenv:test-mockupdb]
description = run mockupdb tests
deps =