Skip to content

Commit 9706433

Browse files
committed
fix(pytest): Add more Xvfb tricks to try and fix tkinter integration tests in uv
1 parent 97d2402 commit 9706433

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/pytest.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,25 @@ jobs:
5252
run: |
5353
uv pip install --editable .[dev]
5454
55+
- name: Setup virtual display
56+
run: |
57+
export DISPLAY=:99.0
58+
Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &
59+
sleep 3 # Give Xvfb time to start
60+
5561
- name: Test with pytest
5662
id: pytest
5763
continue-on-error: false
64+
env:
65+
# Ensure proper X11 and GUI environment
66+
LIBGL_ALWAYS_SOFTWARE: 1
67+
DISPLAY: ":99.0"
68+
QT_QPA_PLATFORM: "offscreen"
69+
MPLBACKEND: "Agg"
70+
PYTHONPATH: ${{ github.workspace }}
71+
CI: "true" # Mark as CI environment
5872
run: |
59-
export LIBGL_ALWAYS_SOFTWARE=1
60-
export DISPLAY=:99
61-
Xvfb :99 -screen 0 1024x768x16 &
62-
uv run pytest --cov=ardupilot_methodic_configurator --cov-report=xml:tests/coverage.xml --md=tests/results-${{ matrix.python-version }}.md --junit-xml=tests/results-junit.xml
73+
uv run --python=${{ matrix.python-version }} pytest --cov=ardupilot_methodic_configurator --cov-report=xml:tests/coverage.xml --md=tests/results-${{ matrix.python-version }}.md --junit-xml=tests/results-junit.xml
6374
6475
- name: Fix coverage paths
6576
run: |

0 commit comments

Comments
 (0)