Skip to content

Commit

Permalink
Add environment-agnostic scripts for running pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Feb 7, 2024
1 parent 2a39cc4 commit 85ae4c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 12 additions & 0 deletions ci/run_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -euo pipefail

# Test with TCP/Sockets
# Support invoking run_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../tests/
timeout 10m pytest --cache-clear -vs "$@" .

# Support invoking run_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ucp/
timeout 2m pytest --cache-clear -vs "$@" ./_libs/tests
4 changes: 2 additions & 2 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ run_tests() {

# Test with TCP/Sockets
rapids-logger "TEST WITH TCP ONLY"
timeout 10m pytest --cache-clear -vs tests/
timeout 2m pytest --cache-clear -vs ucp/_libs/tests
# Support invoking test_python.sh outside the script directory
"$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/run_pytests.sh

rapids-logger "Run local benchmark"
# cd to root directory to prevent repo's `ucp` directory from being used
Expand Down
6 changes: 2 additions & 4 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ RAPIDS_PY_WHEEL_NAME="ucx_py_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-fr
# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/ucx_py*.whl)[test]

cd tests
python -m pytest --cache-clear -vs .
cd ../ucp
python -m pytest --cache-clear -vs ./_libs/tests/
# Support invoking test_wheel.sh outside the script directory
"$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/run_pytests.sh

0 comments on commit 85ae4c9

Please sign in to comment.