Repository navigation
on-dev: app/'s database tests run on any build box, with throwaway Postgres and RustFS in Docker - #154
Merged
Conversation
…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.
ndbroadbent
force-pushed
the
on-dev-throwaway-db
branch
from
December 4, 2026 00:42
cf3fb49 to
5273856
Compare
VisualCIdocspring/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
This PR vs base: 2 changed, 13 added since #243, across 3 builds
Updated as builds change. Agents can review with VisualCI's MCP tools. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 namingVISUALCI_APP_TEST_DATABASE_URL) on a host other than the first.dev-hostline (a pool box, orON_DEV_HOSTset to one) startspostgres:17andrustfs/rustfs:1.0.6in Docker. They use CI's credentials, listen on 127.0.0.1 ports Docker picks, and are namedvci-<checkout>-<pid>-<random>-{pg,s3}, so parallel runs on one box don't collide. The command's whole database URL (postgres://orpostgresql://, on127.0.0.1,localhostor[::1]port 55433) is rewritten to point at the container, andVISUALCI_APP_TEST_DATABASE_URLandVISUALCI_APP_TEST_S3_ENDPOINTare 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.VISUALCI_APP_TEST_S3_ENDPOINT(default CI'shttp://127.0.0.1:59000), the way they already readVISUALCI_APP_TEST_DATABASE_URL. Before this,with_envspinned 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.exampleand the environment variables page. CI doesn't set it, so CI is unchanged.Checked on agents-build-1
cargo test -p visualci-appsuite passed against the containers, blob tests (api_builds) and goldens included.vci-*containers were left after the runs.on-dev runalready does, and it fails on its own once its database is gone.scripts/on-dev fmtandclippy -p visualci-apppass. 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://localhostURL ran against the containers; a container past its expiry was removed; a non-app database run on the pool was refused.