OXYGENHUB

Flow: the hub's tests on PostgreSQL too, in the new build image fe0bb950a300

A test-postgres job starts a PostgreSQL server of its own on loopback inside
its guest (.flow/test-postgres.sh) and runs the hub's tests built with the
postgres feature against it, beside the SQLite tests (#211). Both rust
sandboxes move to build image 57aa0b34, which adds Debian's PostgreSQL and
nss_wrapper (oxygenflow f6fa380e) and vendors the crates of today's
Cargo.lock; it is imported on earth-1 and copied to plex-1.

Refs #211
Author
Andy McCall @andymccall <[email protected]>
via
agent Claude Code <[email protected]> · delegate for changes, until 2026-11-13 19:00Z · key ea5f78160088
When
· 2026-10-16 14:49 UTC
Signature
✔ signed by Claude Code
Hash
fe0bb950a3001d359baa188807240b044fd3f15b6888fd563108bfe216fa588e
Depends on
380996db84e5 d8b86dc23809
Depended on by
40a43921ef42 e8534c304744 df68c58de947
In bookmarks
api-unknown-fields cancel-landed-runs diffusion-pin-bookmark draft-ready main oh-comment-body-file proposal-list-fast
In tags
v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
Edits
5 atoms, 1 tree operation, 2 files

Browse the tree at this change

added .flow/test-postgres.sh +22 −0
1 +
#!/bin/sh
2 +
# The hub's tests on PostgreSQL (oxygenhub#211, docs/postgres.md): a server
3 +
# of the job's own on loopback, thrown away with the guest. The build image
4 +
# has Debian's server and nss_wrapper, which gives the job's user (the
5 +
# runner's builder, unknown to the image) the name initdb looks up.
6 +
set -eu
7 +
pg=/tmp/pg
8 +
if ! getent passwd "$(id -u)" >/dev/null; then
9 +
    printf 'flow:x:%s:%s:flow:/tmp:/bin/sh\n' "$(id -u)" "$(id -g)" >/tmp/passwd
10 +
    printf 'flow:x:%s:\n' "$(id -g)" >/tmp/group
11 +
    wrapper=$(find /usr/lib -name libnss_wrapper.so | head -1)
12 +
    export LD_PRELOAD="$wrapper" NSS_WRAPPER_PASSWD=/tmp/passwd NSS_WRAPPER_GROUP=/tmp/group
13 +
fi
14 +
initdb -D "$pg" -U hub --auth=trust >/tmp/initdb.log || { cat /tmp/initdb.log >&2; exit 1; }
15 +
# Thrown away with the guest: no need to survive a crash.
16 +
pg_ctl -D "$pg" -l /tmp/postgres.log -w start \
17 +
    -o "-c listen_addresses=127.0.0.1 -p 55432 -k /tmp -c fsync=off -c synchronous_commit=off -c full_page_writes=off" \
18 +
    >/dev/null || { cat /tmp/postgres.log >&2; exit 1; }
19 +
unset LD_PRELOAD NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP
20 +
echo "flow: $(postgres --version) on 127.0.0.1:55432"
21 +
export OXYHUB_DATABASE_URL=postgres://[email protected]:55432/postgres OXYHUB_DATABASE_SCHEMA='*'
22 +
exec sh .flow/warm-target.sh cargo test -p oxygenhub --features postgres --locked
modified .flow/pipeline.kdl +17 −2
…
10 unchanged lines
11 11
// Cargo.lock changes; until then only the changed crates are compiled.
12 12
sandbox "rust" {
13 13
    runtime "microvm"
14 -
    rootfs "cas://blob/3fa57d4c1dc8aa5d4d92665bc13f332357f55042f658543dc21b1540b3aced69"
14 +
    rootfs "cas://blob/57aa0b34c0cadd541cfe90ac2711200be46879ac9968778e3a3417eca04357e3"
15 15
    memory-limit "8GiB"
16 16
    cpu-limit 4
17 17
    // Tests serve and connect on 127.0.0.1; nothing leaves the guest.
…
2 unchanged lines
20 20
21 21
sandbox "rust-small" {
22 22
    runtime "microvm"
23 -
    rootfs "cas://blob/3fa57d4c1dc8aa5d4d92665bc13f332357f55042f658543dc21b1540b3aced69"
23 +
    rootfs "cas://blob/57aa0b34c0cadd541cfe90ac2711200be46879ac9968778e3a3417eca04357e3"
24 24
    memory-limit "1GiB"
25 25
    cpu-limit 1
26 26
    network "isolated"
…
34 unchanged lines
61 61
<<<<<<< oxy conflict 2 of 2, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
62 62
    env {
63 63
        CARGO_INCREMENTAL "0"
64 +
// The hub's tests again on PostgreSQL (#211, docs/postgres.md), against a
65 +
// server the job starts in its own guest.
66 +
job "test-postgres" {
67 +
    sandbox "rust"
68 +
    depends-on "fmt"
69 +
    mount {
70 +
        source "ephemeral://disk"
71 +
        target "/src/target"
72 +
        size "24GiB"
73 +
        cache "target"
74 +
        key "Cargo.lock"
75 +
    }
76 +
    exec "sh" ".flow/test-postgres.sh"
77 +
}
78 +
64 79
    }
65 80
======= oxy conflict 2 of 2, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
66 81
    exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked"
…
70 unchanged lines