Repository navigation
ci: Run the NixOS AppImage lane from Python (#962) - #2580
Conversation
test-appimage-nixos.sh only runs at release time, inside a privileged nixos container, so its decisions had no test. Load the port and compare its errors() with the shell's own grep calls on sample logs, including a good start, a refused preflight, no scene, no OpenGL, no NVML marker, a crash and an exited process. RED: build-aux/appimage/test_appimage_nixos.py does not exist, and the workflow still names the shell script (4 errors/1 failure). Refs #962
test-appimage-nixos.sh is a tracked shell script, a GEN-005 violation. It becomes build-aux/appimage/test_appimage_nixos.py. The step's docker command now brings uv and python3 from the same nixpkgs revision and runs the script through uv; the AppImage glob is expanded by the script, so the command no longer needs a shell. The start phase re-executes the script inside one nix shell that carries Xvfb, dbus and the process tools, and drives them from Python instead of an inline bash script. Every check is unchanged: the wrapper builds, the driver closure lands in /run/opengl-driver with the NVML stand-in, OBS keeps running for 45 s, reaches its main window, initializes OpenGL, reports VA-API unavailable without refusing to start, and the NVML marker names /run/opengl-driver/lib. GREEN: uv run python -m unittest ci.test_appimage_nixos_checks (4 tests OK, 0 mismatches against the shell's grep decisions over six sample logs); ./lint clean apart from the checkout's pre-existing submodule-pointer case. Refs #962
The port re-executed itself inside `nix shell` with nixpkgs `python3`, which ci/test_uv_run.py flags (#637): three bare interpreter invocations, one in the docstring and two in the re-exec argv. The lane needs nix only for the X tools (Xvfb, dbus, procps, coreutils), so the start phase now runs the same `uv run` interpreter the outer phase already uses (sys.executable) and the inner closure drops `python3`.
|
Format 🔍 / checks fix — Fixed in Evidence (local):
This PR touches |
zackees
left a comment
There was a problem hiding this comment.
Reviewed #2580 (obs-studio 2580) — verdict: looks good to land.
Checked:
- Decision parity. The port's
errors()keeps all six verdicts the shell made (state,preflight,scene,opengl,nvml,crash) with the same log patterns, andci/test_appimage_nixos_checks.py::test_the_port_decides_as_the_shell_didpins them against a realgreporacle over six sample logs. I ran it on this head:uv run --no-project python -m unittest ci/test_appimage_nixos_checks.py→ 4 tests, OK.ci/local_gate.pypicks up everyci/test_*.py, so the check runs in the gate rather than living as dead weight. - The workflow step.
docker runuses the exec form, so nothing expandsOBS-Studio-*-linux-x86_64.AppImageany more;locate()does the glob, which is what the step now relies on. Thenix shellinterpreter (sys.executable) is a store path and stays resolvable in the innernix shellof xorg/dbus/procps/coreutils, so the re-exec of the start phase is sound and no barepython3remains (ci/test_uv_run.pyclean, as the last commit says). - Nothing left pointing at the removed script.
git grep test-appimage-nixos.shon this head only finds the test's own docstring and its negative assertion. - Ledger. CI-only change, no
docs/features.mdline needed (coordination.md§4).
Two non-blocking notes:
- The description's RED/GREEN SHAs (
b53a8f927,092da247a) no longer exist after the rebase — the branch head isab3b3f87over73a1dbb2,2d6999d7. Not worth a rewrite for a squash merge, but the next reader will chase a dangling SHA. locate()takessorted(matches)[0]and only fails when the glob matches nothing. If the release ever produces two AppImages in that directory, the lane would silently test the alphabetically first one; alen(matches) != 1error would say so instead.
Queuing it for the merge queue now.
Refs #962 (GEN-005 burn-down).
build-aux/appimage/test-appimage-nixos.shis a tracked shell script, which GEN-005 flags. It becomesbuild-aux/appimage/test_appimage_nixos.py.uvandpython3from the same pinned nixpkgs revision and runs the script withuv run --no-project. The AppImage glob is expanded by the script, so the command no longer needs a shell.nix shellthat carries Xvfb, dbus and the process tools, and drives them from Python (Popen, the same 3 s and 45 s waits) instead of an inline bash script./run/opengl-driverwith the NVML stand-in, OBS keeps running for 45 s, reaches its main window, initializes OpenGL, reports VA-API unavailable without refusing to start, and the NVML marker names/run/opengl-driver/lib.RED
b53a8f927—ci/test_appimage_nixos_checks.pyholds six sample logs and compares the port'serrors()with the shell's owngrepcalls (run for real) for each: a good start, a refused preflight, no scene, no OpenGL, no NVML marker, a crash and an exited process. Fails with the module missing and the workflow still naming the shell script.GREEN
092da247a— the port and the workflow step.uv run python -m unittest ci.test_appimage_nixos_checks→ 4 tests, OK; 0 mismatches against the shell's decisions over the sample logs.This lane only runs at release time inside a privileged
nixos/nixcontainer, so the port cannot be exercised end to end here; the decision layer is what the test pins../lintpasses apart from the pre-existingtest_macos_browser_helpersfailure in this checkout (modified submodule pointers, not in this diff).