-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add test db in compose and gh actions * add test db setup script * move cleanDatabase to a helper file * rm unused test * adjustments to make it work * remove header param from playwright and add NODE_ENV=test in gh test action Also adjust DATABASE_URL in env example * install browsers with deps * fix seeds
- Loading branch information
Showing
11 changed files
with
619 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,30 @@ on: | |
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: db | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
env: | ||
POSTMARK_API_KEY: SECRET | ||
PUBLIC_SITE_NAME: TACO [TEST] | ||
EMAIL_SENDER_SIGNATURE: [email protected] | ||
PUBLIC_SENTRY_DSN: SECRET | ||
PUBLIC_SENTRY_ENV: test | ||
PUBLIC_SITE_URL: http://localhost:5173/ | ||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/db | ||
NODE_ENV: test | ||
|
||
steps: | ||
- name: Checkout repository | ||
|
@@ -22,15 +46,11 @@ jobs: | |
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Install Playwright browsers | ||
run: npx playwright install | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Prisma migrations | ||
run: npx prisma migrate deploy | ||
|
||
- name: Run tests | ||
run: npm test | ||
env: | ||
POSTMARK_API_KEY: 'SECRET' | ||
PUBLIC_SITE_NAME: 'TACO [TEST]' | ||
EMAIL_SENDER_SIGNATURE: '[email protected]' | ||
PUBLIC_SENTRY_DSN: 'SECRET' | ||
PUBLIC_SENTRY_ENV: 'test' | ||
PUBLIC_SITE_URL: 'http://localhost:5173/' |
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,15 +1,23 @@ | ||
version: "3.8" | ||
services: | ||
db: | ||
image: postgres:latest | ||
image: postgres:15 | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=taco | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: db | ||
ports: | ||
- "6532:5432" | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
test-db: | ||
image: postgres:15 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: db | ||
ports: | ||
- "3432:5432" | ||
|
||
volumes: | ||
db: |
Oops, something went wrong.