Skip to content

loopguard: pass over sudo, time and exec options before a test run - #240

Open
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix/verify-behind-sudo-time-exec
Open

KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix/verify-behind-sudo-time-exec

Conversation

@VISHNU0906

Copy link
Copy Markdown
Contributor

Hi Saksham Uboweja (@SakshamUboweja), one more on the verification side, next to #213.

_PREFIX_RE in loopguard/turn.py passes over env, nice and timeout with their options, but it had no sudo or exec, and time only as a bare word. So these were not counted as test runs:

  • sudo pytest -q, sudo -u bob python -m pytest, sudo -E npm test
  • time -p pytest, time -o t.txt npm test
  • exec pytest, command -p pytest, nice --adjustment 5 pytest

A failing one of these after the last edit left resolved_proxy() True, the same problem #213 fixed for env -u and nice -n.

Now sudo is passed over with its value-taking options (-u, -g, -C, -D, --user=... and short clusters like -Eu bob), time with -p/-v/-f/-o, exec with -a/-c/-l, and nice --adjustment N with a space. command -v pytest still counts as nothing, since it only looks the runner up.

Tests: test_a_runner_behind_sudo_time_or_exec_counts_as_a_verification goes through TurnGuard.fold like the env/nice test, and all 12 cases fail with turn.py from main. A second test pins the ones that should stay no run (command -v pytest, sudo make, sudo -l, --collect-only, time -p echo pytest). python -m pytest tests experiments/tests passes on Python 3.10 and 3.13, and scripts/dead_code.py output is the same as on main.

This is separate from #239 (micro-skills side) and touches a different file.

status_of_tests only knew bare `time` and had no `sudo` or `exec`, so `sudo pytest`,
`sudo -u bob python -m pytest`, `time -p pytest` and `exec pytest` were no verification
and a failing run after the last edit left the turn green. Pass over them with their
value-taking options, take `nice --adjustment 5`, and keep `command -v pytest` a lookup.

Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant