feat(cmd): never auto-run the test entrypoint; add wippy test#349
Open
skhaz wants to merge 2 commits into
Open
feat(cmd): never auto-run the test entrypoint; add wippy test#349skhaz wants to merge 2 commits into
wippy test#349skhaz wants to merge 2 commits into
Conversation
Why: `wippy run <hub-module>` could silently run a module's test entrypoint — kickside/kickside's only command is wippy/test's runner — so "running the app" ran its tests and exited instead of starting the app. What: Thread a run/test selection mode through the run flow. `wippy run` now excludes the entrypoint named "test" and auto-selects a non-test entrypoint (a `main` wins; a single non-test otherwise); it errors listing them when several non-test entrypoints exist without a `main`, and boots the app and keeps it running when a module has no non-test entrypoint. Explicit `wippy run test` is refused. A new top-level `wippy test [module]` runs only the test entrypoint.
f482172 to
4c782fa
Compare
Why: `wippy run`/`wippy test` distinguished the test entrypoint with a hardcoded `testCommandName = "test"` and a runMode enum, special-casing the literal name in two divergent selection paths. The magic string does not scale to further run-like commands and forces the CLI to compensate rather than read intent. What: Entrypoints now declare `meta.command.use_case` (default "run"); `wippy test` targets the "test" use case. A single canonical pair, collectCommands + selectEntrypoint, drives both the lockfile and pack flows, filtering by declared use case and deriving the cross-use-case hint from the entry's own meta. The runMode enum, testCommandName, resolveCommandToEntry, and the name-based exclusion are removed; bare `wippy run` still boots without executing an entrypoint. The test runner gains `use_case: test`, and the app test harness scripts move from the now-rejected `wippy run test` to `wippy test`.
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.
Why
wippy run <hub-module>could silently run a module's test entrypoint. Forkickside/kicksidethe only command-enabled entry iswippy/test's runner, sowippy run kickside/kicksideran the test suite ("Running Tests / No tests found")and exited instead of running the app.
What
A run/test selection mode threaded through the run flow:
wippy runnever selects the entrypoint namedtest. It auto-selects anon-test entrypoint (a
mainwins; otherwise the single non-test one), errorslisting them when several non-test entrypoints exist without a
main, andboots the app and keeps it running when a module has no non-test entrypoint.
Explicit
wippy run testis refused (points towippy test).wippy test [module|file.wapp]— new top-level command that runs onlythe
testentrypoint; errorsno test entrypoint foundif none.wippy run/wippy run -c, no positional) is unchanged.Testing
go test -race ./cmd/...green;golangci-lint v2.8.00 issues.TestSelectPackCommand(16 cases, both modes) +runPackEntriesintegration tests(no-entrypoint runs-as-server; test-mode error; run-mode unknown-command).
run_pack.go: 100% efficacy (0 surviving covered mutants).wippy run kickside/kickside→ boots the app, stays running, serves:8085(HTTP 200), runs no tests.
wippy test kickside/kickside→ runs the test entrypoint.