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

[sol-cov] Coverage is not working for versions ^0.5.1 of solidity #1650

Closed
PaulRBerg opened this issue Feb 26, 2019 · 3 comments · Fixed by #1654
Closed

[sol-cov] Coverage is not working for versions ^0.5.1 of solidity #1650

PaulRBerg opened this issue Feb 26, 2019 · 3 comments · Fixed by #1654
Assignees

Comments

@PaulRBerg
Copy link
Contributor

Expected Behavior

The coverage report should be generated for versions 0.5.1 and above of solidity.

Current Behavior

The coverage report is blank:

@0x/sol-coverage

If you bump the solidity version to 0.5.2, 0.5.3 or 0.5.4 (state-of-the-art as of 26th Feb 2019), nothing changes. If you revert to 0.5.0 in truffle-config and the contract's pragmas, everything works okay.

Steps to Reproduce

1. git clone git@github.com:PaulRBerg/sol-coverage-bug.git
2. cd sol-coverage-bug
3. npm install
4. npm run coverage

Context

This has originally occurred in the AZTEC repo, in the "protocol" package on the "feat-coverage" branch, but the behaviour is exactly the same in the bug repo I created.

Your Environment

Tool Version
@0x/sol-coverage 2.0.4
solidity 0.5.1
npm 6.7.0
node 10.15.0
@LogvinovLeon
Copy link
Contributor

Somehow sol-compiler doesn't pick up the info that the optimizer is enabled. Working on a fix

@LogvinovLeon
Copy link
Contributor

Ok. It was caused by a breaking change in truffle.json format.
Before it had solc key, but now it's nested under the compilers.solc.
WIll release the fix soon.

@ochikov
Copy link
Contributor

ochikov commented Mar 6, 2019

I am still getting issue with coverage. The coverage.json file is empty. No matter if I change the version of solidity to be 0.5.0, the file is empty. I use @PaulRBerg repository.
I also tried with that one: https://github.com/marekkirejczyk/dev-tools-truffle-example
with slight modification in test, where I add after and I call writeCoverageAsync(); The result is the same -> coverage.json is empty.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants