Skip to content

CI runs every database test, and a missing database fails instead of skipping - #260

Merged
WaylandYang merged 2 commits into
devfrom
fix/ci-runs-the-database-tests
Sep 3, 2026
Merged

CI runs every database test, and a missing database fails instead of skipping#260
WaylandYang merged 2 commits into
devfrom
fix/ci-runs-the-database-tests

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Fixes #248.

cargo test --workspace in the backend job has no database, so every store integration test returned early and the job was green; the migrations job, which has a database, ran only graph_changes.

One guard, two modes. utopia_store::test_db::url() replaces the four-line env check in all 25 test files (34 guards). Without UTOPIA_DATABASE_URL it skips, as before, so a local cargo test still needs no database. With UTOPIA_TEST_REQUIRE_DB=1 as well, a missing database panics — the run must not skip.

CI: the migrations job now runs cargo test -p utopia-store with both variables and writes a one-line summary (passed / failed, and that skips fail the job) to the step summary. The backend job is unchanged. Verified locally: with the variable set and no URL the test fails at the guard; with the URL the whole suite passes.

CONTRIBUTING shows the new guard and asks new tests to use it. Two tests in flight (#257, #258) still carry the old four lines; they keep skipping quietly until they are switched over after merge.

🤖 Generated with Claude Code

@WaylandYang
WaylandYang merged commit 441d22c into dev Sep 3, 2026
3 checks passed
@WaylandYang
WaylandYang deleted the fix/ci-runs-the-database-tests branch September 3, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI skips most database-backed integration tests

1 participant