Skip to content

T126: fail a run that executed nothing - #16

Open
tomj12k wants to merge 1 commit into
mainfrom
security/t126
Open

tomj12k wants to merge 1 commit into
mainfrom
security/t126

Conversation

@tomj12k

@tomj12k tomj12k commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Tracked as T126 in the private security repository (Morelitea/security).

The finding, the reasoning, the verification and the review notes live there. This description is deliberately minimal: the repository is public.

Reviewers: look up T126 in Morelitea/securitythreat-model.md for the finding, work-items.md for the acceptance criteria.

Scope of this change: package.json (test script), vitest.config.ts (one option), scripts/assert-tests-ran.mjs (new), .gitignore (one line). No application code.

Verified: a normal run reports 285 of 285 test(s) executed and exits 0. A run whose selection is empty exits 1 with the run selected 285 test(s) and executed none of them — every one was skipped, which is not a pass.

Worth one line for reviewers, because the obvious remedy is not sufficient on its own: the runner's passWithNoTests option covers no test files found, and not files found with every test in them filtered out. Both are in place here and the config comment says which does which.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D5xdKhPXJT4HMWwUyENiu1

The test command returned 0 when every test was skipped. Now it checks how many
actually ran and fails if that is none.

`passWithNoTests` alone does not cover it: that is "no test files found", not
"files found and every test in them filtered out". Measured here -- with the
flag set, filtering to a name that matches nothing reports 285 skipped and
returns 0. Both halves are in place, and the comment says which does which.

Demonstrated: a normal run reports "285 of 285 test(s) executed" and exits 0; a
run filtered to nothing exits 1 saying it executed none of them.

Tracked as T126. Details in the private security repository.
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