Auto disable buidler-gas-reporter (#504)

pull/507/head
cgewecke 5 years ago committed by GitHub
parent 7bdcac1206
commit 2b14380d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      package.json
  2. 1
      plugins/resources/buidler.utils.js
  3. 8
      test/integration/projects/buidler-gas-reporter/buidler.config.js
  4. 17
      test/integration/projects/buidler-gas-reporter/contracts/ContractA.sol
  5. 15
      test/integration/projects/buidler-gas-reporter/test/test.js
  6. 10
      test/units/buidler/standard.js
  7. 686
      yarn.lock

@ -47,6 +47,7 @@
"@nomiclabs/buidler-truffle5": "^1.1.2",
"@nomiclabs/buidler-web3": "^1.1.2",
"@truffle/contract": "^4.0.36",
"buidler-gas-reporter": "^0.1.3",
"decache": "^4.5.1",
"ganache-core-sc": "^2.7.0-sc.0",
"mocha": "5.2.0",

@ -23,6 +23,7 @@ function normalizeConfig(config, args={}){
config.artifactsDir = config.paths.artifacts;
config.logger = config.logger ? config.logger : {log: null};
config.solcoverjs = args.solcoverjs
config.gasReporter = { enabled: false }
return config;
}

@ -0,0 +1,8 @@
const { loadPluginFile } = require("@nomiclabs/buidler/plugins-testing");
loadPluginFile(__dirname + "/../plugins/buidler.plugin");
usePlugin("@nomiclabs/buidler-truffle5");
usePlugin("buidler-gas-reporter");
module.exports={
defaultNetwork: "buidlerevm",
};

@ -0,0 +1,17 @@
pragma solidity ^0.5.0;
contract ContractA {
uint x;
constructor() public {
}
function sendFn() public {
x = 5;
}
function callFn() public pure returns (uint){
uint y = 5;
return y;
}
}

@ -0,0 +1,15 @@
const ContractA = artifacts.require("ContractA");
contract("contracta", function(accounts) {
let instance;
before(async () => instance = await ContractA.new())
it('sends', async function(){
await instance.sendFn();
});
it('calls', async function(){
await instance.callFn();
})
});

@ -294,4 +294,12 @@ describe('Buidler Plugin: standard use cases', function() {
verify.lineCoverage(expected);
})
})
// This test freezes when gas-reporter is not disabled
it('disables buidler-gas-reporter', async function() {
mock.installFullProject('buidler-gas-reporter');
mock.buidlerSetupEnv(this);
await this.env.run("coverage");
});
})

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save