mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-27 20:54:20 +00:00
jobs_test.go covers the job framework thoroughly, but nothing covers the
wiring: whether the kickoff handler renders the progress fragment into the
right hx-target, and whether the loop actually outlives the request it was
started from. Both are what ab4a4eb changed, and both are invisible to Go
tests — a typo in an hx-target or a fragment that renders blank passes every
assertion we have.
The load-bearing check drives crew import rather than the tier remap. A
one-member remap completes in under a second, so closing the tab "mid-run"
proves nothing; import does a PDS write plus a network PLC lookup per entry,
which leaves a real window to close the browser and watch the job keep going.
It is caught mid-flight at a progress tick with no admin page open.
Seeded members are created on the local-only dev hold and removed in a
finally block. README records the environment traps found while building
this: 127.0.0.1 vs localhost, in-memory sessions dying on every hold rebuild,
UA/IP pinning that makes curl log you out, and the forward-only appview
migrations that require a per-batch DB reset.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// cleanup-seeded-crew.mjs — remove crew members left behind by a batch check
|
|
// that crashed before its finally block ran.
|
|
//
|
|
// Worth knowing: a re-run of the seeding test will NOT recreate the condition
|
|
// it needs, because the import loop reports "already exists" and skips, which
|
|
// finishes instantly and quietly turns the detachment check into a no-op.
|
|
// Purge first, then re-run.
|
|
//
|
|
// node test/e2e/cleanup-seeded-crew.mjs [marker] # marker defaults to val00
|
|
import { open, adminPage, csrfOf, openCrew, purgeSeeded, BASE } from './lib.mjs';
|
|
|
|
const MARK = process.argv[2] ?? 'val00';
|
|
const ctx = await open();
|
|
const page = await adminPage(ctx);
|
|
const csrf = await csrfOf(page);
|
|
|
|
const [deleted, found] = await purgeSeeded(ctx, page, MARK, csrf);
|
|
console.log(`found ${found} matching "${MARK}", deleted ${deleted}`);
|
|
|
|
await openCrew(page);
|
|
const left = await page.evaluate(
|
|
(m) => (document.body.textContent.match(new RegExp(m, 'g')) || []).length, MARK);
|
|
console.log(`remaining references: ${left}`);
|
|
console.log(`hold: ${BASE}`);
|
|
|
|
await ctx.close();
|
|
process.exit(left === 0 ? 0 : 1);
|