remove isTest

This commit is contained in:
Iuri Matias 2018-08-24 09:25:47 -04:00
parent 5fa089d51c
commit ffbd39882a
5 changed files with 8 additions and 6 deletions

View File

@ -167,7 +167,7 @@ class Engine {
this.registerModule('solidity', {ipc: self.ipc, useDashboard: this.useDashboard}); this.registerModule('solidity', {ipc: self.ipc, useDashboard: this.useDashboard});
this.registerModule('vyper'); this.registerModule('vyper');
this.registerModule('profiler'); this.registerModule('profiler');
this.registerModule('deploytracker'); this.registerModule('deploytracker', {trackContracts: options.trackContracts});
this.registerModule('specialconfigs'); this.registerModule('specialconfigs');
this.registerModule('console_listener', {ipc: self.ipc}); this.registerModule('console_listener', {ipc: self.ipc});
this.registerModule('contracts_manager'); this.registerModule('contracts_manager');

View File

@ -7,7 +7,7 @@ let utils = require('../../utils/utils.js');
// TODO: create a contract object // TODO: create a contract object
class ContractsManager { class ContractsManager {
constructor(embark) { constructor(embark, options) {
const self = this; const self = this;
this.logger = embark.logger; this.logger = embark.logger;
this.events = embark.events; this.events = embark.events;
@ -16,6 +16,7 @@ class ContractsManager {
this.contractDependencies = {}; this.contractDependencies = {};
this.deployOnlyOnConfig = false; this.deployOnlyOnConfig = false;
this.compileError = false; this.compileError = false;
this.compileOnceOnly = options.compileOnceOnly;
self.events.setCommandHandler('contracts:list', (cb) => { self.events.setCommandHandler('contracts:list', (cb) => {
cb(self.compileError, self.listContracts()); cb(self.compileError, self.listContracts());
@ -77,7 +78,7 @@ class ContractsManager {
}, },
function compileContracts(callback) { function compileContracts(callback) {
self.events.emit("status", __("Compiling...")); self.events.emit("status", __("Compiling..."));
if (process.env.isTest && self.compiledContracts && Object.keys(self.compiledContracts).length) { if (self.compileOnceOnly && self.compiledContracts && Object.keys(self.compiledContracts).length) {
// Only compile once for tests // Only compile once for tests
return callback(); return callback();
} }

View File

@ -7,6 +7,7 @@ class DeployTracker {
this.logger = embark.logger; this.logger = embark.logger;
this.events = embark.events; this.events = embark.events;
this.embark = embark; this.embark = embark;
this.trackContracts = (options.trackContracts !== false);
// TODO: unclear where it comes from // TODO: unclear where it comes from
this.env = options.env; this.env = options.env;
@ -26,7 +27,7 @@ class DeployTracker {
}); });
self.embark.registerActionForEvent("deploy:contract:shouldDeploy", (params, cb) => { self.embark.registerActionForEvent("deploy:contract:shouldDeploy", (params, cb) => {
if (process.env.isTest) { if (!self.trackContracts) {
return cb(params); return cb(params);
} }

View File

@ -24,7 +24,6 @@ function getFilesFromDir(filePath, cb) {
module.exports = { module.exports = {
run: function (options) { run: function (options) {
process.env.isTest = true;
let failures = 0; let failures = 0;
let filePath = options.file; let filePath = options.file;
const loglevel = options.loglevel || 'warn'; const loglevel = options.loglevel || 'warn';

View File

@ -108,7 +108,8 @@ class Test {
web3: this.web3 web3: this.web3
}); });
this.engine.startService("deployment", { this.engine.startService("deployment", {
trackContracts: false trackContracts: false,
compileOnceOnly: true
}); });
this.events.request('deploy:setGasLimit', 6000000); this.events.request('deploy:setGasLimit', 6000000);
this.engine.startService("codeCoverage"); this.engine.startService("codeCoverage");