Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @nachomazzara :) this is a patch to resolve solidity-coverage 467
This PR is just a guide for installation - please feel free to close if it's not helpful or you'd like re-organize things in a different way. I'll discuss details in the diff below, but the main thing that's done here is to move fake contracts to
contracts/mocks
.SC rewrites and recompiles your contracts to temporary folders in the project root. In this repo, the Solidity entry point for the tests is in the test directory. Those files have hardcoded import paths to
../../contracts/etc.sol
which can't be dynamically updated to discover instrumented sources in the temp folder. At the moment the plugin relies on the conventions ofconfig.paths.contractsDir
to locate instrumented sources correctly and supply them to the compiler.There are things the plugin could do to be more flexible here but they're relatively complicated to implement - so this is a quick fix (sorry).
When initially running
npx buidler test
, Buidler asked to update itself - hence the package-lock.json change.[EDIT] - another thing I noticed is that BuidlerEVM is pretty fast. The coverage run feels slow by comparison.