Repository navigation
loopguard: count hatch test as a test run - #305
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
Hatch 1.10 and later run a project's tests with `hatch test`: pytest in Hatch's own test environment (`src/hatch/cli/test/__init__.py`). The loop guard read `hatch run pytest` as a test run but not `hatch test`, so a failing `hatch test` after the last edit left the turn counted as ended green. `hatch test` is now a verification, with its options and any path. With `-s`/`--show` it only shows the environments and runs nothing, so it is still not a test run, also when the flag is combined with others (`-ps`); after `--` the flags are pytest's, so `hatch test -- -s` counts. The alternative is added at the end of `VERIFY_RE`, apart from the lines other changes edit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hatch 1.10 and later run a project's tests with
hatch test: pytest in Hatch's own test environment (src/hatch/cli/test/__init__.pyin pypa/hatch). The loop guard readhatch run pytestas a test run but nothatch test, so a failinghatch testafter the last edit left the turn counted as ended green.Fix:
hatch testis a verification, with its options and any path. With-s/--showit only shows the environments and runs nothing, so it is still not a test run, also when the flag is combined with others (-ps,-cs). After--the flags are pytest's, sohatch test -- -scounts.hatch test --help,hatch testsandhatch buildare still not runs. The alternative is added at the end ofVERIFY_RE, apart from the lines #284 and #294 change; the branch merges with both, and with #295 and #296.Tests, in a new
tests/test_loopguard_hatch_test.py:hatch testcommands, each a verification, and a failing run after an edit is not ended green; all 9 fail on main;--showforms among them.The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.
Fixes #301