Skip to content

Commit 2c82246

Browse files
committed
fix(e2e): run Qt headlessly via offscreen platform; drop xvfb
The e2e harness only needs mediasrv's HTTP stack — Playwright's own Chromium connects to it directly. The Anki Qt window never needs to be visible. Setting QT_QPA_PLATFORM=offscreen lets Qt initialise without a display server, eliminating the exit-250 crash that happened when Qt couldn't connect to the (virtual) framebuffer. Also add PYTHONUNBUFFERED=1 so subprocess output reaches Playwright's [WebServer] log immediately, and drop xvfb-run from the CI step since it is no longer required.
1 parent 70a51e9 commit 2c82246

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
fi
116116
117117
- name: Run e2e tests
118-
run: xvfb-run --auto-servernum just test-e2e
118+
run: just test-e2e
119119

120120
- name: Ensure libs importable
121121
env:

qt/tests/launch_anki_for_e2e.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ def main() -> int:
9999
"ANKIDEV": "1",
100100
"PYTHONPYCACHEPREFIX": str(REPO_ROOT / "out" / "pycache"),
101101
"RUST_BACKTRACE": "1",
102+
# Headless Qt: the e2e harness only needs mediasrv's HTTP stack,
103+
# not a visible window. The offscreen platform plugin renders to
104+
# memory and requires no display server.
105+
"QT_QPA_PLATFORM": "offscreen",
106+
# Flush Python output immediately so Playwright captures it.
107+
"PYTHONUNBUFFERED": "1",
102108
}
103109
env.pop("QTWEBENGINE_REMOTE_DEBUGGING", None)
104110
env.pop("QTWEBENGINE_CHROMIUM_FLAGS", None)

0 commit comments

Comments
 (0)