fix(tap): exclude nested node_modules from test file discovery - #209
Merged
Merged
Conversation
Deploying idempot-js with
|
| Latest commit: |
dfebe37
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://819b0b60.idempot-js.pages.dev |
| Branch Preview URL: | https://fix-taprc-exclude-nested-nod.idempot-js.pages.dev |
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.
Fixes a flaky
ENOENT: unlink './idempotency.db'failure intest:verify-coverage-min.Root cause: the
.taprcinclude globpackages/frameworks/**/*.test.jsmatches test files reached through pnpm workspace symlinks insidenode_modules(for examplepackages/frameworks/express/node_modules/@idempot/sqlite-store/sqlite.test.js, which resolves back topackages/stores/sqlite/sqlite.test.js). The existingexclude: node_modules/**only matches a root-levelnode_modules, so tap ran the same file twice in parallel. The sqlite store's default path is the CWD-relative./idempotency.db, so the two workers raced on one physical file; whichever worker ran its cleanupunlinkSyncsecond threwENOENT.Change: add
**/node_modules/**to the exclude list (the original root-level pattern stays). Symlinked duplicates no longer run; the real test files still run and still feed coverage.Verification: two consecutive
test:verify-coverage-minruns pass at 100% coverage on this branch, where the duplicate previously made the gate fail roughly once every few runs locally. CI stayed green only by scheduling luck.All duplicates reachable through node_modules symlinks (same file as a real test elsewhere)
packages/frameworks/express/node_modules/@idempot/sqlite-store/sqlite.test.js→packages/stores/sqlite/sqlite.test.jspackages/frameworks/bun/node_modules/@idempot/core/tests/fingerprint.test.js→packages/core/tests/fingerprint.test.jspackages/frameworks/fastify/node_modules/@idempot/core/tests/errors.test.js→packages/core/tests/errors.test.jspackages/frameworks/hono/node_modules/@idempot/core/tests/validation.properties.test.js→packages/core/tests/validation.properties.test.jspackages/stores/redis/node_modules/@idempot/core/tests/content-negotiation.test.js→packages/core/tests/content-negotiation.test.jspackages/frameworks/fastify/node_modules/fastify/test/conditional-pino.test.js(upstream fastify test, also matched by the framework glob)Excluding these also stops the duplicated execution time and coverage double-counting they caused.