Repository navigation
test(cli): the kept-store search catalog case skips on a Node without module.registerHooks - #11832
Conversation
… module.registerHooks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested. The skip is the right fix: on Node 22.13 the base fails this case at line 261 and this head skips it, while Node 24 still runs all 11 cases. One change remains before approval.
packages/cli/test/packed-search-catalog.test.mjslines 31-36 re-declarehasModuleHooks, whichpackages/cli/test-utils/packed-gather-cache-fixture.mjsalready exports for the other kept-entry tests, so import it (import {hasModuleHooks} from '../test-utils/packed-gather-cache-fixture.mjs';) and drop the local copy and thenode:moduleimport, so a later change to that guard reaches this case too.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the daily CLI tests on the minimum Node fail this case at line 261 because no kept entry is written. Verified: the scheduled run's failure annotation, and reproduced on Node 22.13.0 against the base.
- Claim: the case came in with the stored search catalog change. Verified from the file history.
- Claim: the CLI keeps gathers only through
module.registerHooksand otherwise only runs the gather. Verified:foundation/fs/gather-cache.mjs:334-335andfoundation/fs/gather-cache.test.mjs:195-207. - Claim: Node has
module.registerHooksfrom 22.15 and 23.5. Verified absent on 22.13.0 and present on 24.20.0; the boundary versions were not run. - Claim: the case passes on the Node in
.nvmrc. Verified on Node 24.20.0 (11 passed);.nvmrcnames 24.22.1. - Claim: the skip uses the same guard as the other kept-entry cases. True for the expression; the packed gather-cache suites import it from the shared fixture instead of copying it.
- Claim: nothing else changes, and the case is identical where hooks exist. Verified: the body is only re-indented.
- Claim: the fresh gather on an older Node is already covered. Verified:
packed-gather-cache.records.test.mjs:633-645. - Claim: on Node 22.13.0 the file gives 10 passed and 1 skipped, and failed before. Verified by reproduction.
- File:
packages/cli/test/packed-search-catalog.test.mjs. Finding: the guard is copied instead of imported.
|
validation: ran Addressed the requested change: Only |
There was a problem hiding this comment.
Approved. The requested change is done: the test now imports the shared hasModuleHooks guard from packages/cli/test-utils/packed-gather-cache-fixture.mjs instead of keeping its own copy. On Node 22.13 the base fails this case at line 261 and this head skips it, while Node 24 still runs all 11 cases, and CI's test, lint and typecheck jobs passed on this head.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim: the daily CLI tests on the minimum Node fail this case at line 261 because no kept entry is written. Verified: the scheduled run's failure annotation, and reproduced on Node 22.13.0 against the base.
- Claim: the case came in with the stored search catalog change. Verified from the file history.
- Claim: the CLI keeps gathers only through
module.registerHooksand otherwise only runs the gather. Verified:foundation/fs/gather-cache.mjs:334-335andfoundation/fs/gather-cache.test.mjs:195-207. - Claim: Node has
module.registerHooksfrom 22.15 and 23.5. Verified absent on 22.13.0 and present on 24.20.0; the boundary versions were not run. - Claim: the case passes on the Node in
.nvmrc. Verified on Node 24.20.0 (11 passed);.nvmrcnames 24.22.1. - Claim: the skip uses the same guard as the other kept-entry cases. Verified: it imports the export the packed gather-cache suites import.
- Claim: nothing else changes, and the case is identical where hooks exist. Verified: the body is only re-indented.
- Claim: the fresh gather on an older Node is already covered. Verified:
packed-gather-cache.records.test.mjs:633-646. - Claim: on Node 22.13.0 the file gives 10 passed and 1 skipped, and failed before; on Node 24 it gives 11 passed. Verified by reproduction.
- File:
packages/cli/test/packed-search-catalog.test.mjs. Clear.
PR Analysis Report🔎 Preview ·
|
Takes #11832's head: the case uses hasModuleHooks from the gather-cache test fixture, as the other kept-entry tests do, instead of a local copy.
… module.registerHooks (#11835) * test(cli): the kept-store search catalog case skips on a Node without module.registerHooks Re-cut of #11832, byte for byte. The CLI keeps a gather only through module.registerHooks (Node 22.15 and 23.5 on); on its oldest supported Node it gathers fresh each run and keeps no entry, so the case that reads a kept entry skips there, as the other kept-entry cases do. * test(cli): the search catalog case imports the shared module-hooks guard Takes #11832's head: the case uses hasModuleHooks from the gather-cache test fixture, as the other kept-entry tests do, instead of a local copy. * Merge remote-tracking branch 'origin/main' into test/search-catalog-skip-no-hooks * Merge remote-tracking branch 'origin/main' into test/search-catalog-skip-no-hooks * Merge remote-tracking branch 'origin/main' into test/search-catalog-skip-no-hooks * test(cli): the packed search catalog case reads the kept folder where the CLI keeps it on macOS macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME, so the case gives its run a home of its own and reads the kept folder through userCacheDir. The same change as #11834, folded in here so the case passes on macOS too. * Merge remote-tracking branch 'origin/main' into test/search-catalog-skip-no-hooks
validation: ran
pnpm exec vitest run packages/cli/test/packed-search-catalog.test.mjson Node 22.13.0 (10 passed, 1 skipped; it failed 2 of 2 runs before the change) and on Node 24.22.1 (11 passed, the changed case included)What failed
The daily CLI tests on the CLI's declared minimum Node (22.13.0, run 43675632186, job
cli-tests (4/4)) fail one case inpackages/cli/test/packed-search-catalog.test.mjs:Cause
The case, added with the stored search catalog (#11755), expects an installed CLI to write one kept gather entry. The CLI keeps gathers only through
module.registerHooks, which Node has from 22.15 and 23.5. On an older Node,recordRuninfoundation/fs/gather-cache.mjsdeliberately runs the gather without recording anything, so no entry is written and the folder is empty. On the Node in.nvmrcthe case passes.Fix
The case now skips on a Node without
module.registerHooks(it.skipIf(!hasModuleHooks)), the same guard every other case that reads a kept entry uses (packed-gather-cache.*.test.mjs,gather-cache.test.mjs). Nothing else changes: on a Node that has the hooks, the case and its assertions are the same. The fresh gather on an older Node is already tested inpacked-gather-cache.records.test.mjs("a Node without module.registerHooks").What I was unsure of
Instead of skipping, the case could branch and check on an older Node that no entry is kept and that each run still matches a live gather. I followed the repository's existing convention because the records test already covers that behaviour.