Commit 7d18c3dd authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'issue/98' into 'develop'

Issue #98: Add verification to env variable

See merge request !83
parents a3bf602b d1a0963a
Pipeline #19108 passed with stages
in 58 seconds
......@@ -27,7 +27,14 @@ import { ConfigParser } from "../src/util/configParser";
let config: any;
let fixture;
const configPath = process.env.BLENDB_SCHEMA_FILE;
let configPath;
if(process.env.BLENDB_SCHEMA_FILE){
configPath = process.env.BLENDB_SCHEMA_FILE;
}
else{
throw new Error("BLENDB_SCHEMA_FILE wasn't informed");
}
config = ConfigParser.parse(configPath);
fixture = new FixPostgres(config.connection);
......
......@@ -72,8 +72,15 @@ function loadDb(db: string, index: number, cb: (err: any, result: Adapter) => vo
describe("API collect controller", () => {
// Initializing
before(function (done): void {
// Arrow function not used to get acces to this and skip the test
const configPath = process.env.BLENDB_SCHEMA_FILE;
// Arrow function not used to get acces to this and skip the test
let configPath;
if(process.env.BLENDB_SCHEMA_FILE){
configPath = process.env.BLENDB_SCHEMA_FILE;
}
else{
throw new Error("BLENDB_SCHEMA_FILE wasn't informed");
}
config = ConfigParser.parse(configPath);
eachOf(config.adapters , function(database, key: number, callback) {
......
......@@ -36,8 +36,17 @@ const app = module.exports = express();
// Load configuration file
import { ConfigParser } from "./util/configParser";
let configPath;
/** @hidden */
const configPath = process.env.BLENDB_SCHEMA_FILE;
if(process.env.BLENDB_SCHEMA_FILE){
configPath = process.env.BLENDB_SCHEMA_FILE;
}
else{
throw new Error("BLENDB_SCHEMA_FILE wasn't informed");
}
/** @hidden */
const config = ConfigParser.parse(configPath);
......
......@@ -29,7 +29,15 @@ import { ViewHandler } from "../src/util/viewHandler";
import { EngineScenario, AdapterScenario, DataCtrlScenario } from "../src/util/scenarioHandler";
import { Query, QueryOpts } from "../src/common/query";
const configPath = process.env.BLENDB_SCHEMA_FILE;
let configPath;
if(process.env.BLENDB_SCHEMA_FILE){
configPath = process.env.BLENDB_SCHEMA_FILE;
}
else{
throw new Error("BLENDB_SCHEMA_FILE wasn't informed");
}
const config = ConfigParser.parse(configPath);
const mets : {[key: string]: Metric} = {};
......
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