Fix integration test running on the wrong environment

pull/1017/head
Mikunj 5 years ago
parent 3f5a8e7b1b
commit 0cccc70b9b

@ -20,7 +20,7 @@ process.env.NODE_CONFIG_DIR = path.join(__dirname, '..', 'config');
if (environment === 'production') {
// harden production config against the local env
process.env.NODE_CONFIG = '';
process.env.NODE_CONFIG_STRICT_MODE = true;
process.env.NODE_CONFIG_STRICT_MODE = !isDevelopment;
process.env.HOSTNAME = '';
process.env.ALLOW_CONFIG_MUTATIONS = '';
process.env.SUPPRESS_NO_CONFIG_WARNING = '';

@ -37,7 +37,7 @@ function initialize() {
`sql channel error with call ${callName}: ${errorForDisplay}`
);
// FIXME this line cause the test-integration to fail and we probably don't need it during test
if (!process.env.NODE_APP_INSTANCE.includes('test-integration')) {
if (!process.env.NODE_ENV.includes('test-integration')) {
event.sender.send(`${SQL_CHANNEL_KEY}-done`, jobId, errorForDisplay);
}
}

@ -55,8 +55,7 @@ module.exports = {
path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
args: ['.'],
env: {
NODE_APP_INSTANCE: env,
NODE_ENV: 'production',
NODE_ENV: env,
USE_STUBBED_NETWORK: true,
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,

@ -899,7 +899,7 @@ app.on('window-all-closed', () => {
config.environment === 'test' ||
config.environment === 'test-lib' ||
config.environment === 'test-loki' ||
config.environmen.includes('test-integration')
config.environment.includes('test-integration')
) {
app.quit();
}
@ -950,11 +950,10 @@ ipc.on('add-setup-menu-items', () => {
});
ipc.on('draw-attention', () => {
if (process.platform === 'darwin') {
app.dock.bounce();
} else if (process.platform === 'win32') {
mainWindow.flashFrame(true);
} else if (process.platform === 'linux') {
if (!mainWindow) {
return;
}
if (process.platform === 'win32' || process.platform === 'linux') {
mainWindow.flashFrame(true);
}
});

@ -34,7 +34,7 @@
"test-lib-view": "NODE_ENV=test-lib yarn run start",
"test-loki-view": "NODE_ENV=test-loki yarn run start",
"test-electron": "yarn grunt test",
"test-integration-session": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 5000 integration_test/integration_test.js",
"test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 5000 integration_test/integration_test.js",
"test-node": "mocha --recursive --exit test/app test/modules ts/test libloki/test/node",
"eslint": "eslint --cache .",
"eslint-fix": "eslint --fix .",

@ -52,8 +52,8 @@ window.getDefaultFileServer = () => config.defaultFileServer;
window.initialisedAPI = false;
if (
typeof process.env.NODE_APP_INSTANCE === 'string' &&
process.env.NODE_APP_INSTANCE.includes('test-integration')
typeof process.env.NODE_ENV === 'string' &&
process.env.NODE_ENV.includes('test-integration')
) {
window.electronRequire = require;
}

Loading…
Cancel
Save