Repository navigation
ci: Port the private-PipeWire-pulse harness to Python (#962) - #2628
Conversation
fccbe11 to
c5fbdc4
Compare
|
Rebased onto
Re-ran against the new tip: |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review (this account is the PR author, so a formal approval is not possible from here; posted as a review comment instead).
Verdict: sound port, no change requested. Shell and Python read line by line against origin/master:test/cmocka/test_pulse_monitor_device.sh:
- re-exec:
PRIVATE_PIPEWIRE_STARTED=1 exec dbus-run-session -- sh "$0" "$@"↔os.execvpe("dbus-run-session", ["dbus-run-session", "--", sys.executable, __file__, *argv[1:]], env)— same argv, and going throughsys.executableis what the tool gate requires. - socket budget: shell's
$((${#dir} + 19)) -gt 107↔len(dir) + len("/pipewire-0-manager") > 107,/tmpfallback kept. - start order and stop order match (pipewire → sleep 1 → wireplumber → pipewire-pulse; stop is pulse, WirePlumber, pipewire via
reversed(processes)). - the 200 × 0.1 s
pactl infowait still fails (not skips) when a daemon that is installed dies, printing the three daemon logs; the no-hardware WirePlumber config is byte-identical. - wiring is complete:
.shdeleted, its GEN-005 block gone, the fourtests.d/*.cmakecallers onuv run --script,test/cmocka/build/test-graph.jsonand therust/obs-build/tests/native.rspin updated together, comment-only renames in the three.cfiles andtest_pulse_pulseaudio.py.
Gates I re-ran on c5fbdc4c3 (already based on current master):
ci/test_pulse_monitor_device.py8 OK;test_uv_run5 OK;test_test_graph_sorted2 OK;test_sorted_shared_lists5 OK;test_cmocka_windows_diagnostics4 OK;test_rust_scope10 OK;test_cmocka_mbedtls_graph2 OK;test_ci_toml19 OK.ci-lint precheck(ci.yml@a1917ce7): 23 violations, 557 approved exceptions on this branch vs 558 onorigin/master— exactly one burnt down, no new violation.gersemi --check test/cmocka/tests.dclean;clang-format --dry-run --Werrorclean on every touched.c;ruff checkclean. (ruff formatwould reformat the new files, but it is not a repo gate — master's ownci/test_uv_run.pyandci/test_pipewire_context_fail.pyare unformatted too.)
Two non-blocking nits, no action taken (they are behaviour choices, not port defects):
subprocess.run(argv)with a nonexistent test binary raisesFileNotFoundErrorand a traceback, where the shell's"$test_bin"printednot foundand exited 127. Only reachable by hand, never from ctest.- The
len(argv) < 2usage check returning 2 is new (the shell ran the empty program and exited 127). Harmless, arguably better.
Coordination note: #2620 rewrites the same test/cmocka/test_pipewire_wrapper.sh header comment and drops the adjacent ci.toml block, so whichever of the two lands second will need a rebase — that is expected cross-PR contention, not a defect in either.
Queuing it now (gh pr merge --auto); the queue picks the strategy.
c5fbdc4 to
f884db5
Compare
RED: ci/test_pulse_monitor_device.py drives test/cmocka/test_pulse_monitor_device.py by path with stub tools (pipewire, WirePlumber, pipewire-pulse, pactl, dbus-run-session) and a recording test binary, and pins the wiring: the shell gone, its GEN-005 exception gone, the four cmake callers and the test graph on `uv run --script`. It fails on master (module absent, shell present): ran 8 tests, FAILED (failures=7, errors=1). Refs #962.
GREEN: `test/cmocka/test_pulse_monitor_device.py` replaces the 74-line
`test_pulse_monitor_device.sh` token for token — the
`PRIVATE_PIPEWIRE_STARTED` re-exec through a private `dbus-run-session`, the
`/pipewire-0-manager` 107-byte socket-path check with the `/tmp` fallback, the
no-hardware WirePlumber config, the 200 x 0.1 s `pactl` wait with a hard fail
when an installed server does not come up, then the test binary and a stop of
pipewire, WirePlumber and pipewire-pulse.
Wiring: the four ctest entries in `test/cmocka/tests.d/*.cmake` and
`test/cmocka/test_pipewire_wrapper.sh` run it through `uv run --script`; the
shared test graph (`test_pulse_monitor_samples`) and
`rust/obs-build/tests/native.rs` name the `.py`; the C tests' skip messages and
`test_pulse_pulseaudio.py`'s docstring do too; the GEN-005 exception is removed.
uv run --no-project python -m unittest discover -s ci -p test_pulse_monitor_device.py
-> 8 tests, OK
Refs #962.
f884db5 to
86a35f6
Compare
|
Rebased onto the new
Handed off to the coordinator. |
Part of the #962 GEN-005 burn-down: port the private PipeWire-pulse harness the
test_pulse_monitor_device/test_pulse_stream_restart/test_pulse_two_sources/
test_pulse_default_follow_pipewirecmocka tests run through to Python, anddelete the shell.
What
test/cmocka/test_pulse_monitor_device.sh(74 lines) starts a private PipeWiresound server — its own runtime dir, config and D-Bus, no hardware devices. It
skips (77) when PipeWire, WirePlumber, pipewire-pulse, pactl or
dbus-run-sessionare missing, re-executes itself insidedbus-run-session,waits for the server to answer
pactl(failing with the daemon logs when onethat is installed does not come up), runs the passed cmocka test binary and
stops the daemons. It becomes
test/cmocka/test_pulse_monitor_device.py, tokenfor token — the
PRIVATE_PIPEWIRE_STARTEDre-exec, the/pipewire-0-manager107-byte socket-path check with the
/tmpfallback, the no-hardware WirePlumberconfig, the 200 × 0.1 s
pactlwait, and the stop of pipewire-pulse, WirePlumberthen pipewire.
Wiring, all of it on
uv run --script:test/cmocka/tests.d/*.cmake(test_pulse_monitor_device,test_pulse_stream_restart,test_pulse_two_sources,test_pulse_default_follow_pipewire);test/cmocka/test_pipewire_wrapper.shruns the.pythe way its ctestcallers do, uv resolved by absolute path so its stub
PATHstill reaches it;test_pulse_monitor_samples, which CMake registersfrom
test/cmocka/build/test-graph.json— and therust/obs-build/tests/native.rsassertion that pins its command array;
test_pulse_pulseaudio.py'sdocstring name the
.py;GEN-005entry for the.shis removed fromci.toml.RED → GREEN
2695abc08:ci/test_pulse_monitor_device.pydrives the module by pathwith stub
pipewire/wireplumber/pipewire-pulse/pactl/dbus-run-sessiontools and a test binary that records its environment, itsargv and the WirePlumber config, and pins the wiring (shell gone, exception
gone, the four cmake callers and the test graph on
uv run --script). Itfails on master —
Ran 8 tests … FAILED (failures=7, errors=1)(the moduledoes not exist and the shell is still there).
c5fbdc4c3: the port, the caller and graph rewiring, the.shdeleted,the exception removed.
uv run --no-project python -m unittest discover -s ci -p test_pulse_monitor_device.py→ 8 tests, OK. The neighbouring checkspass:
test_uv_run(5),test_test_graph_sorted(2),test_sorted_shared_lists(5),test_cmocka_windows_diagnostics(4),test_rust_scope(10),test_cmocka_mbedtls_graph(2),test_local_gate(12);
./lintlane green.Evidence
ci-lint precheck(zackees/ci.yml@a1917ce7): onorigin/master(2c9ebf367)23 violation(s), 558 approved exception(s); on this branch
23 violation(s), 557 approved exception(s) — exactly one exception burnt
down and no new violation.
Rebase
Rebased onto
origin/masterafter #2619 landed, which also touchedtest/cmocka/test_pipewire_wrapper.sh. One hunk conflicted — the shared headercomment, where #2619 renamed
test_pipewire_context_fail.shand this PR renamestest_pulse_monitor_device.sh; resolved to# test_pipewire_context_fail.py, test_pulse_monitor_device.py).with #2619'sloop kept.
ci.tomlauto-merged (each PR drops its own adjacent exceptionblock). The SHAs above are the rebased ones; the
uv rungates, theci/test_*set and the local wrapper run were re-checked against the new tip.Refs #962.