Skip to content

Commit

Permalink
Fix selection of standalone tests (#10857)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
  • Loading branch information
awaelchli and carmocca committed Dec 1, 2021
1 parent ae23182 commit 9bb3ec1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/standalone_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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}"
Expand Down

0 comments on commit 9bb3ec1

Please sign in to comment.