mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Update test setup in CommonServer workflow and PostgresConfig
This commit is contained in:
2
.github/workflows/test.common-server.yaml
vendored
2
.github/workflows/test.common-server.yaml
vendored
@@ -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
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user