Repository navigation
log_parsers: read jest headers with a project name or .mts path - #183
Open
jayzuccarelli wants to merge 1 commit into
Open
jayzuccarelli wants to merge 1 commit into
jayzuccarelli wants to merge 1 commit into
Conversation
With `projects`, jest prints each project's displayName between the label and the path (`PASS unit src/a.test.js`), and its default testMatch also runs `.mts` / `.cts` files. Neither header matched, so those tests lost their file prefix or were filed under the previous file. Same-named tests in different files then overwrote each other, and names changed with jest's file order between the pre and post runs. ## Summary - Skip an optional display name before the path in `_JEST_FILE_RE`, and accept the extensions jest's default testMatch does (`[mc]?[jt]sx?`), in both `jest_parser.py` and the standalone verifier. - New `tests/test_jest_output.py` runs both parsers on plain and colored multi-project headers and on `.mts` / `.cts` files. - Extends the long-line stall test with header-shaped noise; a looser `(?:.*?\s)?` version of this regex went quadratic on `PASS` plus whitespace. ## Test plan - [x] `pytest tests/test_jest_output.py`: 6 fail on main, pass here - [x] `pytest tests/test_jest_output.py tests/test_mocha_output.py tests/test_log_parsers_polyglot.py` plus the other parser test files: 152 passed - [x] `ruff check .` and `ruff format --check .` ## Out of scope - `_JEST_TARGETABLE_EXT` in `pr_runtime.py` also lacks `.mts` / `.cts`; that only falls back to running the whole suite.
This branch has not been deployed
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.
With
projects, jest prints each project's displayName between thelabel and the path (
PASS unit src/a.test.js), and its defaulttestMatch also runs
.mts/.ctsfiles. Neither header matched, sothose tests lost their file prefix or were filed under the previous
file. Same-named tests in different files then overwrote each other,
and names changed with jest's file order between the pre and post runs.
Summary
_JEST_FILE_RE, andaccept the extensions jest's default testMatch does (
[mc]?[jt]sx?),in both
jest_parser.pyand the standalone verifier.tests/test_jest_output.pyruns both parsers on plain and coloredmulti-project headers and on
.mts/.ctsfiles.(?:.*?\s)?version of this regex went quadratic onPASSpluswhitespace.
Test plan
pytest tests/test_jest_output.py: 6 fail on main, pass herepytest tests/test_jest_output.py tests/test_mocha_output.py tests/test_log_parsers_polyglot.pyplus the other parser test files: 152 passedruff check .andruff format --check .Out of scope
_JEST_TARGETABLE_EXTinpr_runtime.pyalso lacks.mts/.cts;that only falls back to running the whole suite.
Prepared with AI assistance (Claude Code); I reviewed the change and ran the tests.