Skip to content

Run the faucet ledger and handler tests against Postgres in CI #835

Open

Description

@fraseragain

Priority: medium. Follow-up to #818 / #819 and #828.

Problem

The most valuable faucet tests (handler behaviour, concurrency, migrations and schema drift) need a real Postgres, so they are skipped unless FAUCET_TEST_DATABASE_URL is set and are not wired into CI. Tests that nobody runs tend to rot, and the concurrency guarantees (advisory lock, address cap, minimum interval) are exactly what they protect.

Proposal

  • Add a Postgres service container to the Studio build workflow, set FAUCET_TEST_DATABASE_URL, and run both suites on Node 20: the ledger tests (jest) and the handler tests (node --test, see the README).
  • Alternatively, once the faucet logic is extracted behind injected dependencies (see the FaucetService issue), run most of it as plain unit tests and keep only the ledger tests on Postgres.

Notes

CI configuration was deliberately left unchanged in #830; this issue is the explicit go-ahead to revisit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions