Skip to content

Commit d7db128

Browse files
aaronj0vgvassilev
andauthored
[ci] Report failure in cppyy tests except runxfail/valgrind (#239)
* [ci] Report failure in cppyy jobs except runxfail/valgrind * [ci] Use apt-get instead of apt. Should suppress "WARNING: apt does not have a stable CLI interface. Use with caution in scripts." warnings in the CI. * Use apt-get for linux deps installation * Add pip install psutil for leakcheck tests * Valgrind retcode conditionally true on llvm 17,18 * Fix Valgrind job config * Delete stray true and psutil install * Prevent true for osx with llvm 17,18 --------- Co-authored-by: Vassil Vassilev <[email protected]>
1 parent 75bb29e commit d7db128

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ jobs:
196196
if ! sudo apt install -y clang-${vers}; then
197197
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
198198
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
199-
sudo apt update
200-
sudo apt install -y clang-${vers}
199+
sudo apt-get update
200+
sudo apt-get install -y clang-${vers}
201201
fi
202202
echo "CC=clang-${vers}" >> $GITHUB_ENV
203203
echo "CXX=clang++-${vers}" >> $GITHUB_ENV
@@ -253,9 +253,9 @@ jobs:
253253
if: runner.os == 'Linux'
254254
run: |
255255
# Install deps
256-
sudo apt update
257-
sudo apt autoremove
258-
sudo apt clean
256+
sudo apt-get update
257+
sudo apt-get autoremove
258+
sudo apt-get clean
259259
260260
- name: Install deps on MacOS
261261
if: runner.os == 'macOS'
@@ -743,7 +743,7 @@ jobs:
743743
if ! sudo apt install -y clang-${vers}; then
744744
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
745745
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
746-
sudo apt update
746+
sudo apt-get update
747747
sudo apt install -y clang-${vers}
748748
fi
749749
echo "CC=clang-${vers}" >> $GITHUB_ENV
@@ -800,8 +800,8 @@ jobs:
800800
if: runner.os == 'Linux'
801801
run: |
802802
# Install deps
803-
sudo apt update
804-
sudo apt install git g++ debhelper devscripts gnupg python3 valgrind
803+
sudo apt-get update
804+
sudo apt-get install git g++ debhelper devscripts gnupg python3 valgrind
805805
sudo apt autoremove
806806
sudo apt clean
807807
# Install libraries used by the cppyy test suite
@@ -1073,7 +1073,6 @@ jobs:
10731073
# We need PYTHONPATH later
10741074
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
10751075
- name: Run the tests on Unix Systems
1076-
continue-on-error: true
10771076
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') && (matrix.xeus-clang-repl != 'On') }}
10781077
run: |
10791078
# Run the tests
@@ -1087,20 +1086,20 @@ jobs:
10871086
python -m pip install numba
10881087
echo ::endgroup::
10891088
echo ::group::Run complete test suite
1090-
python -m pytest
1089+
python -m pytest -sv | tee complete_testrun.log 2>&1
10911090
echo ::group::Crashing Test Logs
10921091
# See if we don't have a crash that went away
10931092
# Comment out all xfails but the ones that have a run=False condition.
10941093
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
1095-
python -m pytest -n 1 -m "xfail" --runxfail -sv --max-worker-restart 512 | tee test_crashed.log 2>&1
1094+
python -m pytest -m "xfail" --runxfail -sv | tee test_crashed.log 2>&1 || true
10961095
git checkout .
10971096
echo ::endgroup::
10981097
echo ::group::XFAIL Test Logs
10991098
# Rewrite all xfails that have a run clause to skipif. This way we will
11001099
# avoid conditionally crashing xfails
11011100
find . -name "*.py" -exec sed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
11021101
# See if we don't have an xfail that went away
1103-
python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1
1102+
python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1 || true
11041103
git checkout .
11051104
echo ::endgroup::
11061105
echo ::group::Passing Test Logs
@@ -1109,12 +1108,20 @@ jobs:
11091108
declare -i RETCODE=0
11101109
11111110
set -o pipefail
1112-
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v
1111+
if [[ "${{ matrix.clang-runtime }}" == "17" || "${{ matrix.clang-runtime }}" == "18" ]] && [[ "${{ matrix.os }}" != "macos-14" ]]; then
1112+
echo "Valgrind reports true for clang-runtime 17 or 18, due to memory leaks with LLVM"
1113+
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v || true
1114+
else
1115+
echo "Running valgrind on passing tests"
1116+
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v
1117+
fi
11131118
export RETCODE=+$?
11141119
echo ::endgroup::
11151120
11161121
RETCODE=+$?
11171122
1123+
echo "Complete Test Suite Summary: \n"
1124+
tail -n1 complete_testrun.log
11181125
echo "Crashing Summary: \n"
11191126
tail -n1 test_crashed.log
11201127
echo "XFAIL Summary:"
@@ -1270,10 +1277,10 @@ jobs:
12701277
if: runner.os == 'Linux'
12711278
run: |
12721279
# Install deps
1273-
sudo apt update
1274-
sudo apt install git g++ debhelper devscripts gnupg python3 valgrind
1275-
sudo apt autoremove
1276-
sudo apt clean
1280+
sudo apt-get update
1281+
sudo apt-get install git g++ debhelper devscripts gnupg python3 valgrind
1282+
sudo apt-get autoremove
1283+
sudo apt-get clean
12771284
12781285
- name: Install mamba
12791286
uses: mamba-org/provision-with-micromamba@main

0 commit comments

Comments
 (0)