mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-26 00:05:10 -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:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: kyoo
|
POSTGRES_USER: kyoo
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: kyoo_test
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd pg_isready
|
--health-cmd pg_isready
|
||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
|
|||||||
@ -112,6 +112,7 @@ const postgresConfig = await parseSslConfig();
|
|||||||
// use this when using drizzle-kit since it can't parse await statements
|
// use this when using drizzle-kit since it can't parse await statements
|
||||||
// const postgresConfig = config;
|
// const postgresConfig = config;
|
||||||
|
|
||||||
|
console.log("Connecting to postgres with config", postgresConfig);
|
||||||
export const db = drizzle({
|
export const db = drizzle({
|
||||||
schema,
|
schema,
|
||||||
connection: postgresConfig,
|
connection: postgresConfig,
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import { beforeAll } from "bun:test";
|
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_SECRET = "this is a secret";
|
||||||
process.env.JWT_ISSUER = "https://kyoo.zoriya.dev";
|
process.env.JWT_ISSUER = "https://kyoo.zoriya.dev";
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
// lazy load this so env set before actually applies
|
||||||
|
const { migrate } = await import("~/db");
|
||||||
await migrate();
|
await migrate();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user