Skip to content

test: the PostgreSQL path only ever runs in CI #127

Description

@L4XB

Problem

Running the API suite locally ends with:

SKIPPED [1] tests/test_postgres_runtime.py:27: requires the dedicated CI PostgreSQL service
2901 passed, 1 skipped

Every contributor's local run skips it. The deployment runs PostgreSQL; the
local suite runs SQLite. So the one test that exercises the database the product
actually uses is the one nobody sees fail until CI does — usually after a push,
on someone else's branch.

What to do

Give contributors a way to run it without hand-assembling a database. A
make test-pg (or a documented docker compose run) that starts a throwaway
PostgreSQL, runs that file against it, and removes the container afterwards.

Two things it must not do:

  • Leave a container or volume behind on failure
  • Require the full self-hosting stack — this is one database for one test file,
    not a deployment

Skipping must still work when Docker is unavailable. A contributor without it
should get the same skip they get today, not an error.

Where

  • services/api/tests/test_postgres_runtime.py — the skip condition at line 27
  • Makefile
  • CONTRIBUTING.md — the API section under "Local setup and checks"

Acceptance criteria

  • One command runs the PostgreSQL test from a clean checkout
  • Nothing is left running or stored afterwards, including after a failure
  • Without Docker, the test still skips rather than erroring
  • CONTRIBUTING.md names the command

Activity

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

    area:apiPublic Python and serialization contractseffort:smallA few files, no system-wide knowledge neededgood first issueGood for newcomerstype:hardeningCorrectness, resilience, and adversarial-input hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions