Skip to content

Commit d867ffb

Browse files
charlesBochetAdityaPimpalkar
authored andcommitted
Fix server e2e tests on CI twentyhq#1
1 parent c7c8326 commit d867ffb

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.github/workflows/ci-server.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
server-test:
2727
needs: postgres-job
2828
runs-on: ubuntu-latest
29+
env:
30+
PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/test?connection_limit=1
2931
steps:
3032
- uses: actions/checkout@v3
3133
if: github.event_name == 'push'
@@ -48,4 +50,4 @@ jobs:
4850
cd server && yarn test
4951
- name: Server / Run e2e tests
5052
run: |
51-
cd server && yarn test:e2e
53+
cd server && yarn test:e2e-ci

infra/dev/postgres/init.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
CREATE DATABASE "default";
33

44
-- Create the tests database for e2e testing
5-
CREATE DATABASE "tests";
5+
CREATE DATABASE "test";

server/.env.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ REFRESH_TOKEN_EXPIRES_IN=30d
77
LOGIN_TOKEN_SECRET=secret_login_token
88
LOGIN_TOKEN_EXPIRES_IN=15m
99
FRONT_AUTH_CALLBACK_URL=http://localhost:3001/auth/callback
10-
PG_DATABASE_URL=postgres://postgres:postgrespassword@localhost:5432/tests?connection_limit=1
10+
PG_DATABASE_URL=postgres://postgres:postgrespassword@localhost:5432/test?connection_limit=1
1111
STORAGE_TYPE=local
1212
STORAGE_LOCAL_PATH=.local-storage

server/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"test:watch": "jest --watch",
1919
"test:cov": "jest --coverage",
2020
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
21-
"test:e2e": "./scripts/run-integration.sh",
21+
"test:e2e": "./scripts/setenv.sh && ./scripts/run-integration.sh",
22+
"test:e2e-ci": "./scripts/run-integration.sh",
2223
"prisma:generate-client": "npx prisma generate --generator client && yarn prisma:generate-gql-select",
2324
"prisma:generate-gql-select": "node scripts/generate-model-select-map.js",
2425
"prisma:generate-nest-graphql": "npx prisma generate --generator nestgraphql",

server/scripts/run-integration.sh

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env bash
22
# src/run-integration.sh
33

4-
DIR="$(cd "$(dirname "$0")" && pwd)"
5-
source $DIR/setenv.sh
6-
74
npx ts-node ./test/utils/check-db.ts
85
EXIT_CODE=$?
96

0 commit comments

Comments
 (0)