Task: Separate test database from application

Table of Contents

This page documents a task in the Test infrastructure story. It captures the goal, current status, acceptance, and any notes or results.

Goal

Stop tests from sharing the application's Postgres database. Each test run gets isolated state — no more deleting accounts or currencies out from under the running app, and no more tests trampling each other.

Status

Field Value
State DONE
Parent story Test infrastructure
Now Completed 2025-12-01.
Waiting on None.
Next None.
Last touched 2025-12-01

Acceptance

  • Tests target a separate database from the application.
  • Tests use a distinct env-var prefix (so the program-options binding doesn't trample the runtime config).
  • Existing import / export commands still work after the split.

Notes

  • Total time spent in v0: ~3:33.
  • Env-var collision was a real concern: the program-options binding picks up ORES_* from the environment, which was the same prefix the tests used. v0 settled on TEST_ORES_* (or similar) for the test path to keep them disjoint.
  • Carries a pre-existing boost::bad_any_cast on import (unrelated to this work) that v0 explicitly flagged as out of scope.
  • Recipes for client interaction were split into their own org-mode file as part of the cleanup.

Result

Tests run against an isolated database with no overlap into the application's state; env-var namespaces no longer collide.

Emacs 29.1 (Org mode 9.6.6)