test(api): stop tests leaking module mocks and env into later files #14

Merged
Zakaria merged 1 commits from fix/ci-test-isolation into main 2026-10-24 15:36:53 +00:00
Owner

CI failed on a different set of tests each run because bun runs every test
file in one process and the file order differs between machines:

  • the secretsmanager route test replaced the whole ../aws module, so files
    loaded after it lost awsClients, lambda and defaultAccountId (API Gateway,
    SES)
  • the Lightsail tests restored FLOCI_ENDPOINT by assigning undefined, which
    stores the string "undefined" (runtime diagnostics)
  • the auth tests used full-strength argon2 for ~30 sign-ins and timed out on
    slower runners; the OIDC cleanup test cached a discovery document without
    userinfo_endpoint for the shared issuer

Checked with 20 runs under bun test --randomize.

CI failed on a different set of tests each run because bun runs every test file in one process and the file order differs between machines: - the secretsmanager route test replaced the whole ../aws module, so files loaded after it lost awsClients, lambda and defaultAccountId (API Gateway, SES) - the Lightsail tests restored FLOCI_ENDPOINT by assigning undefined, which stores the string "undefined" (runtime diagnostics) - the auth tests used full-strength argon2 for ~30 sign-ins and timed out on slower runners; the OIDC cleanup test cached a discovery document without userinfo_endpoint for the shared issuer Checked with 20 runs under bun test --randomize.
Zakaria added 1 commit 2026-10-24 15:36:49 +00:00
CI failed on a different set of tests each run because bun runs every test
file in one process and the file order differs between machines:

- the secretsmanager route test replaced the whole ../aws module, so files
  loaded after it lost awsClients, lambda and defaultAccountId (API Gateway,
  SES)
- the Lightsail tests restored FLOCI_ENDPOINT by assigning undefined, which
  stores the string "undefined" (runtime diagnostics)
- the auth tests used full-strength argon2 for ~30 sign-ins and timed out on
  slower runners; the OIDC cleanup test cached a discovery document without
  userinfo_endpoint for the shared issuer

Checked with 20 runs under bun test --randomize.
Zakaria merged commit ac58bfc98b into main 2026-10-24 15:36:53 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Zakaria/floci-ui#14