Repository navigation
Conversation
Document empty --filter validation and unchanged omitted/non-empty behavior for test run, test rerun, and ci run.
Validate --filter in the test run, test rerun, and ci run actions with the existing exit-5 validation error. Preserve omitted and non-empty values, including whitespace, and cover the command paths with offline regression tests. Refs TestSprite#606
Update only test run, test rerun, and ci run help snapshots to match the clarified --filter option.
|
🏆 Season 4 CLI Improvement Bonus: entry recorded. Thanks, @WUWTest! To be counted, this PR needs the following by Oct 29, 11:59 PM PT:
Rewards go to merged PRs judged a genuine improvement, and up to three bonus-eligible PRs count per person. Untick the box to withdraw the entry. This comment refreshes when you edit the PR. Full rules. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Validate test and CI command filters src/commands/test.ts, src/commands/ci.ts |
parseNameFilter rejects an empty value. The test run, test rerun, and CI handlers pass the parsed filter to their existing execution paths. Help text describes the non-empty filter rule. |
Verify and document filter behavior src/commands/test.filter.spec.ts, DOCUMENTATION.md |
Tests cover rejection before requests, omitted filters, case-insensitive matching, and preserved whitespace. Documentation describes the filter rules for test run, test rerun, and ci run. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- TestSprite/testsprite-cli#657 — This PR changes empty-filter handling in the shared selection interface. The preview-selection feature described by the issue remains unimplemented.
Merge Risk: 
Minimal · up to 66e66
-
Empty filters are rejected before requests in the inspected commands. No issue identified here prevents merging after normal checks.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#606requires rejection of only an explicitly empty--filterfortest run,test rerun, andci run. The change addsparseNameFilter, uses it in the three command handlers before existing filter checks, and returns the existing validation error. The summary confirms exit 5,details.field: filter, no request before failure, and coverage of single-test,--all, normal, and dry-run paths. Omitted, non-empty, and whitespace-only values remain supported. The change also updates the three help texts, snapshots, andDOCUMENTATION.md.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#606. They add shared validation, focused CLI regression tests, and related help and documentation updates for the three specified commands. The summary reports no selector refactor, new dependency, read-only list command change, or--statuschange. The added comment and test fixtures support the scoped implementation and verification.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Add the missing docstring for the command factory touched by the filter fix, following the review coverage advisory. No runtime behavior changes.
What does this PR do?
An empty shell variable in
--filter "$FILTER"currently runs every project test, or is silently ignored on a single-test invocation. Refuse an explicitly empty value in thetest run,test rerun, andci runactions before any request, including with--dry-run.Use the existing
VALIDATION_ERROR(exit 5,details.field: filter) and explain how to omit the flag or supply a non-empty substring. Omitted and non-empty values, including whitespace-only substrings, retain their behavior. Update all three help texts, their snapshots, and the command reference.Related issue
Closes #606
Season 4 CLI Improvement Bonus
Discord username:
Type of change
Checklist
mainbranch.npm run lintandnpm run format:checkpass.npm run typecheckpasses.npm testpasses and coverage stays at or above the 80% gate.DOCUMENTATION.md.Notes for reviewers
The runtime change follows the accepted scope: one helper in
test.ts, used by the three command actions; no selector refactor or new dependencies. The issue is assigned to WUWTest. Thanks to OkeyAmy for the report and reproducer.Validation on macOS, Node v25.9.0:
a18d37c; the 9 selection controls pass.--filter=, and omitted/non-empty/whitespace-only controls with injected HTTP fixtures.git diff --checkpass. Lint reports the existing unused-disable warnings (0 errors). Exactly three help snapshots changed.Summary by CodeRabbit
test run,test rerun, andci runnow reject an explicitly empty--filterwith a validation error before making a request, including in dry-run and single-test cases.