Skip to content

[ci] Report failure in cppyy tests except runxfail/valgrind #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ jobs:
if ! sudo apt install -y clang-${vers}; then
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y clang-${vers}
sudo apt-get update
sudo apt-get install -y clang-${vers}
fi
echo "CC=clang-${vers}" >> $GITHUB_ENV
echo "CXX=clang++-${vers}" >> $GITHUB_ENV
Expand Down Expand Up @@ -253,9 +253,9 @@ jobs:
if: runner.os == 'Linux'
run: |
# Install deps
sudo apt update
sudo apt autoremove
sudo apt clean
sudo apt-get update
sudo apt-get autoremove
sudo apt-get clean

- name: Install deps on MacOS
if: runner.os == 'macOS'
Expand Down Expand Up @@ -743,7 +743,7 @@ jobs:
if ! sudo apt install -y clang-${vers}; then
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt-get update
sudo apt install -y clang-${vers}
fi
echo "CC=clang-${vers}" >> $GITHUB_ENV
Expand Down Expand Up @@ -800,8 +800,8 @@ jobs:
if: runner.os == 'Linux'
run: |
# Install deps
sudo apt update
sudo apt install git g++ debhelper devscripts gnupg python3 valgrind
sudo apt-get update
sudo apt-get install git g++ debhelper devscripts gnupg python3 valgrind
sudo apt autoremove
sudo apt clean
# Install libraries used by the cppyy test suite
Expand Down Expand Up @@ -1073,7 +1073,6 @@ jobs:
# We need PYTHONPATH later
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
- name: Run the tests on Unix Systems
continue-on-error: true
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') && (matrix.xeus-clang-repl != 'On') }}
run: |
# Run the tests
Expand All @@ -1087,20 +1086,20 @@ jobs:
python -m pip install numba
echo ::endgroup::
echo ::group::Run complete test suite
python -m pytest
python -m pytest -sv | tee complete_testrun.log 2>&1
echo ::group::Crashing Test Logs
# See if we don't have a crash that went away
# Comment out all xfails but the ones that have a run=False condition.
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
python -m pytest -n 1 -m "xfail" --runxfail -sv --max-worker-restart 512 | tee test_crashed.log 2>&1
python -m pytest -m "xfail" --runxfail -sv | tee test_crashed.log 2>&1 || true
git checkout .
echo ::endgroup::
echo ::group::XFAIL Test Logs
# Rewrite all xfails that have a run clause to skipif. This way we will
# avoid conditionally crashing xfails
find . -name "*.py" -exec sed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
# See if we don't have an xfail that went away
python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1
python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1 || true
git checkout .
echo ::endgroup::
echo ::group::Passing Test Logs
Expand All @@ -1109,12 +1108,20 @@ jobs:
declare -i RETCODE=0

set -o pipefail
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v
if [[ "${{ matrix.clang-runtime }}" == "17" || "${{ matrix.clang-runtime }}" == "18" ]] && [[ "${{ matrix.os }}" != "macos-14" ]]; then
echo "Valgrind reports true for clang-runtime 17 or 18, due to memory leaks with LLVM"
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v || true
else
echo "Running valgrind on passing tests"
valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v
fi
export RETCODE=+$?
echo ::endgroup::

RETCODE=+$?

echo "Complete Test Suite Summary: \n"
tail -n1 complete_testrun.log
echo "Crashing Summary: \n"
tail -n1 test_crashed.log
echo "XFAIL Summary:"
Expand Down Expand Up @@ -1270,10 +1277,10 @@ jobs:
if: runner.os == 'Linux'
run: |
# Install deps
sudo apt update
sudo apt install git g++ debhelper devscripts gnupg python3 valgrind
sudo apt autoremove
sudo apt clean
sudo apt-get update
sudo apt-get install git g++ debhelper devscripts gnupg python3 valgrind
sudo apt-get autoremove
sudo apt-get clean

- name: Install mamba
uses: mamba-org/provision-with-micromamba@main
Expand Down