()
| 230 | } |
| 231 | |
| 232 | async function truncateTables() { |
| 233 | console.log('Truncating tables and cleaning up benchmark users...'); |
| 234 | await db.execute(sql`TRUNCATE TABLE microdollar_usage_metadata CASCADE`); |
| 235 | await db.execute(sql`TRUNCATE TABLE microdollar_usage CASCADE`); |
| 236 | await db.execute(sql`TRUNCATE TABLE http_user_agent CASCADE`); |
| 237 | await db.execute(sql`TRUNCATE TABLE http_ip CASCADE`); |
| 238 | await db.execute(sql`TRUNCATE TABLE vercel_ip_country CASCADE`); |
| 239 | await db.execute(sql`TRUNCATE TABLE vercel_ip_city CASCADE`); |
| 240 | await db.execute(sql`TRUNCATE TABLE ja4_digest CASCADE`); |
| 241 | await db.execute(sql`TRUNCATE TABLE system_prompt_prefix CASCADE`); |
| 242 | await db.execute( |
| 243 | sql`DELETE FROM kilocode_users WHERE google_user_email LIKE 'benchmark-%@test.local'` |
| 244 | ); |
| 245 | console.log('Tables truncated and benchmark users deleted.'); |
| 246 | } |
| 247 | |
| 248 | async function createTestUser(): Promise<string> { |
| 249 | const userId = randomUUID(); |
no test coverage detected