Skip to content

on-dev: app/'s database tests run on any build box, with throwaway Postgres and RustFS in Docker - #154

Merged
ndbroadbent merged 3 commits into
mainfrom
on-dev-throwaway-db
Dec 4, 2026
Merged

ndbroadbent merged 3 commits into
mainfrom
on-dev-throwaway-db

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Lets app/'s database tests run on any build box, so they still run when docspring-dev is down or busy (4 Dec 2026: Fleetlayer marked it down, with pve low on memory).

What changes

  • scripts/on-dev run: a run of app/'s tests (one naming VISUALCI_APP_TEST_DATABASE_URL) on a host other than the first .dev-host line (a pool box, or ON_DEV_HOST set to one) starts postgres:17 and rustfs/rustfs:1.0.6 in Docker. They use CI's credentials, listen on 127.0.0.1 ports Docker picks, and are named vci-<checkout>-<pid>-<random>-{pg,s3}, so parallel runs on one box don't collide. The command's whole database URL (postgres:// or postgresql://, on 127.0.0.1, localhost or [::1] port 55433) is rewritten to point at the container, and VISUALCI_APP_TEST_DATABASE_URL and VISUALCI_APP_TEST_S3_ENDPOINT are set. A trap removes both containers on exit, Ctrl-C included. A container that stops at once or isn't ready within 60 s stops the run with a message. Each container carries a 6-hour expiry label, and a later run removes any that have expired, in case a script was killed with SIGKILL or its cleanup couldn't reach the box.
  • docspring-dev keeps its own Postgres, as before. Other database runs (the screenshots, journeys, a seeded dev server) still lease docspring-dev and build there, because they also need its MinIO and hosts. On a pool box they're refused with a message saying so.
  • app/'s tests read the blob store's address from the new VISUALCI_APP_TEST_S3_ENDPOINT (default CI's http://127.0.0.1:59000), the way they already read VISUALCI_APP_TEST_DATABASE_URL. Before this, with_envs pinned it to 59000. The golden files write the endpoint back as CI's address, so they don't change. The variable is listed in config.rs, .env.example and the environment variables page. CI doesn't set it, so CI is unchanged.
  • AGENTS.md: app/'s tests run on any build box.

Checked on agents-build-1

  • The whole cargo test -p visualci-app suite passed against the containers, blob tests (api_builds) and goldens included.
  • No vci-* containers were left after the runs.
  • Interrupted a run with SIGINT while its containers were up: they were removed. The remote command itself kept running after the local ssh died, as any interrupted on-dev run already does, and it fails on its own once its database is gone.
  • scripts/on-dev fmt and clippy -p visualci-app pass. Shellcheck shows only info-level notes, the same kinds the script already had.

Independent review: no blocking bugs. It raised four issues, all fixed in the last commit: other database runs landing on pool boxes, URL forms the rewrite missed, readiness timeouts that failed silently, and containers left behind when cleanup can't reach the box. Rechecked on agents-build-1: app tests with a postgresql://localhost URL ran against the containers; a container past its expiry was removed; a non-app database run on the pool was refused.

…s its own Postgres and RustFS in Docker, and removes them when it ends

On a pool host (or any host but the first .dev-host line), a run that names DATABASE_URL or 55433 starts postgres:17
and rustfs/rustfs:1.0.6 with CI's credentials, on ports Docker picks and named per run. It points the command's
database URL and VISUALCI_APP_TEST_S3_ENDPOINT at them. A trap removes them on exit, Ctrl-C included. docspring-dev
keeps its own Postgres, and database runs are no longer refused inside a pool lease.

app/'s tests read the blob store from VISUALCI_APP_TEST_S3_ENDPOINT (default CI's 127.0.0.1:59000). The golden
files write it back as CI's address.
…rite, fail clearly when a container isn't ready, and remove earlier runs' expired containers

From the review: other database runs (the screenshots, journeys, a seeded dev server) need docspring-dev's MinIO and
hosts as well, so they still lease and build there. The rewrite takes postgresql://, localhost and [::1], and the
whole URL. A container that stops or isn't ready in 60 s stops the run with a message. Each container carries a
6-hour expiry label, and a later run removes any past it.
@visualci-com

visualci-com Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #284 · 361 unchanged · no changes

This PR vs base: 16 changed, 20 added since #246, across 2 builds

docspring/visualci · journeys · build #281 · 1 changed, 27 unchanged · approved by visualci features agent for Nathan Broadbent

The known 26-pixel corner flake in 06-added (the same image approved on #159). #154 changes no UI; #160 fixes the flake.

This PR vs base: 2 changed, 13 added since #243, across 3 builds

Snapshot Before After
journeys/setup-picks-from-300-repositories/06-added (changed)

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent merged commit e0d547e into main Dec 4, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the on-dev-throwaway-db branch December 4, 2026 01:03
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.

1 participant