HOMELAB-2567: test(forgejo): make deployed vitest load typebox #83
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Homelab/pi-extensions!83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "plane/HOMELAB-2567-typebox-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The deployed extension is a source drop with no
node_modules. pi's loader supplies the baretypeboximport ofindex.tsat runtime; vitest has no such loader, so every suite that reachesindex.tsdied at import while the suites that never import it still passed:RED before any change, byte-for-byte copy of the deployed tree (live checkout untouched):
e2b6f6e(14 files)Nothing is missing from
package.json.typeboxis a declareddependency(^1.1.24), the lockfile pins it (node_modules/typebox= 1.3.34), andnpm ciin the deployed drop makes the whole suite green. What the deployed shape lacked is the install step CI already performs — that is why CI is green while the deployed copy cannot run the same suite.Change
forgejo/scripts/test-in-deployed-shape.sh— supported runner for the deployed shape. Copies the package to a private0700temp dir (the source / live deployed checkout is never written to),npm ci --prefer-offlinefrom the package's own lockfile,tsc --noEmit,vitest runwith a JSON report, then asserts that everytests/**/*.test.tson disk was collected and passed. A suite that cannot be imported is printed by name with its runtime error and the script exits non-zero. Fails closed when the shippedpackage-lock.jsonno longer satisfies the shippedpackage.json.forgejo/TESTING.md— the two supported shapes (CI checkout, deployed drop), the exact failure text, and why neither adevDependenciesmove (typebox is a runtime import) nor a vitestresolve.aliasto pi's copy (different module instance, hides the gap) is the fix. Package-local becausedocs/does not exist in the deployed drop, anddocs/forgejo.mdbelongs to #81.forgejo/package.json—"test:deployed".npm testis unchanged, so CI'snpm ci→npm run typecheck→npm testchain is intact.Evidence
~/.pi/agent/extensions/forgejo:13/13 files loaded and passed, 349/349 tests, pinnedtypebox1.3.34; sha256 manifest of all 27 source files identical before/after (nonode_modulescreated in the live tree).14/14 files loaded and passed, 390/390 tests;--no-typecheckand default (typecheck included) both green.npm run typecheckclean,npm test14/14 files, 390 tests.DID NOT LOAD ... Failed to load url missing-module-probe ..., exit 1; apackage.jsonout of sync with the lock →npm ci refused the install, exit 1; bad args → exit 2.No self-review, no verdict, no merge, no Done transition from the worker; no reviewer dispatched.
a0be6e1f76ba9e115906Verdict: APPROVED
model: omniroute/deepseek-flash
head:
ba9e115906Independent general review of the entire diff against
origin/maine2b6f6e(3 files, +289/-0:forgejo/TESTING.md,forgejo/package.json+1 script,forgejo/scripts/test-in-deployed-shape.sh).Nothing outside
forgejo/;pi-swarm-suitebyte-identical to base. No blocker open.Root cause confirmed, not re-litigated:
typeboxis declared (^1.1.24) and lock-pinned (1.3.34); thedeployed drop simply has no
node_modules, and the missing piece is the install step CI already performs.Rejecting a
devDependenciesmove and aresolve.aliasto pi's copy is correct for the stated reasons.Independently rerun against the live deployed tree (it was re-dropped at 05:59 today with main's 14 suites,
so the count differs from the worker's 13/349 — the deployed revision moved, not the finding):
npm ci: ok (added 401 packages), 14/14 files, 390/390 tests, exit 0. Live tree byte-identical after therun: sha256 manifest of all 28 source files unchanged,
node_moduleslisting/size/mtime unchanged (stillonly
.vite/.vitest-cache). No lockfile edit was needed —npm cisucceeding from the shipped lock isthe proof the lock still satisfies
package.json.Fail-closed behaviour probed independently, each on its own 0700 temp copy: a suite importing an absent
module gives exit 1 with
DID NOT LOAD ...(the ticket's exact signature); a*.test.tson disk thatvitest does not collect gives exit 1
1 of 15 test file(s) produced no result at all; apackage.jsonoutof sync with the lock gives exit 1
npm ci refused the install; bad args/root exit 2. So a non-loadingsuite cannot be silently skipped — disk file count is compared with the JSON report and zero-assertion
suites are named with their first error line.
npm testis unchanged (package.jsongains onlytest:deployed;.forgejo/workflows/ci.yamluntouched), and CI run #195 on this exact head is 14/14 green including
forgejoandpr-title. Run #194was red only in
pi-swarm-suiteon the identical tree; same job green in #191/#192/#193 and #195 with anempty diff outside
forgejo/— classified as an owner-side flake and reported, not dismissed.Two non-blocking nits (no fix required here): (1) the success line asserts loading and failures only, so a
suite whose tests are all
it.skipreportsok: ... 390/391 testsand exit 0 — honest about loading, whichis this ticket's bug class, but nothing in
forgejo/testsusesskiptoday and a future assertion onskipped counts would harden it; (2) TESTING.md's
npm run test:deployed"from a deployed drop" needs thedrop to ship
scripts/, which the live drop does not have yet and the deploy sync is not in this repo —the always-available checkout-plus-
PACKAGE_ROOTpath is documented too, so this is a redeploy-time note.Verdict: APPROVED
model: omniroute/k3.1-pro
head:
ba9e115906tier: premium
Independent premium review of the exact one-commit diff against base
e2b6f6e42bf534e240e28b9bf6d860352e03252d: onlyforgejo/TESTING.md, onetest:deployedscript entry, and executableforgejo/scripts/test-in-deployed-shape.sh(+289/-0). No production code, dependency versions, lockfile, or CI workflow changed. Exact-head CI run #195 is green in all 14 jobs.I ran the runner from the exact-head archive against a separate 0700 deployed-shape copy. With typecheck enabled it exited 0:
npm cisucceeded from the shipped lock, all 14/14 files and 390/390 tests passed, and the pinnedtypeboxwas 1.3.34. The input copy's before/after SHA-256 manifest was byte-identical. An independent missing-local-import suite exited 1 and was explicitly namedDID NOT LOAD(14/15 files), proving the target partial-green failure now fails closed.bash -npassed; ShellCheck produced only style diagnostics.NIT-1 is confirmed but non-blocking: a fully
it.skipsuite exited 0 and the runner printedok: 15/15 files loaded and passed, 390/391 tests. The file did load—the ticket's required assertion—and no current test uses skip/only, but a follow-up should reject or explicitly report skipped counts rather than calling every file "passed".NIT-2 is also non-blocking: the live drop is still exactly the base commit, so its lack of the new script/doc is expected pre-merge state. Both are in the exact-head archive and the repository clone is the deployment unit; the checkout-script-plus-
PACKAGE_ROOTpath is independently usable. No blocker open. Detailed evidence:working-files/homelab-2518/HOMELAB-2567-review-kimi-final.md.