-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch coverage decreases after upgrading to 0.8.7 #863
Comments
@mariogutval Thanks for reporting. Some questions:
Also any info you can share about your compiler config in |
No, viaIR is not set to true anywhere in the configuration.
Yes, I did it.
Sure, this is my compiler config in
Apart from that, I don't have any |
@mariogutval Ok all of that looks good. Will investigate... |
Thank you! |
@mariogutval The difficulty looking into this is that we have extensive unit tests for the modifier coverage and we also run an E2E integration test where the latest commit here is injected into Zeppelin's own unit tests. Results have remained constant across the most recent releases. For example I just opened a PR to double-check this (#864) and the coverage for latest solidity-coverage on Zeppelin vs. v0.8.5 running in Zeppelin's own CI is identical. Idk if you're open to sharing the repo you're working on but I'm not sure how to proceed with this without a reproduction case...the tests I would use to verify the modifier cov works as expected LGTM. |
Okay it's so weird then. Unfortunately, I can't share the repo with you, but let me try to create a sample repo to reproduce the error. Thanks for the help. |
@cgewecke I just ran into this same bug in this public repo https://github.com/PaintSwap/samwitch-vrf/blob/a6b3fb916960ffbda2d0a23f481574e68a9ec482/contracts/SamWitchVRF.sol#L164 It shows the Uncovered branch: function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} Fully covered: modifier onlyOperator() {
_checkOwner();
_;
}
function _authorizeUpgrade(address newImplementation) internal override onlyOperator {} I was able to reproduce this behavior by copying the If I then update Further modifying the |
use 0.8.6 until bug fixed - sc-forks/solidity-coverage#863
@doublesharp Thanks for reproducing this!! Have merged #868 to patch - it's published experimentally at the If either of you have a chance could you verify that it resolves this (and doesn't break something else)? (Don't forget to run
|
@cgewecke It worked for me! Thank you! And also @doublesharp thanks for reporting the same error. |
@mariogutval tysm! Patch is published now in v0.8.9. |
After upgrading solidity-coverage dependency from 0.8.6 to 0.8.7, my branch coverage percentage decreased from 100% to 91.67%.
With 0.8.6:
With 0.8.7:
Apparently, the issue is related to the
onlyOwner
modifier from OpenZeppelin'sOwnable.sol
contract. According to the coverage report, theelse
branch is not being covered.However, I have logged the results of the following require statement and both of the results are being checked.
The smart contract code has not been modified.
Any thoughts on this?
The text was updated successfully, but these errors were encountered: