Skip to content
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

Enable coverage when viaIR compiler flag is true #854

Merged
merged 14 commits into from
Feb 9, 2024
Merged

Conversation

cgewecke
Copy link
Member

@cgewecke cgewecke commented Feb 8, 2024

PUBLISHED at the viaIR tag

npm install --save-dev solidity-coverage@viaIR

#853, #848, #790, #715, #417

Uses solidity built-in ignored by the yul optimizer to preserve instrumentation when viaIR is set to true. This should address all the insane optimizer config problems.

Coverage in the plugin's own tests is missing for an edge case where the optimizer has:

  • right padded the hash to 32 bytes
  • hash has a truncated leading zero
  • hash is not duplicate (e.g it wasn't just pushed onto the stack by some other operation)

... we hit the first two conditions in the integration tests but the hash is a duplicate.

TODO

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (d3a5b37) 95.92% compared to head (62408ea) 95.77%.

Files Patch % Lines
lib/collector.js 88.88% 2 Missing ⚠️
plugins/resources/nomiclabs.utils.js 90.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
- Coverage   95.92%   95.77%   -0.16%     
==========================================
  Files          19       19              
  Lines         981     1017      +36     
==========================================
+ Hits          941      974      +33     
- Misses         40       43       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cgewecke
Copy link
Member Author

cgewecke commented Feb 9, 2024

E2E tested against 1inch solidity-utils and got the output below.
Compare with / identical to: https://github.com/1inch/solidity-utils/actions/runs/7756078740/job/21152695486
Screen Shot 2024-02-08 at 6 44 16 PM

NB: there was a failing test that looked at gas specific values - to be expected because the instrumentation mechanism changed and there's some consumption variance.

Screen Shot 2024-02-08 at 6 50 31 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants