Fix selection of standalone tests (#10857)

Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
This commit is contained in:
Adrian Wälchli 2021-12-01 09:48:37 +01:00 committed by GitHub
parent ec0fb2fd95
commit e6cc99ef90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -28,9 +28,9 @@ files=$(echo "$grep_output" | cut -f1 -d: | sort | uniq)
# get the list of parametrizations. we need to call them separately. the last two lines are removed.
# note: if there's a syntax error, this will fail with some garbled output
if [[ "$OSTYPE" == "darwin"* ]]; then
parametrizations=$(pytest $files --collect-only --quiet | tail -r | sed -e '1,3d' | tail -r)
parametrizations=$(pytest $files --collect-only --quiet "$@" | tail -r | sed -e '1,3d' | tail -r)
else
parametrizations=$(pytest $files --collect-only --quiet | head -n -2)
parametrizations=$(pytest $files --collect-only --quiet "$@" | head -n -2)
fi
parametrizations_arr=($parametrizations)
@ -47,14 +47,6 @@ for i in "${!parametrizations_arr[@]}"; do
continue
fi
# STANDALONE_PATTERN allows filtering the tests to run when debugging.
# use as `STANDALONE_PATTERN="foo_bar" ./standalone_tests.sh` to run only those
# test with `foo_bar` in their name
if [[ $parametrization != *STANDALONE_PATTERN* ]]; then
report+="Skipped\t$parametrization\n"
continue
fi
# run the test
echo "Running ${parametrization}"
python ${defaults} "${parametrization}"