ReviewOS

also looking at this

stacks/bun-query-builder

test(pg): make the Postgres-gated tests actually run in CI

#1077
Merged glennmichael123 wants to merge test/pg-gated-tests-in-ci into main
4 files +68 -35
packages/bun-query-builder/test/migrate-atomicity.test.tsmodified+4-12
Changes to packages/bun-query-builder/test/migrate-atomicity.test.ts
@@ -24,20 +24,12 @@ import { join, resolve } from 'node:path'
2424import process from 'node:process'
2525import { SQL } from 'bun'
2626import { describe, expect, it } from 'bun:test'
27import { PG_URL, probePostgres } from './pg'
28
29const pgAvailable = await probePostgres()
2730
2831const SRC = resolve(import.meta.dir, '../src/index.ts')
29const PG_URL = `postgres://${process.env.USER}@localhost:5432/postgres`
30
31let pgAvailable = false
32try {
33 const probe = new SQL(PG_URL)
34 await probe.unsafe('SELECT 1')
35 await probe.end()
36 pgAvailable = true
37}
38catch {
39 pgAvailable = false
40}
32
4133
4234/** A throwaway workspace with a migrations directory. */
4335function workspace(files: Record<string, string>): string {