From 937679d5448c53315381961a0577c134129b247f Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 25 Dec 2023 18:42:48 +0000 Subject: [PATCH] Update test setup in CommonServer workflow and PostgresConfig --- .github/workflows/test.common-server.yaml | 2 +- CommonServer/Infrastructure/PostgresConfig.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.common-server.yaml b/.github/workflows/test.common-server.yaml index 40e3060f87..850cb710f3 100644 --- a/.github/workflows/test.common-server.yaml +++ b/.github/workflows/test.common-server.yaml @@ -19,6 +19,6 @@ jobs: node-version: 18.3.0 - run: cd Common && npm install - run: cd Model && npm install - - run: cd CommonServer && bash test-setup.sh - run: cd CommonServer && npm install + - run: cd CommonServer && bash test-setup.sh - run: export $(grep -v '^#' config.env | xargs) && cd CommonServer && rm -rf build && npm run test \ No newline at end of file diff --git a/CommonServer/Infrastructure/PostgresConfig.ts b/CommonServer/Infrastructure/PostgresConfig.ts index f907659e70..3c6e132ec3 100644 --- a/CommonServer/Infrastructure/PostgresConfig.ts +++ b/CommonServer/Infrastructure/PostgresConfig.ts @@ -10,12 +10,10 @@ import { DatabaseSslCert, DatabaseRejectUnauthorized, ShouldDatabaseSslEnable, - Env, } from '../EnvironmentConfig'; import Entities from 'Model/Models/Index'; import Migrations from 'Model/Migrations/Index'; import DatabaseType from 'Common/Types/DatabaseType'; -import AppEnvironment from 'Common/Types/AppEnvironment'; import Faker from 'Common/Utils/Faker'; export const dataSourceOptions: DataSourceOptions = { @@ -45,12 +43,11 @@ export const datasource: DataSource = new DataSource(dataSourceOptions); export const testDataSourceOptions: DataSourceOptions = { type: DatabaseType.Postgres, - host: DatabaseHost.toString(), - port: DatabasePort.toNumber(), + host: 'localhost', + port: 5400, username: DatabaseUsername, password: DatabasePassword, database: DatabaseName + Faker.randomNumbers(16), entities: Entities, - synchronize: - Env === AppEnvironment.Test || Env === AppEnvironment.Development, + synchronize: true, };