Commit c012fdc
committed
fix(tests): self-install eql_v3 in property suites so CI shards pass (CIP-3141)
The fixture/e2e property oracles connect via connect_pool() to the base
DATABASE_URL database, not through #[sqlx::test]'s migrated per-test scratch
DBs. Under the sharded build-once-archive CI, a shard's base DB is a stock
Postgres with no EQL installed (only build-archive ran `sqlx migrate run`,
against a different Postgres), so every `::eql_v3.<T>_eq` cast raised
`schema "eql_v3" does not exist`. The old per-version CI happened to install
EQL into the base DB via test:sqlx:prep's migrate step, which the suites
silently relied on; the rebase onto the new CI removed that, turning the
suites red. (The failures looked type-specific — int2/int8/text/date/
timestamptz — but that was just nextest fail-fast + shard distribution; the
error is type-agnostic, int4 included.)
Make the suites self-sufficient: ensure_eql_installed() applies the embedded
001_install_eql.sql installer to the connected DB on first use, guarded by a
once-per-process async mutex and an `eql_v3.int4_eq` presence check (so a
developer's pre-installed local DB is left untouched — the installer is not
idempotent). The installer is include_str!'d in the test target (mod.rs), the
same archive-travel mechanism the fixture corpus uses, kept out of the lib so
clippy/test:crates contexts don't need the generated file.
Also stop swallowing the real Postgres error: the proptest runners rendered
anyhow errors with {e}/to_string(), dropping the cause chain and leaving only
the "pair query: SELECT …" context line — which is what made this opaque in
CI. Render with {e:#} to keep the full chain.
Verified: against a fresh DB with no eql_v3, all 11 fixture_oracle tests
(including the ones that failed in CI) now pass and the surface is installed
on demand; against an already-installed DB the presence check skips the install.1 parent 07dd0f6 commit c012fdc
4 files changed
Lines changed: 78 additions & 5 deletions
File tree
- tests/sqlx
- src
- tests/encrypted_domain/property
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
25 | 71 | | |
26 | 72 | | |
27 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
103 | | - | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
7 | 20 | | |
8 | 21 | | |
9 | 22 | | |
| |||
0 commit comments