test: postgres harness no longer provisions at the live stage Prüfwerk #108
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user