Skip to content

Commit 6673b1e

Browse files
committed
fix(pytest): Add more Xvfb tricks to try and fix tkinter integration tests in uv
1 parent e6b4b7d commit 6673b1e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/pytest.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,33 @@ jobs:
4949

5050
- name: Install dependencies
5151
run: |
52-
# pip causes unit tests to crash when combined with uv, so avoid installing it
53-
# uv pip install 'pip==25.1.1'
54-
uv pip install --editable .[dev]
52+
uv pip install .[dev]
5553
5654
- name: Install apt packages
5755
run: |
5856
sudo apt-get update
5957
sudo apt-get install -y xvfb
6058
59+
- name: Setup virtual display
60+
run: |
61+
export DISPLAY=:99.0
62+
Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &
63+
sleep 3 # Give Xvfb time to start
64+
6165
- name: Test with pytest
6266
id: pytest
6367
continue-on-error: false
68+
env:
69+
# Ensure proper X11 and GUI environment
70+
DISPLAY: ":99.0"
71+
QT_QPA_PLATFORM: "offscreen"
72+
MPLBACKEND: "Agg"
73+
PYTHONPATH: ${{ github.workspace }}
74+
CI: "true" # Mark as CI environment
6475
run: |
65-
export DISPLAY=:99
66-
Xvfb :99 -screen 0 1024x768x16 &
67-
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
76+
# Ensure X11 forwarding works
77+
xset q || echo "X11 not fully ready, continuing anyway"
78+
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
6879
6980
- name: Fix coverage paths
7081
run: |

0 commit comments

Comments
 (0)