-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
forge coverage should allow excluding contracts #2988
Comments
+1 on this feature, it would be helpful to be able to exclude certain folders too, given that the library coverage is not supported yet, it will make it easier for teams to build robust CICD pipelines if we can avoid the known issues 🙏 |
+1, absolutely necessary for custom directory layouts and for CICD scripts to rely on |
Looks like @onbjerg suggested that this might be done natively in #1576, but coverage always seems to include .t.sol files. The |
Is there any updates on an option to exclude certain contracts from coverage? |
A workaround for this is to retroactively remove unwanted files from the lcov report using the Example CI:
|
This would definitely be handy |
@alexroan how do you re-run the coverage check in step 4 on ./lcov.info.pruned ? |
I do not see a way to do this from
|
you pass it to the coverage reporter
|
One other way to bypass (get excluded by the report) it is to add a function prefixed with // add this to be excluded from coverage report
function test() public {}
Works for me for those mocks or tester contracts I don't really care. |
some of you might find this useful, especially if you are working with hardhat hybrid and node_modules deps https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/coverage.sh |
(Links with |
Component
Forge
Describe the feature you would like
Running
forge coverage
automatically includes scripts and test utils that are contracts, which adds noise to the coverage report. It would be helpful if there was a way to exclude these from the reportsAdditional context
No response
The text was updated successfully, but these errors were encountered: