Skip to content

Commit cf082fc

Browse files
committed
fix(internal): skip advisory lock integration tests in CI without database
1 parent 2402083 commit cf082fc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/internal/src/db/__tests__/advisory-lock.integration.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ const DEFAULT_TEST_DATABASE_URL =
5454
'postgresql://postgres:postgres@127.0.0.1:5432/testdb'
5555
const TEST_DATABASE_URL = process.env.DATABASE_URL || DEFAULT_TEST_DATABASE_URL
5656

57-
// Skip tests if DATABASE_URL is not configured (e.g., in unit test runs)
58-
const SKIP_INTEGRATION_TESTS = !process.env.DATABASE_URL && !process.env.RUN_INTEGRATION_TESTS
57+
// Skip tests if:
58+
// 1. Running in GitHub Actions CI (which doesn't have a real Postgres for packages/internal)
59+
// 2. DATABASE_URL is not configured locally and RUN_INTEGRATION_TESTS is not set
60+
// Note: CI injects DATABASE_URL as a secret, but there's no actual database running
61+
// for packages/internal integration tests (only packages/billing has Postgres in CI)
62+
const SKIP_INTEGRATION_TESTS =
63+
process.env.CODEBUFF_GITHUB_ACTIONS === 'true' ||
64+
(!process.env.DATABASE_URL && !process.env.RUN_INTEGRATION_TESTS)
5965

6066
// Create test database connection
6167
let testClient: ReturnType<typeof postgres> | null = null

0 commit comments

Comments
 (0)