fix(integration-tests): cast UUID columns to text for LIKE cleanup
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Python Lint & Test (pull_request) Successful in 6s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
Harness Replays / detect-changes (pull_request) Successful in 5s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 2s
E2E API Smoke Test / detect-changes (pull_request) Successful in 12s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 9s
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / Harness Replays (pull_request) Successful in 1s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 12s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 5s
security-review / approved (pull_request_target) Failing after 6s
sop-tier-check / tier-check (pull_request_target) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 14s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 1s
gate-check-v3 / gate-check (pull_request_target) Failing after 13s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 13s
E2E Chat / detect-changes (pull_request) Successful in 19s
CI / Detect changes (pull_request) Successful in 20s
qa-review / approved (pull_request_target) Failing after 14s
CI / Canvas (Next.js) (pull_request) Successful in 3s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 3s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 54s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 1m7s
CI / Platform (Go) (pull_request) Successful in 3m55s
CI / all-required (pull_request) Successful in 2s

core-devops REQUEST_CHANGES on PR #2171: Handlers Postgres Integration
red with `pq: operator does not exist: uuid ~~ unknown`. Root cause:
the wipe/cleanup statements use `LIKE 'integ-xxx-%'` against UUID
columns (workspaces.id, workspace_schedules.workspace_id,
activity_logs.workspace_id, workspace_auth_tokens.workspace_id), but
`LIKE` compiles to `~~` and Postgres won't apply it to a uuid operand.
Fix: explicit `::text` cast on every cleanup site (16 across 4 files).

Verify-on-main (per CEO ruling DECIDING TEST): the failing
admin_schedules_health_integration_test.go is 1 line on main and
schedules_integration_test.go doesn't exist on main, so the failure is
intrinsic to PR #2171. Scope IN of #8400.

Files:
- admin_schedules_health_integration_test.go (4 sites)
- budget_integration_test.go (2 sites)
- schedules_integration_test.go (6 sites)
- tokens_integration_test.go (4 sites)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Molecule AI Dev Engineer B (MiniMax)
2026-06-03 23:42:24 +00:00
parent 1524f36f9e
commit f410b8e159
4 changed files with 16 additions and 16 deletions
@@ -57,18 +57,18 @@ func integrationDB_AdminSchedulesHealth(t *testing.T) *sql.DB {
t.Fatalf("ping: %v", err)
}
if _, err := conn.ExecContext(context.Background(),
`DELETE FROM workspace_schedules WHERE workspace_id LIKE 'integ-ash-%'`); err != nil {
`DELETE FROM workspace_schedules WHERE workspace_id ::text LIKE 'integ-ash-%'`); err != nil {
t.Fatalf("cleanup schedules: %v", err)
}
if _, err := conn.ExecContext(context.Background(),
`DELETE FROM workspaces WHERE id LIKE 'integ-ash-%'`); err != nil {
`DELETE FROM workspaces WHERE id ::text LIKE 'integ-ash-%'`); err != nil {
t.Fatalf("cleanup workspaces: %v", err)
}
prev := db.DB
db.DB = conn
t.Cleanup(func() {
conn.ExecContext(context.Background(), `DELETE FROM workspace_schedules WHERE workspace_id LIKE 'integ-ash-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id LIKE 'integ-ash-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspace_schedules WHERE workspace_id ::text LIKE 'integ-ash-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id ::text LIKE 'integ-ash-%'`)
db.DB = prev
conn.Close()
})
@@ -63,13 +63,13 @@ func integrationDB_Budget(t *testing.T) *sql.DB {
t.Fatalf("ping: %v", err)
}
if _, err := conn.ExecContext(context.Background(),
`DELETE FROM workspaces WHERE id LIKE 'integ-bud-%'`); err != nil {
`DELETE FROM workspaces WHERE id ::text LIKE 'integ-bud-%'`); err != nil {
t.Fatalf("cleanup: %v", err)
}
prev := db.DB
db.DB = conn
t.Cleanup(func() {
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id LIKE 'integ-bud-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id ::text LIKE 'integ-bud-%'`)
db.DB = prev
conn.Close()
})
@@ -62,9 +62,9 @@ func integrationDB_Schedules(t *testing.T) *sql.DB {
// Wipe in FK order: activity_logs first (references workspaces), then
// workspace_schedules (references workspaces), then workspaces.
for _, stmt := range []string{
`DELETE FROM activity_logs WHERE workspace_id LIKE 'integ-sch-%'`,
`DELETE FROM workspace_schedules WHERE workspace_id LIKE 'integ-sch-%'`,
`DELETE FROM workspaces WHERE id LIKE 'integ-sch-%'`,
`DELETE FROM activity_logs WHERE workspace_id ::text LIKE 'integ-sch-%'`,
`DELETE FROM workspace_schedules WHERE workspace_id ::text LIKE 'integ-sch-%'`,
`DELETE FROM workspaces WHERE id ::text LIKE 'integ-sch-%'`,
} {
if _, err := conn.ExecContext(context.Background(), stmt); err != nil {
t.Fatalf("cleanup %q: %v", stmt, err)
@@ -73,9 +73,9 @@ func integrationDB_Schedules(t *testing.T) *sql.DB {
prev := db.DB
db.DB = conn
t.Cleanup(func() {
conn.ExecContext(context.Background(), `DELETE FROM activity_logs WHERE workspace_id LIKE 'integ-sch-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspace_schedules WHERE workspace_id LIKE 'integ-sch-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id LIKE 'integ-sch-%'`)
conn.ExecContext(context.Background(), `DELETE FROM activity_logs WHERE workspace_id ::text LIKE 'integ-sch-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspace_schedules WHERE workspace_id ::text LIKE 'integ-sch-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id ::text LIKE 'integ-sch-%'`)
db.DB = prev
conn.Close()
})
@@ -60,18 +60,18 @@ func integrationDB_Tokens(t *testing.T) *sql.DB {
t.Fatalf("ping: %v", err)
}
if _, err := conn.ExecContext(context.Background(),
`DELETE FROM workspace_auth_tokens WHERE workspace_id LIKE 'integ-tok-%'`); err != nil {
`DELETE FROM workspace_auth_tokens WHERE workspace_id ::text LIKE 'integ-tok-%'`); err != nil {
t.Fatalf("cleanup tokens: %v", err)
}
if _, err := conn.ExecContext(context.Background(),
`DELETE FROM workspaces WHERE id LIKE 'integ-tok-%'`); err != nil {
`DELETE FROM workspaces WHERE id ::text LIKE 'integ-tok-%'`); err != nil {
t.Fatalf("cleanup workspaces: %v", err)
}
prev := db.DB
db.DB = conn
t.Cleanup(func() {
conn.ExecContext(context.Background(), `DELETE FROM workspace_auth_tokens WHERE workspace_id LIKE 'integ-tok-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id LIKE 'integ-tok-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspace_auth_tokens WHERE workspace_id ::text LIKE 'integ-tok-%'`)
conn.ExecContext(context.Background(), `DELETE FROM workspaces WHERE id ::text LIKE 'integ-tok-%'`)
db.DB = prev
conn.Close()
})