Skip to content

Commit 8bc58d1

Browse files
Debug XFails
1 parent 01be0e0 commit 8bc58d1

26 files changed

+100
-103
lines changed

.github/workflows/MacOS.yml

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

.github/workflows/Ubuntu.yml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -615,55 +615,12 @@ jobs:
615615
python -m uv pip install pytest-xdist
616616
python -m uv pip install numba
617617
echo ::endgroup::
618-
echo ::group::Run complete test suite
619-
set -o pipefail
620-
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
621-
set +o pipefail
622618
echo ::group::Crashing Test Logs
623-
# See if we don't have a crash that went away
624-
# Comment out all xfails but the ones that have a run=False condition.
625-
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
626-
python -m pytest -n 1 -m "xfail" --runxfail -sv -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
627-
git checkout .
619+
python -m pytest -n 1 -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
628620
echo ::endgroup::
629-
echo ::group::XFAIL Test Logs
630-
# Rewrite all xfails that have a run clause to skipif. This way we will
631-
# avoid conditionally crashing xfails
632-
find . -name "*.py" -exec sed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
633-
# See if we don't have an xfail that went away
634-
python -m pytest --runxfail -sv -ra | tee test_xfailed.log 2>&1 || true
635-
git checkout .
636-
echo ::endgroup::
637-
echo ::group::Passing Test Logs
638-
639-
# Run the rest of the non-crashing tests.
640-
declare -i RETCODE=0
641-
642-
set -o pipefail
643-
644-
echo "Running valgrind on passing tests"
645-
CLANG_VERSION="${{ matrix.clang-runtime }}"
646-
647-
if [[ "${{ matrix.os }}" == *"arm"* ]]; then
648-
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind_arm.supp"
649-
else
650-
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"
651-
fi
652-
653-
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
654-
export RETCODE=+$?
655-
echo ::endgroup::
656-
657-
RETCODE=+$?
658621
659-
echo "Complete Test Suite Summary: \n"
660-
tail -n1 complete_testrun.log
661-
echo "Crashing Summary: \n"
622+
echo "Crashing Summary:"
662623
tail -n1 test_crashed.log
663-
echo "XFAIL Summary:"
664-
tail -n1 test_xfailed.log
665-
echo "Return Code: ${RETCODE}"
666-
exit $RETCODE
667624
668625
- name: Show debug info
669626
if: ${{ failure() }}

test/support.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,12 @@ def setup_make(targetname):
7373
#else
7474
true
7575
#endif\n""") == 1)
76+
77+
from pytest import mark
78+
79+
proxy = mark.xfail
80+
def monkey_patch(*args, **kwargs):
81+
if "run" in kwargs:
82+
del kwargs["run"]
83+
84+
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
3+
from .support import setup_make, 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
3+
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, 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
3+
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

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

test/test_datatypes.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_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX
3+
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX, monkey_patch
4+
5+
mark.xfail = monkey_patch
6+
47

58
IS_MAC = IS_MAC_X86 or IS_MAC_ARM
69

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_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_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_MAC_X86
3+
from .support import setup_make, IS_CLANG_REPL, 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
3+
from .support import setup_make, pylong, maxvalue, IS_WINDOWS, 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_MAC_ARM, IS_MAC_X86, IS_MAC
3+
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, 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: 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, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL
3+
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, 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("pythonizablesDict"))

test/test_regression.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, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
3+
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

68
class TestREGRESSION:

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_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
4+
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
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_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC
3+
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, 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("templatesDict"))

0 commit comments

Comments
 (0)