Skip to content

Commit 5d68747

Browse files
Debug XFails
1 parent 5310ccb commit 5d68747

26 files changed

+97
-72
lines changed

.github/workflows/MacOS.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -559,52 +559,20 @@ jobs:
559559
run: |
560560
# Run the tests
561561
source ${{ github.workspace }}/CppInterOp/.venv/bin/activate
562-
cd ${{ github.workspace }}/test/
562+
cd ${{ github.workspace }}/test
563563
echo ::group::Prepare For Testing
564564
make all
565565
python -m pip install --upgrade pip
566566
python -m pip install pytest
567567
python -m pip install pytest-xdist
568568
python -m pip install numba
569569
echo ::endgroup::
570-
echo ::group::Run complete test suite
571-
set -o pipefail
572-
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
573-
set +o pipefail
574570
echo ::group::Crashing Test Logs
575-
# See if we don't have a crash that went away
576-
# Comment out all xfails but the ones that have a run=False condition.
577-
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
578-
python -m pytest -n 1 -m "xfail" --runxfail -sv -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
579-
git checkout .
571+
python -m pytest -n 1 -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
580572
echo ::endgroup::
581-
echo ::group::XFAIL Test Logs
582-
# Rewrite all xfails that have a run clause to skipif. This way we will
583-
# avoid conditionally crashing xfails
584-
find . -name "*.py" -exec gsed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
585-
# See if we don't have an xfail that went away
586-
python -m pytest --runxfail -sv -ra | tee test_xfailed.log 2>&1 || true
587-
git checkout .
588-
echo ::endgroup::
589-
echo ::group::Passing Test Logs
590-
591-
# Run the rest of the non-crashing tests.
592-
declare -i RETCODE=0
593-
594-
set -o pipefail
595-
export RETCODE=+$?
596-
echo ::endgroup::
597-
598-
RETCODE=+$?
599573
600-
echo "Complete Test Suite Summary: \n"
601-
tail -n1 complete_testrun.log
602-
echo "Crashing Summary: \n"
574+
echo "Crashing Summary:"
603575
tail -n1 test_crashed.log
604-
echo "XFAIL Summary:"
605-
tail -n1 test_xfailed.log
606-
echo "Return Code: ${RETCODE}"
607-
exit $RETCODE
608576
609577
- name: Show debug info
610578
if: ${{ failure() }}

.github/workflows/Ubuntu.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,6 @@ jobs:
670670
python -m uv pip install numba
671671
python -m uv pip install psutil
672672
echo ::endgroup::
673-
echo ::group::Run complete test suite
674-
set -o pipefail
675-
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
676-
set +o pipefail
677673
echo ::group::Crashing Test Logs
678674
# See if we don't have a crash that went away
679675
# Comment out all xfails but the ones that have a run=False condition.
@@ -705,20 +701,12 @@ jobs:
705701
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"
706702
fi
707703

708-
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 --ignore=test_leakcheck.py
704+
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
709705
export RETCODE=+$?
710706
echo ::endgroup::
711707

712-
RETCODE=+$?
713-
714-
echo "Complete Test Suite Summary: \n"
715-
tail -n1 complete_testrun.log
716-
echo "Crashing Summary: \n"
708+
echo "Crashing Summary:"
717709
tail -n1 test_crashed.log
718-
echo "XFAIL Summary:"
719-
tail -n1 test_xfailed.log
720-
echo "Return Code: ${RETCODE}"
721-
exit $RETCODE
722710

723711
- name: Show debug info
724712
if: ${{ failure() }}

test/support.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,12 @@ def setup_make(targetname):
7474
true
7575
#endif\n""") == 1)
7676
IS_CLING = not IS_CLANG_REPL
77+
78+
from pytest import mark
79+
80+
proxy = mark.xfail
81+
def monkey_patch(*args, **kwargs):
82+
if "run" in kwargs:
83+
del kwargs["run"]
84+
85+
return proxy(*args, **kwargs)

test/test_aclassloader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make
3+
from .support import setup_make, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57
currpath = py.path.local(__file__).dirpath()
68
test_dct = str(currpath.join("example01Dict"))

test/test_advancedcpp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86
3+
from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("advancedcppDict"))

