|
56 | 56 | if [ "$RUNNER_OS" == "Linux" ]; then |
57 | 57 | xvfb-run -a pytest tests/unit -v --cov=src/measureit --cov-report=xml --cov-report=term-missing |
58 | 58 | 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 |
60 | 72 | fi |
61 | 73 |
|
62 | 74 | - name: Run integration tests |
|
65 | 77 | if [ "$RUNNER_OS" == "Linux" ]; then |
66 | 78 | xvfb-run -a pytest tests/integration -v --cov=src/measureit --cov-append --cov-report=xml |
67 | 79 | 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 |
69 | 93 | fi |
70 | 94 |
|
71 | 95 | - name: Run E2E tests (selected platforms) |
|
0 commit comments