cgewecke / eth-gas-reporter

Gas usage per unit test. Average gas usage per method. A mocha reporter.
MIT License
603 stars 94 forks source link

Disable while running coverage #96

Closed asoong closed 6 years ago

asoong commented 6 years ago

Hey there, just came across this tool, but have been using the solidity-coverage tool for a while now. I noticed both profilers increase the workflow time on ci by quite a bit before vs. after. In my workflow, I parallelized running tests only and coverage. Wondering if there's a way to only have gas reporting on the tests.

cgewecke commented 6 years ago

@asoong Yes. Conventionally there's a container that just runs truffle test and another one that runs coverage. We actually recommend that coverage not be used as an equivalent to truffle test because it injects a lot of Solidity code into the contracts and it's nice to have a coverage-free baseline to make sure that nothing's getting distorted.

The main author of solidity-coverage works at JoinColony and they also run both of these tools on Circle. Their CI config is here. Probably also check out their package.json and truffle.js.

A travis example of separate containers for vanilla tests, gas tests, coverage, and a geth client can be seen at EthPM's travis.yml and at its truffle.js.