Repository navigation
pr_runtime: treat .test.tsx, .spec.jsx and .test.mjs files as tests - #191
Draft
RizgarOzan wants to merge 1 commit into
Draft
RizgarOzan wants to merge 1 commit into
RizgarOzan wants to merge 1 commit into
Conversation
_path_is_test only knew .test/.spec with .ts and .js, so a colocated React test like Button.test.tsx went into the source patch and the PR was skipped as no_test_patch. Match vitest's default include pattern instead. Closes huggingface#190
RizgarOzan
marked this pull request as draft
October 11, 2026 09:33
Contributor
Author
|
Keeping this as a draft until #189 is reviewed, so there's only one PR of mine in your queue at a time. It's complete and tested; I'll mark it ready after that one lands. |
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.
Summary
_path_is_testnow matches jest/vitest test file names with any of the usual extensions (.test.tsx,.spec.jsx,.test.mjs,.spec.cts, ...), using vitest's default include pattern. Before, only.test/.specwith.tsand.jscounted, so a colocatedsrc/Button.test.tsxwent into the source patch and the PR was skipped asno_test_patch.Test plan
test_path_is_test_matches_jsx_tsx_and_module_js_test_filesintests/test_pipeline_pr_runtime.py(four positive cases, plusButton.tsxandtest.config.tsstaying non-tests). Fails on main, passes here.split_patch_and_test_patchon a diff touchingsrc/Button.tsx+src/Button.test.tsx: the test file now lands in the test patch.test_pipeline_pr_runtime+test_pipeline_commit_runtime: 91 passed.uv run ruff check .anduv run ruff format --check .clean,generate_metrics.py --checkpasses.pytest -qon Windows (withouttest_modal_transfer.py, which needsharborfrom the extras): 213 failed / 68 errors, the same as clean main on this machine (file modes, symlinks); the only difference is the new passing test.generate_prompt_reference.py --checkalso fails on clean main here because of CRLF checkout, so I couldn't use it locally; this change doesn't touch prompts.Out of scope
test_*prefix rule still only covers.py,.jsand.ts; I left it alone.Closes #190