You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bdcffd5
Browse filesBrowse the repository at this point in the historyBrowse files
test: address review feedback on the macOS cross-user test scaffolding
Seven changes, all to test/CI scaffolding; no change to the shim or to
_subprocess.py behaviour.
1. Delete test/openjd/sessions_v0/test_sudo.py. It duplicated the pre-existing
TestFindChildProcessIdPgrep in test_linux_sudo.py case for case (5 of 5), and
the existing versions are better: the no-match case drives real pgrep against
a real childless process instead of mocking the return, the error case is
parametrized over three exit codes and asserts the message content, and the
adjacent TestFindSudoChildProcessGroupId covers the late-child race the fix
exists for. Nothing was lost; full suite still 936 passed.
2. Move test_setsid_shim_creates_new_process_group out of
TestLoggingSubprocessMacOSSetsid into a new POSIX-scoped
TestSetsidShimBehavior. It was macOS-named but gated on is_posix(), so it ran
on Linux inside a macOS class. Kept POSIX rather than narrowed to macOS: the
shim is portable stdlib (os.getpgrp/getpid/setsid/execvp, no platform branch)
and macOS is only where it is *required*, so running it on Linux too catches a
broken shim string on faster runners. Whether macOS selects the shim is a
separate concern already covered by test_builds_setsid_shim_command_on_macos.
3. Add a class-level macOS skipif to TestMacOSShimInterpreter. Unlike the shim
string, _macos_shim_interpreter() really is macOS-only selection logic.
4. Extract the workflow's ~80 lines of inline provisioning into
scripts/run_macos_sudo_tests.sh, mirroring scripts/run_sudo_tests.sh so the
job is reproducible on a developer's Mac. Because macOS cannot be
containerized, the script is the counterpart to the Linux Dockerfile rather
than to the docker command: it provisions, runs and then removes the users,
groups, sudoers file, python symlink and temp root it created. Teardown is
best-effort throughout so a partial provision is still removable, and --keep /
--cleanup-only cover the CI and recovery cases.
5. Add cross-user-test / cross-user-test-macos hatch scripts so neither
platform's cross-user suite requires remembering a script path.
6. Expand the Python matrix from ['3.11','3.13'] to 3.9-3.14, matching
code_quality.yml and requires-python >=3.9.
7. Drop the paths: filter so the job runs on every PR. The cross-user path can
break from more places than a four-file list can enumerate, and a filtered job
that misses one reads as a pass.
Also drops the workflow's final "run remaining tests" step: code_quality.yml
already runs the whole suite on macos-latest across this same matrix, so that step
only duplicated it. This job now covers the cross-user tests alone.
Signed-off-by: andychoquette <78888816+andychoquette@users.noreply.github.com>
0 commit comments