-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into shanice/transition_ecs_infra
- Loading branch information
Showing
114 changed files
with
89,347 additions
and
121,355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
services: | ||
# PostgreSQL DB for custom query and value set storage | ||
db: | ||
image: "postgres:alpine" | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=pw | ||
- POSTGRES_DB=tefca_db | ||
|
||
volumes: | ||
- ./vs_dump.sql:/docker-entrypoint-initdb.d/vs_dump.sql | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 2s | ||
timeout: 5s | ||
retries: 20 | ||
|
||
# Flyway migrations and DB version control | ||
flyway: | ||
image: flyway/flyway:10.16-alpine | ||
command: -configFiles=/flyway/conf/flyway.conf -schemas=public -connectRetries=60 migrate | ||
platform: linux/amd64 | ||
volumes: | ||
- ./flyway/sql:/flyway/sql | ||
- ./flyway/conf/flyway.conf:/flyway/conf/flyway.conf | ||
depends_on: | ||
db: | ||
condition: service_started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e # Exit immediately if a command exits with a non-zero status | ||
|
||
docker compose -f docker-compose-integration.yaml up -d | ||
|
||
# wait for flyway to finish running before... | ||
docker compose -f docker-compose-integration.yaml logs -f flyway | grep -q "Successfully applied" | ||
|
||
# running our integration tests | ||
DATABASE_URL=postgresql://postgres:pw@localhost:5432/tefca_db TEST_TYPE=integration jest --testPathPattern=tests/integration | ||
JEST_EXIT_CODE=$? | ||
|
||
# Teardown containers | ||
docker compose -f docker-compose-integration.yaml down | ||
|
||
# Exit with the Jest exit code | ||
exit $JEST_EXIT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
import { getDbClient } from "@/app/backend/dbClient"; | ||
import "@testing-library/jest-dom"; | ||
import { toHaveNoViolations } from "jest-axe"; | ||
import * as matchers from "jest-extended"; | ||
import { Pool } from "pg"; | ||
|
||
expect.extend(toHaveNoViolations); | ||
expect.extend(matchers); | ||
|
||
if (process.env.TEST_TYPE === "integration") { | ||
let dbClient: Pool | null = null; | ||
beforeAll(() => { | ||
dbClient = getDbClient(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await dbClient?.end(); | ||
}); | ||
} |
Oops, something went wrong.