Skip to content

test: catch projects that lose their test files - #337

Merged
JoshuaKGoldberg merged 2 commits into
mainfrom
test-guard-missing-project-tests
Sep 22, 2026
Merged

JoshuaKGoldberg merged 2 commits into
mainfrom
test-guard-missing-project-tests

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Overview

Follow-up to #335, closing the two gaps that let those deletions through CI:

  • Test, Solutions, and Tsc selected projects from all_changed_files (ACMR), so a delete-only change never ran the affected project. Switched to all_modified_files (ACMRD).
  • files.test.ts now asserts each step — or src — contains a *.test.* file, gated on the project's test script being jest. The 12 tsc projects legitimately ship none, so this adds no false positives.

Verified: 187 pass on main, including 24 new assertions; re-deleting the typeinator test files fails 3, one per step. The workflow change needs a real delete-only PR to confirm end to end.

🤖 Generated with Claude Code

Two gaps let #288 delete all three `the-typeinator` test files without
any check going red, leaving the project broken on `main` for months
(#322, #323, #324).

The `Test`, `Solutions`, and `Tsc` workflows pick which projects to run
from `changed-files`'s `all_changed_files` output, which is ACMR and so
excludes deletions. The typeinator's only change in that PR was three
deletions, so the project never ran. Switches all three workflows to
`all_modified_files` (ACMRD), which includes them.

`files.test.ts` runs on every PR with no changed-files filtering, but
only validated `_category_.json`, `README.md`, `tsconfig.json`, and
`package.json` -- a step directory with no test file passed. Adds an
assertion that every step (or `src`) of a project contains a test file.

A project's `test` script is the discriminator: `tsc` projects are
type-checking exercises and legitimately ship no tests, while all 18
`jest` projects currently have a test file in every step, so the new
assertion adds no false positives.

Verified by re-deleting the three typeinator test files, which now fails
`files.test.ts` with one error per step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the test-guard-missing-project-tests branch from ba86975 to 3b8afe0 Compare September 22, 2026 12:57
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review September 22, 2026 13:01
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the test-guard-missing-project-tests branch from 18d6218 to 3b8afe0 Compare September 22, 2026 13:11
@JoshuaKGoldberg
JoshuaKGoldberg merged commit dd13f0e into main Sep 22, 2026
7 checks passed
@JoshuaKGoldberg
JoshuaKGoldberg deleted the test-guard-missing-project-tests branch September 22, 2026 13:28
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.

🛠 Tooling: CI doesn't catch a project losing all of its test files

1 participant