(ctx context.Context, pool *pgxpool.Pool)
| 103 | } |
| 104 | |
| 105 | func truncateAll(ctx context.Context, pool *pgxpool.Pool) error { |
| 106 | _, err := pool.Exec(ctx, ` |
| 107 | TRUNCATE oauth_pkce_requests, oauth_refresh_tokens, oauth_access_tokens, |
| 108 | oauth_auth_codes, oauth_clients, |
| 109 | usage_summaries, usage_events, webhook_deliveries, |
| 110 | send_attempts, protection_events, messages, |
| 111 | idempotency_keys, api_keys, |
| 112 | agent_identities, domains, |
| 113 | user_sessions, users CASCADE |
| 114 | `) |
| 115 | if err != nil { |
| 116 | return err |
| 117 | } |
| 118 | // Re-seed shared domain (migration seeds it but truncation removes it) |
| 119 | pool.Exec(ctx, `INSERT INTO domains (domain, user_id, verified, verified_at) VALUES ('agents.e2a.dev', NULL, true, now()) ON CONFLICT DO NOTHING`) |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | func projectRoot() string { |
| 124 | _, filename, _, _ := runtime.Caller(0) |
no test coverage detected