test(fixtures): fail when a required fixture group is missing - #267
Merged
karagozemin merged 2 commits intoAug 31, 2026
Merged
Conversation
Closes Sub-Rosa-Issue#248 Un grupo configurado en GROUPS que resolvia a un directorio ausente o vacio salia por [SKIP] y el proceso terminaba en 0. O sea que borrar un grupo entero desactivaba en silencio el presupuesto de tamaño que lo cuidaba. Ahora todo grupo configurado es obligatorio, y los dos casos se informan por separado porque se arreglan distinto: uno se restaura y el otro se repuebla. De paso, el catch de walk() se tragaba cualquier error. Un permiso denegado se veia igual que un directorio ausente. Ahora solo se ignoran ENOENT y ENOTDIR, que son los normales al recorrer en profundidad. Sin cambios en contenidos de fixtures ni en presupuestos. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #248
A configured group that resolved to a missing or empty directory took the
[SKIP]path and the process still exited0. Deleting a whole fixture group therefore disabled, in silence, the size budget that was meant to guard it.The change
Every group configured in
GROUPSis now required. The two failure paths are reported separately, on purpose: they are fixed differently, one by restoring the directory and the other by repopulating it, and a single shared message would send you to go look which one it was.The empty-directory message names the
includepattern, because a directory that looks populated can still be empty for this group if nothing matches the extension.A related bug found on the way
walk()caught every error and treated it as "directory does not exist":So a permissions error read as an absent directory, which fed the same silent
SKIP. Now onlyENOENTandENOTDIRare swallowed, which are the ones that legitimately occur while walking a tree. Anything else propagates.Tests
Six tests, all passing. The new ones build a temporary project fixture with the three configured groups and then remove or empty one:
The missing-directory test also asserts
[SKIP]no longer appears, so the old behavior cannot come back unnoticed. The happy-path test on a temporary project matters too: without it, a change that made every group fail would still pass the two failure tests.Scope
No fixture contents and no budgets were touched.
node scripts/check-fixture-sizes.mjsstill exits0on this repository.🤖 Generated with Claude Code