Skip to content

Exit 1 from --filter-list when no tests match#826

Merged
DavertMik merged 1 commit into
2.xfrom
fix/filter-list-exit-code
May 24, 2026
Merged

Exit 1 from --filter-list when no tests match#826
DavertMik merged 1 commit into
2.xfrom
fix/filter-list-exit-code

Conversation

@DavertMik
Copy link
Copy Markdown
Contributor

Summary

  • --filter-list now exits 1 when no tests match the filter or filter resolution fails, and 0 when at least one test is returned. CI scripts can branch on $? to skip launching the runner when there's nothing to run.
  • Promotes the "No tests found" message from log.info to log.warn so it still surfaces in the quieter --format mode.
  • Promotes the catch branch from log.info to log.error for the same reason.

Test plan

  • Empty filter result exits 1 (verified with COVERAGE_BY_DEFAULT_GIT_FILE=1 + non-matching coverage.yml)
  • Filter resolution error (missing coverage file / bad git diff) exits 1
  • Matching filter result exits 0, stdout contains the formatted IDs
  • Lint passes
  • CI green

🤖 Generated with Claude Code

CI scripts wrapping --filter-list need to know whether to launch the
runner. Exit non-zero (1) when no tests match the filter or when filter
resolution fails, and exit 0 when at least one test is returned. Also
promote the "No tests found" message from log.info to log.warn (so it
still surfaces in the quieter machine-readable mode) and the catch
branch from log.info to log.error.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@DavertMik DavertMik merged commit 30dbaa8 into 2.x May 24, 2026
10 checks passed
@DavertMik DavertMik deleted the fix/filter-list-exit-code branch May 24, 2026 21:04
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