test: postgres harness no longer provisions at the live stage Prüfwerk #108

Merged
sharang merged 1 commits from fix/tests-no-stage-calls into main 2026-10-30 07:58:35 +00:00
+8
View File
@@ -116,6 +116,14 @@ func newPostgresHarness(t *testing.T) *testHarness {
if err := m.Up(); err != nil && err.Error() != "no change" {
t.Fatalf("migrate: %v", err)
}
// The migrations seed the real product URLs (0005: Prüfwerk's stage
// provision endpoint), and a test config's env "dev" reads as "stage":
// without this, every test that provisions a tenant called the live
// pruefwerk-stage with the mock's non-JWT token (401s in its log). The
// memory store has no provision URLs either; tests that need one set it.
if _, err := db.ExecContext(ctx, `UPDATE products SET provision_urls = '{}'`); err != nil {
t.Fatalf("clear provision URLs: %v", err)
}
_, _ = m.Close()
_ = db.Close()