Skip to content

Commit 669c2b2

Browse files
committed
Handle PyQt5 test cleanup crash in CI and update version
Improves GitHub Actions workflow to treat PyQt5 cleanup crashes on macOS/Windows as successful if all tests pass, preventing false negatives in CI. Updates project version to 1.1.2 and ensures __version__ matches the new package name and version.
1 parent e16e348 commit 669c2b2

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.github/workflows/tests.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ jobs:
5656
if [ "$RUNNER_OS" == "Linux" ]; then
5757
xvfb-run -a pytest tests/unit -v --cov=src/measureit --cov-report=xml --cov-report=term-missing
5858
else
59-
pytest tests/unit -v --cov=src/measureit --cov-report=xml --cov-report=term-missing
59+
# macOS/Windows: Known PyQt5 cleanup crash after tests pass - capture results before crash
60+
set +e
61+
pytest tests/unit -v --cov=src/measureit --cov-report=xml --cov-report=term-missing --junit-xml=unit-results.xml
62+
TEST_EXIT=$?
63+
# Exit codes: 0=all pass, 1=tests failed, 5=no tests, 139=segfault/bus error
64+
# If exit code is 139 (bus error) but results show tests passed, treat as success
65+
if [ $TEST_EXIT -eq 139 ] && [ -f unit-results.xml ]; then
66+
if grep -q 'failures="0"' unit-results.xml && grep -q 'errors="0"' unit-results.xml; then
67+
echo "Tests passed but PyQt5 cleanup crashed (known $RUNNER_OS issue) - treating as success"
68+
exit 0
69+
fi
70+
fi
71+
exit $TEST_EXIT
6072
fi
6173
6274
- name: Run integration tests
@@ -65,7 +77,19 @@ jobs:
6577
if [ "$RUNNER_OS" == "Linux" ]; then
6678
xvfb-run -a pytest tests/integration -v --cov=src/measureit --cov-append --cov-report=xml
6779
else
68-
pytest tests/integration -v --cov=src/measureit --cov-append --cov-report=xml
80+
# macOS/Windows: Known PyQt5 cleanup crash after tests pass - capture results before crash
81+
set +e
82+
pytest tests/integration -v --cov=src/measureit --cov-append --cov-report=xml --junit-xml=integration-results.xml
83+
TEST_EXIT=$?
84+
# Exit codes: 0=all pass, 1=tests failed, 5=no tests, 139=segfault/bus error
85+
# If exit code is 139 (bus error) but results show tests passed, treat as success
86+
if [ $TEST_EXIT -eq 139 ] && [ -f integration-results.xml ]; then
87+
if grep -q 'failures="0"' integration-results.xml && grep -q 'errors="0"' integration-results.xml; then
88+
echo "Tests passed but PyQt5 cleanup crashed (known $RUNNER_OS issue) - treating as success"
89+
exit 0
90+
fi
91+
fi
92+
exit $TEST_EXIT
6993
fi
7094
7195
- name: Run E2E tests (selected platforms)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ where = ["src"]
1010

1111
[project]
1212
name = "qmeasure"
13-
version = "1.1.0"
13+
version = "1.1.2"
1414
description = "Measurement code for condensed matter groups at UW based on QCoDeS."
1515
readme = {file = "README.md", content-type = "text/markdown"}
1616
license = "GPL-3.0-or-later"

src/measureit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646

4747

4848
try:
49-
__version__ = metadata.version("measureit")
49+
__version__ = metadata.version("qmeasure")
5050
except metadata.PackageNotFoundError: # pragma: no cover - dev installs
51-
__version__ = "0.0.0"
51+
__version__ = "1.1.2"
5252

5353

5454
# Display data directory info on first import (only in interactive sessions)

0 commit comments

Comments
 (0)