@@ -26,18 +26,17 @@ export PL_RUN_STANDALONE_TESTS=1
26
26
defaults=" -m coverage run --source ${source} --append -m pytest --no-header -v -s --timeout 120 "
27
27
echo " Using defaults: ${defaults} "
28
28
29
- # get the testing location as the fist argument
29
+ # get the testing location as the first argument
30
30
test_path=$1
31
31
printf " source path: $test_path \n"
32
32
33
33
# collect all tests with parametrization based filtering with PL_RUN_STANDALONE_TESTS
34
34
standalone_tests=$( python3 -m pytest $test_path -q --collect-only --pythonwarnings ignore)
35
- printf " Collected tests: \n $standalone_tests "
35
+ printf " Collected tests: \n $standalone_tests \n "
36
36
# match only lines with tests
37
- parametrizations=$( grep -oP ' \S+::test_\S+' <<< " $standalone_tests" )
37
+ parametrizations=$( perl -nle ' print $& while m{ \S+::test_\S+}g ' <<< " $standalone_tests" )
38
38
# convert the list to be array
39
39
parametrizations_arr=($parametrizations )
40
-
41
40
report=' '
42
41
43
42
rm -f standalone_test_output.txt # in case it exists, remove it
@@ -47,7 +46,7 @@ function show_batched_output {
47
46
if [ -f standalone_test_output.txt ]; then # if exists
48
47
cat standalone_test_output.txt
49
48
# heuristic: stop if there's mentions of errors. this can prevent false negatives when only some of the ranks fail
50
- if grep -iE ' error|exception|traceback|failed' standalone_test_output.txt | grep -vE ' on_exception|xfailed ' | grep -qv -f testnames.txt; then
49
+ if perl -nle ' print if / error|(?<!(?-i)on_) exception|traceback|(?<!(?-i)x) failed/i ' standalone_test_output.txt | grep -qv -f testnames.txt; then
51
50
echo " Potential error! Stopping."
52
51
rm standalone_test_output.txt
53
52
exit 1
0 commit comments