Skip to content

Commit

Permalink
add fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leej3 committed Apr 4, 2024
1 parent 5a6066b commit fc938a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions tests/run_cpu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ fi

MATCH_TESTS_EXPRESSION=${1:-""}

CUDA_VISIBLE_DEVICES="" pytest --tx 4*popen//python=python --cov ignite --cov-report term-missing --cov-report xml -vvv tests "${skip_distrib_opt[@]}" "${EXTRA_PYTEST_ARGS:-}" -k "$MATCH_TESTS_EXPRESSION"
# Catch exit code 5 when tests are deselected from previous passing run
CUDA_VISIBLE_DEVICES="" pytest ${EXTRA_PYTEST_ARGS:-} --tx 4*popen//python=python --cov ignite --cov-report term-missing --cov-report xml -vvv tests "${skip_distrib_opt[@]}" -k "$MATCH_TESTS_EXPRESSION" || { exit_code=$?; if [ "$exit_code" -eq 5 ]; then echo "All tests deselected"; else exit $exit_code; fi;}

# https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
if [ "${SKIP_DISTRIB_TESTS:-0}" -eq "1" ]; then
exit 0
fi

export WORLD_SIZE=2
CUDA_VISIBLE_DEVICES="" pytest --cov ignite --cov-append --cov-report term-missing --cov-report xml --dist=each --tx $WORLD_SIZE*popen//python=python tests -m distributed -vvv "${EXTRA_PYTEST_ARGS:-}" -k "$MATCH_TESTS_EXPRESSION"
CUDA_VISIBLE_DEVICES="" pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-append --cov-report term-missing --cov-report xml --dist=each --tx $WORLD_SIZE*popen//python=python tests -m distributed -vvv -k "$MATCH_TESTS_EXPRESSION"
unset WORLD_SIZE
8 changes: 4 additions & 4 deletions tests/run_gpu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ else
fi

set -xeu

pytest --cov ignite --cov-report term-missing --cov-report xml -vvv tests/ "${EXTRA_PYTEST_ARGS:-}" -k "$cuda_pattern"
# Catch exit code 5 when tests are deselected from previous passing run
pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-report term-missing --cov-report xml -vvv tests/ -k "$cuda_pattern" || { exit_code=$?; if [ "$exit_code" -eq 5 ]; then echo "All tests deselected"; else exit $exit_code; fi;}

# https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
if [ "${SKIP_DISTRIB_TESTS:-0}" -eq "1" ]; then
exit 0
fi

pytest --cov ignite --cov-append --cov-report term-missing --cov-report xml -vvv tests/ -m distributed "${EXTRA_PYTEST_ARGS:-}" -k "$MATCH_TESTS_EXPRESSION"
pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-append --cov-report term-missing --cov-report xml -vvv tests/ -m distributed -k "$MATCH_TESTS_EXPRESSION"


if [ ${ngpus} -gt 1 ]; then

export WORLD_SIZE=${ngpus}
pytest --cov ignite --cov-append --cov-report term-missing --cov-report xml --dist=each --tx ${WORLD_SIZE}*popen//python=python tests -m distributed -vvv "${EXTRA_PYTEST_ARGS:-}" -k "$MATCH_TESTS_EXPRESSION"
pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-append --cov-report term-missing --cov-report xml --dist=each --tx ${WORLD_SIZE}*popen//python=python tests -m distributed -vvv -k "$MATCH_TESTS_EXPRESSION"
unset WORLD_SIZE

fi
5 changes: 3 additions & 2 deletions tests/run_tpu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

set -xeu

pytest --cov ignite --cov-report term-missing --cov-report xml tests/ -vvv -m tpu "${EXTRA_PYTEST_ARGS:-}"
# Catch exit code 5 when tests are deselected from previous passing run
pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-report term-missing --cov-report xml tests/ -vvv -m tpu || { exit_code=$?; if [ "$exit_code" -eq 5 ]; then echo "All tests deselected"; else exit $exit_code; fi;}

if [ -z ${NUM_TPU_WORKERS+x} ]; then
export NUM_TPU_WORKERS=1
pytest --cov ignite --cov-append --cov-report term-missing --cov-report xml tests/ -vvv -m tpu "${EXTRA_PYTEST_ARGS:-}"
pytest ${EXTRA_PYTEST_ARGS:-} --cov ignite --cov-append --cov-report term-missing --cov-report xml tests/ -vvv -m tpu
fi

0 comments on commit fc938a9

Please sign in to comment.