test: the postgres harness no longer provisions at the live stage Prüfwerk
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 26m40s
ci / image (pull_request) Skipped

pruefwerk-agent-stage logged 'platform token rejected: failed to decode
JWT header' in bursts of five provisions and one targets read, each time
the registry's tests ran (CI and local). The migrations seed the real
provision URLs (0005: pruefwerk-stage), a test config's env 'dev' reads
as 'stage', so every postgres test that provisioned a tenant called the
live endpoint with the Keycloak mock's non-JWT token and got 401.

The postgres harness clears provision_urls after migrating, as the
memory store has none; tests that need one set it themselves. Checked:
a full local run with postgres left no request in Prüfwerk's traces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-30 08:30:49 +01:00
1 parent 43731da8f1
commit 1442355a52
1 file changed
+8
+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()