Skip to content

loopguard: pass over env and nice options before a test run - #213

Open
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix/wrapper-options
Open

KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix/wrapper-options

Conversation

@VISHNU0906

Copy link
Copy Markdown
Contributor

Hi Aaron Li (@aaron-jx-li), a small one in the loop guard's test-run detection (loopguard/turn.py).

_PREFIX_RE passes over env and nice only as bare words. When they take options, the runner after them was not seen:

  • env -u CURSOR_AGENT python -m pytest tests
  • env -i PATH=/usr/bin go test ./..., env --unset=CI npm test, env -C web npx vitest run
  • nice -n 10 pytest -q, nice -5 go test ./...

status_of_tests returned None for all of these, so the run was not a verification. A failing run after the last edit then left resolved_proxy() true, and that turn was recorded as ended green.

The prefix pattern now also passes over env's options (-u, -C and their long forms with their value, flags like -i or a lone -) and nice's adjustment (-n 10, -n10, -5, --adjustment=5). The same pattern is used by _quiet, so env -u X git status; ... is now read the same way as git status; ....

Tests: one case through TurnGuard.fold per form above (edit, failing run, then verifications == 1 and not green), and a few that must stay as they were (env -u CI python -m pytest --collect-only, env -u CI echo pytest, nice -n 10 make). With the fix reverted, the 8 new verification cases fail. python -m pytest tests passes on Python 3.10 and 3.13 (908 passed, 16 skipped), experiments/tests passes, and scripts/dead_code.py output is the same as on main.

This is independent of #212 (different file).

env -u VAR pytest and nice -n 10 pytest put options between the
wrapper and the runner. The prefix pattern passed over only the bare
word, so the run was not a verification, and a failing run after the
last edit left the turn counted as ended green.

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