Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Add support for solidity-coverage #15

Merged
merged 6 commits into from
Nov 15, 2019
Merged

Add support for solidity-coverage #15

merged 6 commits into from
Nov 15, 2019

Conversation

nventuro
Copy link
Contributor

@nventuro nventuro commented Nov 15, 2019

Running coverage requires using a special version of ganache-core (forked in https://github.com/OpenZeppelin/ganache-core-coverage), which due to the extensive build process, we consume already packed and published as a GitHub release (which I made by running npm pack).

When running under coverage mode, we use that special ganache version and enable the allowUnlimitedContractSize and emitFreeLogs, which reduce the side effects of the coverage instrumentation, as well as override user supplied configuration for gas values so that tests don't start failing due to side effects of coverage. This allows users to have a single config file that does not need to be modified when running a coverage run.

edit: I also pinned the web3 version in this PR (see web3/web3.js#3210) because it was breaking the package, sorry for having that here

@nventuro
Copy link
Contributor Author

I'm still looking into the failing tests and comparing the coverage results with the master build of the contracts repo, but the bulk of the required changes is already here.

@nventuro
Copy link
Contributor Author

All done! This commit now replicates the behavior of the coverage run on the contracts repo (the same tests fail and for the same reasons).

Copy link
Contributor

@ylv-io ylv-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Super happy with progress on test-env during this week!

@@ -0,0 +1,9 @@
import colors from 'ansi-colors';

export function log(msg: string): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really like putting it in a separate file as soon as possible.

@ylv-io ylv-io merged commit e069ae5 into master Nov 15, 2019
@nventuro nventuro deleted the coverage branch November 15, 2019 20:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants