You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0d547e
Browse filesBrowse the repository at this point in the historyBrowse files
on-dev: app/'s database tests run on any build box, with throwaway Postgres and RustFS in Docker (#154)
* on-dev: a database run on a build box without the test database starts 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.
* AGENTS.md: app/'s tests run on any build box
* on-dev: only app/'s tests get throwaway containers; widen the URL rewrite, 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.
Copy file name to clipboardExpand all lines: frontend/content/docs/self-hosting/environment-variables.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,5 +216,6 @@ Never set these in production.
216
216
| --- | --- | --- | --- |
217
217
|`VISUALCI_NOW`| string || Stands in for the clock in credit allowances (RFC 3339), for screenshots of seeded data. |
218
218
|`VISUALCI_APP_TEST_DATABASE_URL`| string || The tests' Postgres (each test borrows a copy of it). Default: CI's, `postgres://visualci:visualci@127.0.0.1:55433/visualci_app_test`. |
219
+
|`VISUALCI_APP_TEST_S3_ENDPOINT`| string || The tests' blob store (RustFS or MinIO). Default: CI's, `http://127.0.0.1:59000`. |
219
220
|`VISUALCI_EMAIL_SNAPSHOTS`| string || A folder the email tests write each email's HTML to, for review. |
220
221
|`VISUALCI_GOLDEN_UPDATE`| string ||`1` makes the tests write their golden files (this page among them) instead of comparing. |
die "$cmd needs the test database, which is on $(printf '%s\n'"$db_line"| awk '{print $1}'), but this lease ($kind) builds on $host: take a ${db_kind:-docspring-dev} lease, or run it outside one"
die "$cmd needs the test database, which is on $db_host, but it would build on $host: take a ${db_kind:-docspring-dev} lease, or run it outside one (only app/'s tests, naming VISUALCI_APP_TEST_DATABASE_URL, get their own)"
71
78
fi
72
79
73
80
sync() {
@@ -99,6 +106,42 @@ run() {
99
106
return"$status"
100
107
}
101
108
109
+
# A database run on a host without the test database: its own Postgres and RustFS (CI's images and credentials), named
110
+
# for this run so parallel runs on one box don't meet, on ports Docker picks, removed when this script exits.
0 commit comments