Skip to content
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

[DO NOT MERGE] Debug xfails #123

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
38 changes: 3 additions & 35 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -562,52 +562,20 @@ jobs:
run: |
# Run the tests
source ${{ github.workspace }}/CppInterOp/.venv/bin/activate
cd ${{ github.workspace }}/test/
cd ${{ github.workspace }}/test
echo ::group::Prepare For Testing
make all
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install pytest-xdist
python -m pip install numba
echo ::endgroup::
echo ::group::Run complete test suite
set -o pipefail
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
set +o pipefail
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 -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
git checkout .
python -m pytest -n 1 -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
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 gsed -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 -ra | tee test_xfailed.log 2>&1 || true
git checkout .
echo ::endgroup::
echo ::group::Passing Test Logs

# Run the rest of the non-crashing tests.
declare -i RETCODE=0

set -o pipefail
export RETCODE=+$?
echo ::endgroup::

RETCODE=+$?

echo "Complete Test Suite Summary: \n"
tail -n1 complete_testrun.log
echo "Crashing Summary: \n"
echo "Crashing Summary:"
tail -n1 test_crashed.log
echo "XFAIL Summary:"
tail -n1 test_xfailed.log
echo "Return Code: ${RETCODE}"
exit $RETCODE

- name: Show debug info
if: ${{ failure() }}
Expand Down
47 changes: 2 additions & 45 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,55 +615,12 @@ jobs:
python -m uv pip install pytest-xdist
python -m uv pip install numba
echo ::endgroup::
echo ::group::Run complete test suite
set -o pipefail
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
set +o pipefail
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 -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
git checkout .
python -m pytest -n 1 -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
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 -ra | tee test_xfailed.log 2>&1 || true
git checkout .
echo ::endgroup::
echo ::group::Passing Test Logs

# Run the rest of the non-crashing tests.
declare -i RETCODE=0

set -o pipefail

echo "Running valgrind on passing tests"
CLANG_VERSION="${{ matrix.clang-runtime }}"

if [[ "${{ matrix.os }}" == *"arm"* ]]; then
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind_arm.supp"
else
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"
fi

valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --gen-suppressions=all --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -sv -ra
export RETCODE=+$?
echo ::endgroup::

RETCODE=+$?

echo "Complete Test Suite Summary: \n"
tail -n1 complete_testrun.log
echo "Crashing Summary: \n"
echo "Crashing Summary:"
tail -n1 test_crashed.log
echo "XFAIL Summary:"
tail -n1 test_xfailed.log
echo "Return Code: ${RETCODE}"
exit $RETCODE

- name: Show debug info
if: ${{ failure() }}
Expand Down
9 changes: 9 additions & 0 deletions test/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,12 @@ def setup_make(targetname):
#else
true
#endif\n""") == 1)

from pytest import mark

proxy = mark.xfail
def monkey_patch(*args, **kwargs):
if "run" in kwargs:
del kwargs["run"]

return proxy(*args, **kwargs)
4 changes: 3 additions & 1 deletion test/test_aclassloader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make
from .support import setup_make, monkey_patch

mark.xfail = monkey_patch

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("example01Dict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_advancedcpp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86
from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("advancedcppDict"))
Expand Down
4 changes: 3 additions & 1 deletion test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import ispypy, IS_MAC, IS_LINUX_ARM
from .support import ispypy, IS_MAC, IS_LINUX_ARM, monkey_patch

mark.xfail = monkey_patch


class TestAPI:
Expand Down
5 changes: 4 additions & 1 deletion test/test_boost.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import mark, raises, skip
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, monkey_patch

mark.xfail = monkey_patch


noboost = False
if not (os.path.exists(os.path.join(os.path.sep, 'usr', 'include', 'boost')) or \
Expand Down
4 changes: 3 additions & 1 deletion test/test_concurrent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import IS_MAC_ARM, IS_MAC_X86, IS_LINUX_ARM
from .support import IS_MAC_ARM, IS_MAC_X86, IS_LINUX_ARM, monkey_patch

mark.xfail = monkey_patch


class TestCONCURRENT:
Expand Down
5 changes: 4 additions & 1 deletion test/test_conversions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make
from .support import setup_make, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("conversionsDict"))
Expand Down
4 changes: 3 additions & 1 deletion test/test_cpp11features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
Expand Down
4 changes: 3 additions & 1 deletion test/test_crossinheritance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
Expand Down
5 changes: 4 additions & 1 deletion test/test_datatypes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX, monkey_patch

mark.xfail = monkey_patch


IS_MAC = IS_MAC_X86 or IS_MAC_ARM

Expand Down
5 changes: 4 additions & 1 deletion test/test_doc_features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("doc_helperDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_eigen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import mark, raises
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, monkey_patch

mark.xfail = monkey_patch


inc_paths = [os.path.join(os.path.sep, 'usr', 'include'),
os.path.join(os.path.sep, 'usr', 'local', 'include')]
Expand Down
5 changes: 4 additions & 1 deletion test/test_fragile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL, IS_MAC
from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL, IS_MAC, monkey_patch

mark.xfail = monkey_patch



currpath = py.path.local(__file__).dirpath()
Expand Down
5 changes: 4 additions & 1 deletion test/test_leakcheck.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import mark, skip
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_numba.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import py, os, sys
import math, time
from pytest import mark, raises
from .support import setup_make
from .support import setup_make, monkey_patch

mark.xfail = monkey_patch


try:
import numba
Expand Down
5 changes: 4 additions & 1 deletion test/test_operators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, maxvalue, IS_WINDOWS
from .support import setup_make, pylong, maxvalue, IS_WINDOWS, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("operatorsDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_overloads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC, IS_MAC_ARM
from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC, IS_MAC_ARM, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("overloadsDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_pythonify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, IS_MAC
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, IS_MAC, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("example01Dict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_pythonization.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("pythonizablesDict"))
Expand Down
4 changes: 3 additions & 1 deletion test/test_regression.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch

mark.xfail = monkey_patch


class TestREGRESSION:
Expand Down
5 changes: 4 additions & 1 deletion test/test_stltypes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# -*- coding: UTF-8 -*-
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("stltypesDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_streams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make, IS_MAC, IS_CLANG_REPL
from .support import setup_make, IS_MAC, IS_CLANG_REPL, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("std_streamsDict"))
Expand Down
5 changes: 4 additions & 1 deletion test/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import py, os
from pytest import raises, mark
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch

mark.xfail = monkey_patch


currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("templatesDict"))
Expand Down