The PR's main change to master is that it creates a 'copy' truffle project to instrument in a disposable directory and runs truffle in that context with a truffle.js configured for solcover. Master currently uses the host truffle scaffolding to house instrumented copies of the target contracts, restoring originals after coverage has been generated.
also includes a small suite of tests and helpers that execute runCoveredTests on mock truffle projects under various conditions. The tests take a while - they each invoke truffle. They also consume so much memory that garbage collection has to be called between each one to prevent the suite from hitting the CI container's memory limit. To see what runCovered emits as the tests run, remove the silent option from line 22 of the run.js test.
changes circle.yml by bumping node version to 6.9.1 and by disabling node_module caching between builds.
As a mea culpa - I really meant this to be a couple of small things and not involve so many changes - they just piled up. Perfectly happy to let it sit here as a draft for discussion or as a source for ideas indefinitely.
This PR addresses the "stop modifying original contracts" TODO and makes some changes to the way testrpc is launched so that:
runCoveredTests.js
within the solcover directory:--dir <workingDirectory>
specifies root where truffle.js, contracts, etc are located.--port <port>
specifies which port patched testrpc will run on, which port truffle will attempt to connect on--silent
runs without any stdin or stderr output from itself or truffle.--norpc
runs without patching and launching testrpc. This is a hack to address issues around repeatedly launching testrpc instances in the container during unit tests.The PR's main change to master is that it creates a 'copy' truffle project to instrument in a disposable directory and runs truffle in that context with a
truffle.js
configured for solcover. Master currently uses the host truffle scaffolding to house instrumented copies of the target contracts, restoring originals after coverage has been generated.runCoveredTests
on mock truffle projects under various conditions. The tests take a while - they each invoke truffle. They also consume so much memory that garbage collection has to be called between each one to prevent the suite from hitting the CI container's memory limit. To see whatrunCovered
emits as the tests run, remove the silent option from line 22 of therun.js
test.circle.yml
by bumping node version to 6.9.1 and by disabling node_module caching between builds.As a mea culpa - I really meant this to be a couple of small things and not involve so many changes - they just piled up. Perfectly happy to let it sit here as a draft for discussion or as a source for ideas indefinitely.