diff --git a/packages/embark-contracts-manager/src/index.js b/packages/embark-contracts-manager/src/index.js index cb99e23a22..e0e5ac1c55 100644 --- a/packages/embark-contracts-manager/src/index.js +++ b/packages/embark-contracts-manager/src/index.js @@ -14,6 +14,7 @@ class ContractsManager { this.events = embark.events; this.fs = embark.fs; this.plugins = options.plugins; + this.currentContext = embark.currentContext || []; this.contracts = {}; this.contractDependencies = {}; @@ -376,7 +377,11 @@ class ContractsManager { }, function setDeployIntention(callback) { let className, contract; - let showInterfaceMessage = false; + let showInterfaceMessageTrace = false; + let showInterfaceMessageWarn = false; + const isTest = self.currentContext.includes(constants.contexts.test); + const contractsInConfig = Object.keys(self.contractsConfig.contracts); + for (className in self.contracts) { contract = self.contracts[className]; contract.deploy = (contract.deploy === undefined) || contract.deploy; @@ -390,17 +395,20 @@ class ContractsManager { if (contract.code === "") { const message = __("assuming %s to be an interface", className); - showInterfaceMessage = true; - if (contract.silent) { + if (contract.silent || (isTest && !contractsInConfig.includes(className))) { + showInterfaceMessageTrace = true; self.logger.trace(message); } else { - self.logger.info(message); + showInterfaceMessageWarn = true; + self.logger.warn(message); } contract.deploy = false; } } - if (showInterfaceMessage) { - self.logger.warn(__('To get more details on interface contracts, go here: %s', 'https://embark.status.im/docs/troubleshooting.html#Assuming-Contract-to-be-an-interface'.underline)); + if (showInterfaceMessageTrace || showInterfaceMessageWarn) { + let logFunction = showInterfaceMessageWarn ? self.logger.warn : self.logger.trace; + logFunction.call(self.logger, __('To get more details on interface Smart contracts, go here: %s', 'https://embark.status.im/docs/troubleshooting.html#Assuming-Contract-to-be-an-interface'.underline)); + } callback(); }, diff --git a/packages/embark-test-runner/src/test.js b/packages/embark-test-runner/src/test.js index 2ac5e98643..9c5353d170 100644 --- a/packages/embark-test-runner/src/test.js +++ b/packages/embark-test-runner/src/test.js @@ -216,6 +216,7 @@ class Test { console.info('Compiling contracts'.cyan); self.events.request("contracts:build", false, (err) => { self.firstDeployment = false; + console.info('Compilation done\n'.cyan); next(err); }); }, diff --git a/site/source/docs/troubleshooting.md b/site/source/docs/troubleshooting.md index 09e5c52be5..b166118993 100644 --- a/site/source/docs/troubleshooting.md +++ b/site/source/docs/troubleshooting.md @@ -18,7 +18,7 @@ Issues typically occur if NodeJS and/or Embark are installed using `sudo`, avoid ## Assuming Contract to be an interface -This warning happens when Embark can't deploy one of your contracts because the compiler did not return a bytecode. +This warning happens when Embark can't deploy one of your Smart Contracts because the compiler did not return a bytecode. Here are some of the reasons: - If it inherits from an interface, it must have all the functions implemented