The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix server e2e tests on CI #1
Charles Bochet61205c2cb08c
diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yamlindex 04a9426ef7b..11cded46715 100644--- a/.github/workflows/ci-server.yaml+++ b/.github/workflows/ci-server.yaml@@ -26,6 +26,8 @@ jobs:server-test:needs: postgres-jobruns-on: ubuntu-latest+ env:+ PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/test?connection_limit=1steps:- uses: actions/checkout@v3if: github.event_name == 'push'@@ -48,4 +50,4 @@ jobs:cd server && yarn test- name: Server / Run e2e testsrun: |- cd server && yarn test:e2e+ cd server && yarn test:e2e-cidiff --git a/infra/dev/postgres/init.sql b/infra/dev/postgres/init.sqlindex ec152e4f7e3..2dffffd5cc0 100644--- a/infra/dev/postgres/init.sql+++ b/infra/dev/postgres/init.sql@@ -2,4 +2,4 @@CREATE DATABASE "default";-- Create the tests database for e2e testing-CREATE DATABASE "tests";+CREATE DATABASE "test";diff --git a/server/.env.test b/server/.env.testindex e77a739cf6a..ddf328f4e6c 100644--- a/server/.env.test+++ b/server/.env.test@@ -7,6 +7,6 @@ REFRESH_TOKEN_EXPIRES_IN=30dLOGIN_TOKEN_SECRET=secret_login_tokenLOGIN_TOKEN_EXPIRES_IN=15mFRONT_AUTH_CALLBACK_URL=http://localhost:3001/auth/callback-PG_DATABASE_URL=postgres://postgres:postgrespassword@localhost:5432/tests?connection_limit=1+PG_DATABASE_URL=postgres://postgres:postgrespassword@localhost:5432/test?connection_limit=1STORAGE_TYPE=localSTORAGE_LOCAL_PATH=.local-storagediff --git a/server/package.json b/server/package.jsonindex f78d290b0ff..1e1e7dca2b9 100644--- a/server/package.json+++ b/server/package.json@@ -18,7 +18,8 @@"test:watch": "jest --watch","test:cov": "jest --coverage","test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",- "test:e2e": "./scripts/run-integration.sh",+ "test:e2e": "./scripts/setenv.sh && ./scripts/run-integration.sh",+ "test:e2e-ci": "./scripts/run-integration.sh","prisma:generate-client": "npx prisma generate --generator client && yarn prisma:generate-gql-select","prisma:generate-gql-select": "node scripts/generate-model-select-map.js","prisma:generate-nest-graphql": "npx prisma generate --generator nestgraphql",diff --git a/server/scripts/run-integration.sh b/server/scripts/run-integration.shindex cfdeaa792b3..9d7c26a2edd 100755--- a/server/scripts/run-integration.sh+++ b/server/scripts/run-integration.sh@@ -1,9 +1,6 @@#!/usr/bin/env bash# src/run-integration.sh-DIR="$(cd "$(dirname "$0")" && pwd)"-source $DIR/setenv.sh-npx ts-node ./test/utils/check-db.tsEXIT_CODE=$?