Repository navigation
fix: fail runs when a --file filter matches no test - #44
Merged
Merged
Conversation
Jest and Playwright combine positional test-path filters as a union, so a requested --file path that matched nothing was silently dropped whenever another path matched, and the run reported success. Parsers now report the test files each suite ran. After all selected suites finish, every --file filter must match a test file in at least one selected suite; each unmatched filter is recorded as an infrastructure failure on the first selected suite and the run exits with code 2. The check is skipped when a selected suite has no file inventory (skipped, guarded, timed out, missing result file, or a custom parser without file data).
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.
Problem
--filevalues are passed to Jest and Playwright as positional test-path filters, which both frameworks combine as a union. A path that matched nothing was silently dropped whenever another path matched, and the run reported success:Fix
testFiles, the test files each suite ran (Playwright paths are resolved againstconfig.rootDir). Custom parsers may returntestFiles; otherwise a completetestResultslist is used.--filefilter must match a test file in at least one selected suite, using the frameworks' semantics (regular expression over the test path, optional Playwright:linesuffix) plus literal path comparison.Unmatched File Filter: <filter>on the first selected suite; the run exits with code 2.beforeSuiteguard, timeout, missing result file, custom parser without file data).--file, reporters receive suite results after the check, so a suite is never printed as passed first.Rule documented in README (File Filters), CLI help, architecture doc and changelog. Version 0.4.5.
Verification
npm run verify— exit 0; Unit 356 passed; integration 2 passed; workflow and package checks passed.tests/unit/core/orchestrator-file-filters.test.ts— two of its tests fail onmastersources and pass with the fix.✗ unit: 11 passed, 1 failed, namesUnmatched File Filter: tests/unit/shared/does-not-exist.test.ts, and ends withTESTFOLD_RESULT:{"success":false,"passed":11,"failed":1,...,"exitCode":2}.