Skip to content

fix(coverage): skip new test files in the unreported-source check - #117

Merged
Andreas-Garcia merged 1 commit into
mainfrom
fix/coverage-skip-test-files
Dec 5, 2026
Merged

Andreas-Garcia merged 1 commit into
mainfrom
fix/coverage-skip-test-files

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Summary

The unreported-source check added in #63 flags every new file that has a reported extension, sits in a reported directory and is missing from the coverage reports. Test files colocated with the sources (vitest/jest *.test.ts, *.spec.ts, __tests__/) match all three, because coverage tools never report test files, so any PR adding a colocated test fails the gate. Python callers keep their tests under tests/, outside the reported directories, which is why this did not show earlier. The first hit is BehindTheMusicTree/app-kit#624 (packages/app-kit/src/genre-tree/useRegionGenreLexicon.test.ts).

Changes

  • coverage.yml: the check skips test files by name: .test. / .spec. in the name, paths under __tests__/, test_*.py, *_test.py, *_test.go, conftest.py. Untested new source files are still flagged.
  • .github/tests/coverage.sh: scenarios for each test-file pattern, plus a new colocated source file and a source named testing.ts that must still fail.
  • README: documents the new-file check and its test-file exemption.

Callers

This only removes false positives, and no caller needs a migration. app-kit bumps its pin in #624, and the other callers pick this up at their next pin update.

Validation

  • bash .github/tests/coverage.sh passes. With the fix reverted, new colocated .test. file is not flagged fails, matching the app-kit error.
  • actionlint .github/workflows/coverage.yml passes.

@Andreas-Garcia
Andreas-Garcia enabled auto-merge (squash) December 5, 2026 13:07
@Andreas-Garcia
Andreas-Garcia merged commit 28a2fad into main Dec 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant