Skip to content

Commit

Permalink
final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Feb 9, 2024
1 parent 05be665 commit a91880b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
DATABASE_URL=postgres://postgres:[email protected]:5432/keyshade
DATABASE_URL=postgresql://postgres:[email protected]:5432/keyshade_db
ADMIN_EMAIL=[email protected]

GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CALLBACK_URL=


SMTP_HOST=
SMTP_PORT=
SMTP_EMAIL_ADDRESS=
Expand Down
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run lint:fix && pnpm run prettier:fix && pnpm run test:api
docker compose up -d
pnpm run e2e:api
docker compose down
pnpm run lint:fix && pnpm run prettier:fix && pnpm run test:api && pnpm run e2e:api
13 changes: 0 additions & 13 deletions docker-compose-dev.yml

This file was deleted.

21 changes: 21 additions & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Set the version of docker compose to use
version: '3.9'

# The containers that compose the project
services:
db:
image: postgres:13
restart: always
container_name: integration-tests-prisma
ports:
- '5432:5432'
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
networks:
- keyshade-test

networks:
keyshade-test:
driver: bridge
22 changes: 13 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Set the version of docker compose to use
version: '3.9'

# The containers that compose the project
services:
db:
dev-db:
image: postgres:13
restart: always
container_name: integration-tests-prisma
ports:
- '5433:5432'
- '5432:5432'
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: keyshade_db
volumes:
- ./data:/var/lib/postgresql/data
networks:
- keyshade-dev

networks:
keyshade-dev:
driver: bridge
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@
"build:workspace": "nx run workspace:build",
"test": "nx run-many -t test --parallel",
"test:api": "nx run api:test",
"e2e:api:prepare": "NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5433/tests' pnpm run db:deploy-migrations",
"e2e:api": "pnpm run e2e:api:prepare && NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5433/tests' nx run api:test:e2e -- --coverage --coverageDirectory=coverage-e2e/api --coverageReporters=json",
"e2e:api:prepare": "docker compose down && docker compose -f docker-compose-test.yml up -d && NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' pnpm run db:deploy-migrations",
"e2e:api": "pnpm run e2e:api:prepare && NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' nx run api:test:e2e -- --coverage --coverageDirectory=coverage-e2e/api --coverageReporters=json && pnpm run e2e:api:teardown",
"e2e:api:teardown": "docker compose -f docker-compose-test.yml down",
"test:web": "nx run web:test",
"test:workspace": "nx run workspace:test",
"start:web": "nx run web:serve --configuration=production",
Expand Down

0 comments on commit a91880b

Please sign in to comment.