Skip to content

Commit

Permalink
[CI] Sanity check parallel unit test utility
Browse files Browse the repository at this point in the history
Add a sanity check of the parallel unit test utility to CI.  This check
ensures that the utility correctly reprorts aborts, crashes, failures,
and successes.

Note that the result of this sanity run is added to the artifacts, but
not to the reports.  We do not want to clutter our GitLab test reports.
  • Loading branch information
ImmanuelHaffner committed Apr 20, 2024
1 parent b39cdf0 commit 4969a30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,13 @@ unittest:linux-amd64:
artifacts: true
script:
- pipenv --python $PYTHON_VERSION sync
- env pipenv run utils/unittest-parallel.py -r --out unittest-sanity.xml build/debug/bin/unittest -t '[test-sanity]' || true
- head -n1 unittest-sanity.xml | perl -n -e '/errors="(\d+)" failures="(\d+)" tests="(\d+)/ && exit ($1 != 2 or $2 != 1 or $3 != 2)' # we expect 2 errors (abort & segv), one failure (failure), and two tests run (failure & success)
- env UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=detect_stack_use_after_return=1 pipenv run utils/unittest-parallel.py -r --out unittest-results.xml build/debug/bin/unittest
artifacts:
when: always
paths:
- unittest-sanity.xml
- unittest-results.xml
reports:
junit: unittest-results.xml
Expand All @@ -216,10 +219,13 @@ unittest:macos-amd64:
artifacts: true
script:
- pipenv --python $PYTHON_VERSION sync
- env pipenv run utils/unittest-parallel.py -r --out unittest-sanity.xml build/debug/bin/unittest -t '[test-sanity]' || true
- head -n1 unittest-sanity.xml | perl -n -e '/errors="(\d+)" failures="(\d+)" tests="(\d+)/ && exit ($1 != 2 or $2 != 1 or $3 != 2)' # we expect 2 errors (abort & segv), one failure (failure), and two tests run (failure & success)
- env UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=detect_stack_use_after_return=1:detect_container_overflow=0 MallocNanoZone=0 pipenv run utils/unittest-parallel.py -r --out unittest-results.xml build/debug/bin/unittest
artifacts:
when: always
paths:
- unittest-sanity.xml
- unittest-results.xml
reports:
junit: unittest-results.xml
Expand Down

0 comments on commit 4969a30

Please sign in to comment.