test/test_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import ispypy, IS_MAC, IS_LINUX_ARM
3+
from .support import ispypy, IS_MAC, IS_LINUX_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

68
class TestAPI:

test/test_boost.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import mark, raises, skip
3-
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
3+
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
noboost = False
69
if not (os.path.exists(os.path.join(os.path.sep, 'usr', 'include', 'boost')) or \

test/test_concurrent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import IS_MAC_ARM, IS_MAC_X86, IS_LINUX_ARM
3+
from .support import IS_MAC_ARM, IS_MAC_X86, IS_LINUX_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

68
class TestCONCURRENT:

test/test_conversions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make, IS_LINUX, IS_CLANG_REPL, IS_CLING, IS_MAC
3+
from .support import setup_make, IS_LINUX, IS_CLANG_REPL, IS_CLING, IS_MAC, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("conversionsDict"))

test/test_cpp11features.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, IS_LINUX, IS_MAC, IS_CLING
3+
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, IS_LINUX, IS_MAC, IS_CLING, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

68
currpath = py.path.local(__file__).dirpath()

test/test_crossinheritance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM, IS_LINUX
3+
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM, IS_LINUX, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

68
currpath = py.path.local(__file__).dirpath()

test/test_datatypes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_CLING, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX
3+
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_CLING, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57
IS_MAC = IS_MAC_X86 or IS_MAC_ARM
68

test/test_doc_features.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM
3+
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("doc_helperDict"))

test/test_eigen.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import mark, raises
3-
from .support import setup_make, IS_CLANG_REPL, IS_CLING, IS_MAC_X86
3+
from .support import setup_make, IS_CLANG_REPL, IS_CLING, IS_MAC_X86, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
inc_paths = [os.path.join(os.path.sep, 'usr', 'include'),
69
os.path.join(os.path.sep, 'usr', 'local', 'include')]

test/test_fragile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL, IS_MAC
3+
from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL, IS_MAC, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58

69
currpath = py.path.local(__file__).dirpath()

test/test_leakcheck.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import mark, skip
3-
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL
3+
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("datatypesDict"))

test/test_lowlevel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC
3+
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("datatypesDict"))

test/test_numba.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import py, os, sys
22
import math, time
33
from pytest import mark, raises
4-
from .support import setup_make
4+
from .support import setup_make, monkey_patch
5+
6+
mark.xfail = monkey_patch
7+
58

69
try:
710
import numba

test/test_operators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, maxvalue, IS_WINDOWS, IS_MAC, IS_CLANG_REPL, IS_CLING
3+
from .support import setup_make, pylong, maxvalue, IS_WINDOWS, IS_MAC, IS_CLANG_REPL, IS_CLING, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("operatorsDict"))

test/test_overloads.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC, IS_MAC_ARM
3+
from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC, IS_MAC_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("overloadsDict"))

test/test_pythonify.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_CLING, IS_MAC_ARM, IS_MAC_X86, IS_MAC
3+
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_CLING, IS_MAC_ARM, IS_MAC_X86, IS_MAC, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("example01Dict"))

test/test_pythonization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLING
3+
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLING, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57
currpath = py.path.local(__file__).dirpath()
68
test_dct = str(currpath.join("pythonizablesDict"))

test/test_regression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
3+
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch
44

5+
mark.xfail = monkey_patch
56

67
class TestREGRESSION:
78
helpout = []

test/test_stltypes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# -*- coding: UTF-8 -*-
22
import py, os, sys
33
from pytest import raises, skip, mark
4-
from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
4+
from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch
5+
6+
mark.xfail = monkey_patch
7+
58

69
currpath = py.path.local(__file__).dirpath()
710
test_dct = str(currpath.join("stltypesDict"))

test/test_streams.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make, IS_MAC, IS_CLANG_REPL
3+
from .support import setup_make, IS_MAC, IS_CLANG_REPL, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("std_streamsDict"))

test/test_templates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import py, os
22
from pytest import raises, mark
3-
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX
3+
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
currpath = py.path.local(__file__).dirpath()
69
test_dct = str(currpath.join("templatesDict"))

0 commit comments

Comments
 (0)