Commit ba277989 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'issue/86' into 'develop'

Issue #86: Add environment variable for yaml files

See merge request !74
parents 87ba0061 234cb7ee
Pipeline #17436 passed with stages
in 1 minute and 16 seconds
......@@ -28,7 +28,6 @@ run_test_postgres:
stage: test
script:
- yarn install --frozen-lockfile --silent --non-interactive
- mv config/ci_test.yaml.example config/test.yaml
- mv config/ci_postgres_test.env.example config/test.env
- yarn test
- yarn run lint
......@@ -40,7 +39,6 @@ run_test_monet:
stage: test
script:
- yarn install --frozen-lockfile --silent --non-interactive
- mv config/ci_test.yaml.example config/test.yaml
- mv config/ci_monet_test.env.example config/test.env
- yarn test
- yarn run lint
......
......@@ -4,4 +4,5 @@ BLENDB_DB_PASSWORD=monetdb
BLENDB_DB_HOST=monet
BLENDB_DB_PORT=50000
BLENDB_ADAPTER=monet
BLENDB_SCHEMA_FILE=config/ci_test.yaml.example
PORT=3000
......@@ -4,4 +4,5 @@ BLENDB_DB_PASSWORD=
BLENDB_DB_HOST=postgres
BLENDB_DB_PORT=5432
BLENDB_ADAPTER=postgres
BLENDB_SCHEMA_FILE=config/ci_test.yaml.example
PORT=3000
......@@ -4,4 +4,5 @@ BLENDB_DB_PASSWORD=secret
BLENDB_DB_HOST=localhost
BLENDB_DB_PORT=5432
BLENDB_ADAPTER=postgres
BLENDB_SCHEMA_FILE=config/config.yaml
PORT=3000
......@@ -36,7 +36,8 @@ describe("Sql adapter", () => {
let fixture;
before(function (done): void {
// Arrow function not used to get acces to this and skip the test
config = ConfigParser.parse("config/test.yaml");
const configPath = process.env.BLENDB_SCHEMA_FILE;
config = ConfigParser.parse(configPath);
if (config.adapter === "postgres") {
fixture = new FixPostgres(config.connection);
......
......@@ -36,7 +36,8 @@ describe("API collect controller", () => {
let fixture;
before(function (done): void {
// Arrow function not used to get acces to this and skip the test
config = ConfigParser.parse("config/test.yaml");
const configPath = process.env.BLENDB_SCHEMA_FILE;
config = ConfigParser.parse(configPath);
if (config.adapter === "postgres") {
fixture = new FixPostgres(config.connection);
fixture.loadSource(config.sources, (err) => {
......
......@@ -37,7 +37,7 @@ const app = module.exports = express();
import { ConfigParser } from "./util/configParser";
/** @hidden */
const configPath = (app.get("env") === "test") ? "config/test.yaml" : "config/config.yaml";
const configPath = process.env.BLENDB_SCHEMA_FILE;
/** @hidden */
const config = ConfigParser.parse(configPath);
......
......@@ -66,7 +66,8 @@ interface DataCtrlScenario {
clausal: Query;
}
const config = ConfigParser.parse("config/test.yaml");
const configPath = process.env.BLENDB_SCHEMA_FILE;
const config = ConfigParser.parse(configPath);
const mets = config.metrics.sort((a, b) => {
const aValue = parseInt(a.name.split(":")[1], 10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment