Skip to content

Commit cf2ec3b

Browse files
sudo-pandavgvassilev
authored andcommitted
Update CI and add valgrind testing
1 parent 2ced7b8 commit cf2ec3b

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ jobs:
203203
../
204204
fi
205205
cmake --build . --target check-cppinterop --parallel $(nproc --all)
206+
cppyy_on="${{ matrix.cppyy }}"
207+
if [[ "${cppyy_on^^}" != "ON" ]]; then
208+
valgrind --error-exitcode=1 unittests/CppInterOp/CppInterOpTests 2>&1 >/dev/null
209+
fi
206210
cd ..
207211
# We need CB_PYTHON_DIR later
208212
echo "CB_PYTHON_DIR=$CB_PYTHON_DIR" >> $GITHUB_ENV
@@ -281,25 +285,37 @@ jobs:
281285
echo ::endgroup::
282286
echo ::group::Crashing Test Logs
283287
# See if we don't have a crash that went away
284-
python -m pytest -n 1 -m "crashes" -sv --max-worker-restart 512 | tee test_crashed.log 2>&1
288+
# Comment out all xfails but the ones that have a run=False condition.
289+
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
290+
python -m pytest -n 1 -m "xfail" --runxfail -sv --max-worker-restart 512 | tee test_crashed.log 2>&1
291+
git checkout .
285292
echo ::endgroup::
286293
echo ::group::XFAIL Test Logs
294+
# Rewrite all xfails that have a run clause to skipif. This way we will
295+
# avoid conditionally crashing xfails
296+
find . -name "*.py" -exec sed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
287297
# See if we don't have an xfail that went away
288-
python -m pytest -m "not crashes" --runxfail -s | tee test_xfailed.log 2>&1
298+
python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1
299+
git checkout .
289300
echo ::endgroup::
290301
echo ::group::Passing Test Logs
302+
291303
# Run the rest of the non-crashing tests.
292-
declare -i PYTEST_RETCODE=0
293-
#python -m pytest -m "not crashes" -v | tee test_passing.log 2>&1
294-
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not crashes and not xfail" -v
295-
export PYTEST_RETCODE=+$?
304+
declare -i RETCODE=0
305+
306+
set -o pipefail
307+
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v
308+
export RETCODE=+$?
296309
echo ::endgroup::
310+
311+
RETCODE=+$?
312+
297313
echo "Crashing Summary: \n"
298314
tail -n1 test_crashed.log
299315
echo "XFAIL Summary:"
300316
tail -n1 test_xfailed.log
301-
echo "Passing Summary:"
302-
tail -n1 test_passing.log
317+
echo "Return Code: ${RETCODE}"
318+
exit $RETCODE
303319
- name: Show debug info
304320
if: ${{ failure() }}
305321
run: |

0 commit comments

Comments
 (0)