fix(retro): count polyglot test files and exclude vendored dirs#2013
fix(retro): count polyglot test files and exclude vendored dirs#2013genisis0x wants to merge 2 commits into
Conversation
Step 1 command 10 counted test files with a JS/TS-only glob (*.test.*, *.spec.*, *_test.*, *_spec.*) and excluded only node_modules. On a Python repo this misses test_*.py entirely, so the persisted total_test_files metric lands on stray matches instead of the real count, and the Step 12 trend line measures noise. A naive widening over-counts because virtualenv and vendored dependency trees (.venv, venv, site-packages, vendor) carry their own test suites. Add the common non-JS conventions (test_*.py, *Test.java; *_test.* / *_spec.* already cover go/rb/_test.py) and prune vendored + virtualenv directories so the count reflects project test files only. Closes garrytan#1999
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Heads-up on an overlap with #2037 (opened 06-18). Both PRs rewrite the same Step-1 test-counting glob — command 10 at — replacing the JS/TS-only glob + node_modules-only filter with a polyglot pattern and vendored-dir exclusion. Because both touch the identical lines in both This PR is the narrower, issue-linked fix (Closes #1999, command 10 only). #2037 is effectively a superset: it also fixes the per-commit test glob in commands 12/13 ( Not flagging either as wrong — just so the authors/maintainer can sequence them: if #2037 lands it subsumes this change (worth carrying |
Problem
/retroStep 1 command 10 counts repository test files with a JS/TS-only glob and excludes onlynode_modules:Python's dominant convention is
test_*.py, which none of those patterns match, so on a Python repo thetest_health.total_test_filesmetric never reflects the real count. Step 13 persists it and Step 12 trends it, so the test-health trend line tracks noise. As #1999 notes, a naive widening over-corrects, because virtualenv / vendored dependency trees (.venv,venv,site-packages,vendor) carry their own test suites and onlynode_moduleswas pruned.Fix
test_*.pyand*Test.java. The existing*_test.*/*_spec.*already cover Go (*_test.go), Ruby (*_test.rb/*_spec.rb), and Python's*_test.py, so the genuine gaps are Python'stest_prefix and Java's separator-lessFooTest.java.node_modules,.venv,venv,site-packages,vendor,.git) insidefindinstead of post-filtering onlynode_modules, so dependency test suites no longer inflate the count.Verification
On a polyglot fixture (5 real project test files across ts/js/go/py/java, plus dependency test files under
.venv/andnode_modules/):test_*.py+*Test.java, counts a.venvtest)bun test test/gen-skill-docs.test.ts test/skill-validation.test.ts— 734 pass, 0 fail. SKILL.md regenerated from the template.The same glob shape also lives in the shared
scripts/resolvers/testing.ts(the/shipbefore/after counts); left out of scope here to keep this focused on the/retrotrend metric in #1999.Closes #1999