From 2031e8a3e72c6c35fdfbe805b966b291467dc368 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 19 Oct 2024 14:03:10 -0400 Subject: [PATCH] Verify the problem is that the service hasn't started before tests execute --- .gitea/workflows/test.yaml | 2 ++ api/data/subscription.test.ts | 6 ++---- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 3d99d06..929999e 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -10,6 +10,8 @@ jobs: - uses: actions/checkout@v4 - name: Install docker uses: papodaca/install-docker-action@main + - name: Setup PG Data Dir + run: mkdir -p ./data-test - name: Run Tests env: NODE_OPTIONS=--max-old-space-size=8192 run: | diff --git a/api/data/subscription.test.ts b/api/data/subscription.test.ts index e1daa03..eba6be0 100644 --- a/api/data/subscription.test.ts +++ b/api/data/subscription.test.ts @@ -28,7 +28,7 @@ const pushSubscription2 = { } jest.mock("./settings", () => ({ - port: 5432, + port: 5434, user: "postgres", password: process.env.POSTGRES_PASSWORD, database: "test", @@ -53,9 +53,7 @@ describe("subscriptions", () => { beforeEach(async () => { try { - exec("docker compose -f docker-compose-test.yaml logs", (_, out) => - console.log(out) - ) + exec("docker ps", (_, out) => console.log(out)) await migrateToLatest() } catch (error) { console.log("Something has exploded in migration") diff --git a/package.json b/package.json index 8abe6fd..60c9130 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start": "remix-serve ./build/server/index.js", "typecheck": "tsc", "watch": "export $(cat .env.test | xargs) && docker compose -f docker-compose-test.yaml up database -d --remove-orphans && jest --watch --config=jest.config.ts", - "test": "export $(cat .env.test | xargs) && docker compose -f docker-compose-test.yaml up database -d --remove-orphans && jest --config=jest.config.ts" + "test": "export $(cat .env.test | xargs) && docker compose -f docker-compose-test.yaml up database -d --remove-orphans && sleep 5 && jest --config=jest.config.ts" }, "dependencies": { "@remix-pwa/sw": "^3.0.9",