also looking at this
test(pg): make the Postgres-gated tests actually run in CI
#1077
4 files
+68
-35
| @@ -30,19 +30,11 @@ import { join, resolve } from 'node:path' | ||
| 30 | 30 | import process from 'node:process' |
| 31 | 31 | import { SQL } from 'bun' |
| 32 | 32 | import { describe, expect, it } from 'bun:test' |
| 33 | import { PG_URL, probePostgres } from './pg' | |
| 34 | ||
| 35 | const pgAvailable = await probePostgres() | |
| 33 | 36 | |
| 34 | const PG_URL = `postgres://${process.env.USER}@localhost:5432/postgres` | |
| 35 | 37 | |
| 36 | let pgAvailable = false | |
| 37 | try { | |
| 38 | const probe = new SQL(PG_URL) | |
| 39 | await probe.unsafe('SELECT 1') | |
| 40 | await probe.end() | |
| 41 | pgAvailable = true | |
| 42 | } | |
| 43 | catch { | |
| 44 | pgAvailable = false | |
| 45 | } | |
| 46 | 38 | |
| 47 | 39 | describe.skipIf(!pgAvailable)('builder-local connection routing', () => { |
| 48 | 40 | it('keeps transactional writes inside the transaction, and reads inside it current', () => { |