Skip to content

Commit 574a0a5

Browse files
committed
itest: boot piri on Postgres so the stack comes up
Every top-level itest — TestForgeVersity, TestForgeScenarios, TestForgeNativeProvision, TestForgeReadAfterEviction — failed at stack boot, not in any assertion: Error: initializing piri node: ... ProvideHarmonyDB ... curio PDP pipeline requires Postgres (set database type to postgres) Since piri:main absorbed Curio (~2026-07-24) its PDP pipeline refuses sqlite, and forgeStack booted sqlite piri via the zero-value PiriNodeConfig. All four suites route through that one constructor, so flipping the topology default to Postgres:true is the whole fix; the pinned smelt already supports it (no dependency bump). Also relax the CORS preflight status assertion from 200 to any 2xx, the fetch spec's 'ok status' range. versitygw answers a matched rule 200 and only its no-CORS-config fallback 204, and the Max-Age assertion is what actually pins the real path: the fallback sets no Max-Age and mirrors the requested method instead of the rule's method list. This supersedes the exact-200 assertion in 900d6b5. Both changes match what #44 arrived at independently, so the overlap resolves trivially whichever lands first. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rwJ8KiPhm3G27vfU21Phk
1 parent 900d6b5 commit 574a0a5

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

itest/scenarios_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,14 @@ func TestForgeScenarios(t *testing.T) {
290290
return resp
291291
}
292292

293-
// A matched preflight is answered 200, matching real S3 (browsers
294-
// accept any 2xx); 204 is only versitygw's no-CORS-config fallback.
293+
// Any 2xx is a successful preflight per the fetch spec; versitygw
294+
// answers a matched rule 200 and only its no-CORS-config fallback
295+
// 204. The Max-Age assertion below is what pins the real path — the
296+
// fallback sets no Max-Age and mirrors the requested method instead
297+
// of the rule's method list.
295298
resp := preflight(t, origin)
296-
if resp.StatusCode != http.StatusOK {
297-
t.Errorf("preflight status = %d, want 200", resp.StatusCode)
299+
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
300+
t.Errorf("preflight status = %d, want 2xx", resp.StatusCode)
298301
}
299302
if got := resp.Header.Get("Access-Control-Allow-Origin"); got != origin {
300303
t.Errorf("preflight Allow-Origin = %q, want the request origin echoed", got)

itest/stack_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ func forgeStack(t *testing.T, extra ...stack.Option) (*stack.Stack, string) {
104104
t.Helper()
105105
t.Logf("booting the smelt Forge stack (~1-2 min; first run also compiles ingot and pulls images)")
106106
opts := []stack.Option{
107-
stack.WithPiriNodes(stack.PiriNodeConfig{}),
107+
// Postgres-backed piri: piri:main's curio PDP pipeline refuses
108+
// sqlite ("curio PDP pipeline requires Postgres") as of 2026-07-24.
109+
stack.WithPiriNodes(stack.PiriNodeConfig{Postgres: true}),
108110
stack.WithServiceBinary("ingot", localIngotBinary(t)),
109111
}
110112
// Local-dev escape hatches: run against upload-service (sprue) / piri

0 commit comments

Comments
 (0)