Skip to content

Commit d578ddb

Browse files
Debug XFails
1 parent 8a34e0f commit d578ddb

26 files changed

+96
-71
lines changed

.github/workflows/MacOS.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -534,52 +534,20 @@ jobs:
534534
run: |
535535
# Run the tests
536536
source ${{ github.workspace }}/CppInterOp/.venv/bin/activate
537-
cd ${{ github.workspace }}/test/
537+
cd ${{ github.workspace }}/test
538538
echo ::group::Prepare For Testing
539539
make all
540540
python -m pip install --upgrade pip
541541
python -m pip install pytest
542542
python -m pip install pytest-xdist
543543
python -m pip install numba
544544
echo ::endgroup::
545-
echo ::group::Run complete test suite
546-
set -o pipefail
547-
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
548-
set +o pipefail
549545
echo ::group::Crashing Test Logs
550-
# See if we don't have a crash that went away
551-
# Comment out all xfails but the ones that have a run=False condition.
552-
find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \;
553-
python -m pytest -n 1 -m "xfail" --runxfail -sv -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
554-
git checkout .
546+
python -m pytest -n 1 -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true
555547
echo ::endgroup::
556-
echo ::group::XFAIL Test Logs
557-
# Rewrite all xfails that have a run clause to skipif. This way we will
558-
# avoid conditionally crashing xfails
559-
find . -name "*.py" -exec gsed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\[email protected](condition=not \2/g' {} \;
560-
# See if we don't have an xfail that went away
561-
python -m pytest --runxfail -sv -ra | tee test_xfailed.log 2>&1 || true
562-
git checkout .
563-
echo ::endgroup::
564-
echo ::group::Passing Test Logs
565-
566-
# Run the rest of the non-crashing tests.
567-
declare -i RETCODE=0
568-
569-
set -o pipefail
570-
export RETCODE=+$?
571-
echo ::endgroup::
572-
573-
RETCODE=+$?
574548
575-
echo "Complete Test Suite Summary: \n"
576-
tail -n1 complete_testrun.log
577-
echo "Crashing Summary: \n"
549+
echo "Crashing Summary:"
578550
tail -n1 test_crashed.log
579-
echo "XFAIL Summary:"
580-
tail -n1 test_xfailed.log
581-
echo "Return Code: ${RETCODE}"
582-
exit $RETCODE
583551
584552
- name: Show debug info
585553
if: ${{ failure() }}

.github/workflows/Ubuntu.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -620,10 +620,6 @@ jobs:
620620
python -m uv pip install numba
621621
python -m uv pip install psutil
622622
echo ::endgroup::
623-
echo ::group::Run complete test suite
624-
set -o pipefail
625-
python -m pytest -sv -ra | tee complete_testrun.log 2>&1
626-
set +o pipefail
627623
echo ::group::Crashing Test Logs
628624
# See if we don't have a crash that went away
629625
# Comment out all xfails but the ones that have a run=False condition.
@@ -666,16 +662,8 @@ jobs:
666662
unset IS_VALGRIND
667663
echo ::endgroup::
668664

669-
RETCODE=+$?
670-
671-
echo "Complete Test Suite Summary: \n"
672-
tail -n1 complete_testrun.log
673-
echo "Crashing Summary: \n"
665+
echo "Crashing Summary:"
674666
tail -n1 test_crashed.log
675-
echo "XFAIL Summary:"
676-
tail -n1 test_xfailed.log
677-
echo "Return Code: ${RETCODE}"
678-
exit $RETCODE
679667

680668
- name: Show debug info
681669
if: ${{ failure() }}

test/support.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,12 @@ def setup_make(targetname):
7575
#endif\n""") == 1)
7676
IS_CLING = not IS_CLANG_REPL
7777
IS_VALGRIND = True if os.getenv("IS_VALGRIND") else False
78+
79+
from pytest import mark
80+
81+
proxy = mark.xfail
82+
def monkey_patch(*args, **kwargs):
83+
if "run" in kwargs:
84+
del kwargs["run"]
85+
86+
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, IS_VALGRIND, IS_CLING
3+
from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, IS_VALGRIND, 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("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, IS_VALGRIND
3+
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, IS_LINUX, IS_MAC, IS_CLING, IS_VALGRIND, monkey_patch
4+
5+
mark.xfail = monkey_patch
46

57

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

0 commit comments

Comments
 (0)