Skip to content
Snippets Groups Projects
Commit d1a0963a authored by rafaelatc3sl's avatar rafaelatc3sl
Browse files

Issue #98: Add verification to env variable


Signed-off-by: default avatarrafaelatc3sl <rpd17@c3sl>
parent a3bf602b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -73,7 +73,14 @@ 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;
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} = {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment