mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-25 07:45:08 -05:00
Force tests to run on kyoo_test database
This commit is contained in:
parent
7ebc0fe504
commit
20ab1dae6c
3
.github/workflows/api-test.yml
vendored
3
.github/workflows/api-test.yml
vendored
@ -15,10 +15,11 @@ jobs:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- "5432:5432"
|
||||
env:
|
||||
POSTGRES_USER: kyoo
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: kyoo_test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
|
||||
@ -112,6 +112,7 @@ const postgresConfig = await parseSslConfig();
|
||||
// use this when using drizzle-kit since it can't parse await statements
|
||||
// const postgresConfig = config;
|
||||
|
||||
console.log("Connecting to postgres with config", postgresConfig);
|
||||
export const db = drizzle({
|
||||
schema,
|
||||
connection: postgresConfig,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import { beforeAll } from "bun:test";
|
||||
import { migrate } from "~/db";
|
||||
|
||||
process.env.PGDATABASE = "kyoo_test";
|
||||
process.env.JWT_SECRET = "this is a secret";
|
||||
process.env.JWT_ISSUER = "https://kyoo.zoriya.dev";
|
||||
|
||||
beforeAll(async () => {
|
||||
// lazy load this so env set before actually applies
|
||||
const { migrate } = await import("~/db");
|
||||
await migrate();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user