Close audit test leftovers inside each test (deploy build Bun 1.3 rejects hook timeouts) (#88) #40

Merged
backmeupplz merged 1 commit from fix/88-bun13-hook-compat into main 2026-10-12 18:32:43 +00:00
backmeupplz commented 2026-10-12 18:27:30 +00:00 (Migrated from github.com)

Follow-up to #39 (ticket: https://agentboard.icefish-betta.ts.net/#88).

Problem: the Easypanel deploy of 9cefa2d failed. The deploy build runs Nixpacks, which ships Bun 1.3.0, and executes bun run check. CI runs Bun 1.4.0. Bun 1.3 rejects any timeout argument on a hook: both beforeEach(fn, 60_000) and beforeEach(fn, { timeout }) throw beforeEach() expects a function as the second argument when the module loads. That broke the build even though the integration tests themselves are skipped there. Production is still running the previous build, db8576c.

Fix: the leftover cleanup now runs at the start of each integration test, inside the integration wrapper and within that test's 60s budget, instead of in a beforeEach hook with a timeout. The behavior #39 reviewed is unchanged: whatever a timed-out test leaves behind is closed before the next test's fixture truncates the tables. All 24 tests in the file go through integration. Docs updated.

Verification:

  • With Bun 1.4.0 and both test DBs, bun run check gives 528 pass, 0 fail.
  • With Bun 1.3.0 and no DB env (as in the deploy build), the module loads and there's no beforeEach error. One local-only failure remains, telegram-preview.tls. It is caused by this host's proxy/CA environment and passed in the actual deploy build.
  • With Bun 1.3.0 and the audit DB, src/audit-outbox.integration.test.ts runs 24/24.
Follow-up to #39 (ticket: https://agentboard.icefish-betta.ts.net/#88). **Problem:** the Easypanel deploy of 9cefa2d failed. The deploy build runs Nixpacks, which ships **Bun 1.3.0**, and executes `bun run check`. CI runs Bun 1.4.0. Bun 1.3 rejects any timeout argument on a hook: both `beforeEach(fn, 60_000)` and `beforeEach(fn, { timeout })` throw `beforeEach() expects a function as the second argument` when the module loads. That broke the build even though the integration tests themselves are skipped there. Production is still running the previous build, db8576c. **Fix:** the leftover cleanup now runs at the start of each integration test, inside the `integration` wrapper and within that test's 60s budget, instead of in a `beforeEach` hook with a timeout. The behavior #39 reviewed is unchanged: whatever a timed-out test leaves behind is closed before the next test's fixture truncates the tables. All 24 tests in the file go through `integration`. Docs updated. **Verification:** - With Bun 1.4.0 and both test DBs, `bun run check` gives 528 pass, 0 fail. - With Bun 1.3.0 and no DB env (as in the deploy build), the module loads and there's no `beforeEach` error. One local-only failure remains, `telegram-preview.tls`. It is caused by this host's proxy/CA environment and passed in the actual deploy build. - With Bun 1.3.0 and the audit DB, `src/audit-outbox.integration.test.ts` runs 24/24.
Sign in to join this conversation.
No description provided.