Exit 1 from --filter-list when no tests match#826
Merged
Conversation
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>
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.
Summary
--filter-listnow exits1when no tests match the filter or filter resolution fails, and0when at least one test is returned. CI scripts can branch on$?to skip launching the runner when there's nothing to run.log.infotolog.warnso it still surfaces in the quieter--formatmode.log.infotolog.errorfor the same reason.Test plan
1(verified withCOVERAGE_BY_DEFAULT_GIT_FILE=1+ non-matching coverage.yml)10, stdout contains the formatted IDs🤖 Generated with Claude Code