feat(api): add bunyip-e2e-bootstrap test-account seeder (BUNYIP-52) #84
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-52-e2e-bootstrap-binary"
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?
Scope
First slice of BUNYIP-52 (per the agreed decomposition): the idempotent E2E test-account seeder only. The Playwright suite (
e2e/), the CI workflow (.forgejo/workflows/e2e.yml), the CI compose file (compose.e2e.yml), the Stripe test-mode wiring, and the Infisical secret provisioning land in follow-up PRs. This piece is fully self-contained and verifiable withjust check-container; the later pieces depend on external infra (Infisical vault, Stripe test keys, a CI runner with Node + Playwright) and a running stack.What this adds
bunyip-api/src/bin/bunyip_e2e_bootstrap.rsplus a second[[bin]]targetbunyip-e2e-bootstrap. Standalone tool (not a server subcommand) that reuses the bunyip-api lib for config / repositories / services.e2e-user@a8n.run(subscriber) ande2e-admin@a8n.run(admin) viaINSERT ... ON CONFLICT (email) DO UPDATE. Idempotent: a re-run resets password/role/email_verifiedand revives a cleaned-up row, so CI re-runs are no-ops in effect. Rows are seededemail_verified = TRUEso the suite signs in without the verification gate.BUNYIP_E2E_TEST_USER_PASSWORD(CI maps Infisical/bunyip/e2e/test_user_passwordto it; the_FILEsecret convention is honoured). No plaintext in any fixture.--cleanuphard-deletes the rows by exact email;--dry-runpreviews without writing and composes with--cleanup;--helpdocuments usage.just e2e-bootstrap *argsrecipe, running the binary inside the api container against the dev DB (mirrorsjust migrate).Safety
Refuses to run unless BOTH
BUNYIP_E2E_BOOTSTRAP_ALLOW=trueAND a non-productionENVIRONMENT.ConfigdefaultsENVIRONMENTtoproductionwhen unset, so unset is treated as production and blocked;productionandprodare blocked explicitly. Both checks sit inenforce_guardsso a single missing guard cannot let it through.Test
just check-containergreen (fmt + clippy-D warningsover--all-targets, which compiles the new bin, + workspace lib tests). Targetedcargo clippy -p bunyip-api --bin bunyip-e2e-bootstrap -- -D warningsalso clean. Not exercised against a live DB in this PR (no dev stack in CI yet); that happens oncecompose.e2e.yml+ the workflow land.Follow-ups (remaining BUNYIP-52 ACs)
e2e/Playwright scaffold + first-cut specs (auth, account, memberships, billing, oidc).compose.e2e.yml+.forgejo/workflows/e2e.yml(+ email sink for the email-driven specs)./bunyip/e2e/(test_user_password) and/bunyip/e2e/stripe/provisioning.just e2erunner recipe.#BUNYIP-52