Repository navigation
microskills: read hatch test as a test run - #375
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 test environment. The observer read hatch run pytest as a test run but did not observe hatch test at all, while the loop guard counts it. It is now a test run with the form hatch test, except with -s or --show (also among combined short flags), which only shows the environments; what follows -- is pytest's.
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.
The observer read
hatch run pytestas a test run but did not observehatch testat all, while the loop guard counts it (since #305). Hatch 1.10 and later run a project's tests withhatch test, pytest in Hatch's test environment, so a Hatch project's test runs taught the micro-skills nothing: in a project wherepytestis not on PATH andhatch testpasses, the FormRepair fact naminghatch testwas never learned.Fix:
hatch testis a test run with the formhatch test(the path tohatchkept, as for other runners), except with-sor--show, also among combined short flags (-ps), which only shows the environments; what follows--is pytest's (hatch test -- -sruns the tests). This is the loop guard's own reading (loopguard.turn.VERIFY_RE).hatch runand the other Hatch commands read as before. Over the 5,974 strings in the test suites, only the tenhatch testcommands in the loop guard's own tests are classified differently, each now as a test run; one of them,hatch test --help, is read as the observer readspytest --help, a run that shows no tests ran.Tests, in a new
tests/test_observe_hatch_test.py:hatch testwith its options, and with-- -safter them, is a test run in the generic and the Python reading (fail on main);--show,-s,-ps,hatch tests,hatch buildandhatch env showare not;cd(fails on main), andhatch run pytestreads as before;pytestis not on PATH andhatch testpasses teach the fact that nameshatch test(fails on main).The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.
Fixes #374