Skip to content

Commit 0c9090e

Browse files
committed
Ignore skipped tests
Successful output looks like this > ...............................................s...................................................................................... > ................................................................................................................... > ---------------------------------------------------------------------- > Ran 946 tests in 714.512s > > OK (skipped=3) We only care about the part until "Ran xxx tests" not including the divider (dashes). Also we can ignore any lines with just "s" and ".".
1 parent 72d8ce0 commit 0c9090e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/unit_tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,16 @@ jobs:
201201
# run test suite
202202
python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log
203203
# try and make sure output of running tests is clean (no printed messages/warnings)
204-
IGNORE_PATTERNS="=== Skipped tests ==="
205-
IGNORE_PATTERNS+="Ignoring rate limit error"
204+
IGNORE_PATTERNS="^[s.]*$" # Only PASS and SKIP status on line
206205
IGNORE_PATTERNS+="|stty: 'standard input': Inappropriate ioctl for device"
207206
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: Python 3.7"
208207
IGNORE_PATTERNS+="|from cryptography.* import "
209208
IGNORE_PATTERNS+="|Blowfish"
210209
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: TripleDES has been moved"
211210
IGNORE_PATTERNS+="|algorithms.TripleDES"
211+
212+
TEST_OUTPUT=$(sed -n '/------------------------------/q;p' test_framework_suite.log) # Everything up to the result divider
212213
# '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches)
213-
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
214-
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)
214+
PRINTED_MSG=$(echo "$TEST_OUTPUT" | egrep -v "${IGNORE_PATTERNS}" || true)
215+
[[ -z $PRINTED_MSG ]] || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)
215216
done

0 commit comments

Comments
 (0)