diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08db0c2b..71bc9c63 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ test: - postgres:16 variables: DITTO_NSEC: nsec1zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs4rm7hz - TEST_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres + DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres POSTGRES_HOST_AUTH_METHOD: trust artifacts: when: always diff --git a/src/config.ts b/src/config.ts index 9860b394..cd8e2a4c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -70,10 +70,6 @@ class Conf { static get databaseUrl(): string { return Deno.env.get('DATABASE_URL') ?? 'file://data/pgdata'; } - /** Database to use in tests. */ - static get testDatabaseUrl(): string { - return Deno.env.get('TEST_DATABASE_URL') ?? 'memory://'; - } /** PGlite debug level. 0 disables logging. */ static get pgliteDebug(): 0 | 1 | 2 | 3 | 4 | 5 { return Number(Deno.env.get('PGLITE_DEBUG') || 0) as 0 | 1 | 2 | 3 | 4 | 5; diff --git a/src/test.ts b/src/test.ts index 121b32cc..4e813f05 100644 --- a/src/test.ts +++ b/src/test.ts @@ -34,10 +34,9 @@ export function genEvent(t: Partial = {}, sk: Uint8Array = generateS return purifyEvent(event); } -/** Create a database for testing. It uses `TEST_DATABASE_URL`, or creates an in-memory database by default. */ +/** Create a database for testing. It uses `DATABASE_URL`, or creates an in-memory database by default. */ export async function createTestDB(opts?: { pure?: boolean }) { - const { testDatabaseUrl } = Conf; - const { kysely } = DittoDB.create(testDatabaseUrl, { poolSize: 1 }); + const { kysely } = DittoDB.create(Conf.databaseUrl, { poolSize: 1 }); await DittoDB.migrate(kysely);