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

Chore: Turn on code coverage #584

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Chore: Turn on code coverage #584

merged 1 commit into from
Jun 17, 2024

Conversation

jbrower95
Copy link
Contributor

@jbrower95 jbrower95 commented Jun 14, 2024

Summary:
This is a simple PR that enables code coverage using forge coverage. The only non-trivial piece is that forge coverage includes tests, scripts and other non-functional code as part of its coverage, so there's logic to strip these files out. Once the coverage site is generated, it's uploaded to S3 using an artifact action.

How to view:

  • The bot will automatically post the coverage on your PR. You can look through the associated Github Action if you want the HTML report.

Changelog:

  • bump hardhat version
  • introduce a coverage job for GHA
  • coverage job automatically computes coverage percentages, filtering out unnecessary files.
  • coverage job then uploads report to s3 for review.
  • bot then posts the status on the PR.

@jbrower95 jbrower95 changed the title [wip] add coverage job for GHA Turn on code coverage Jun 17, 2024
@jbrower95 jbrower95 marked this pull request as ready for review June 17, 2024 14:35
@jbrower95 jbrower95 changed the title Turn on code coverage Chore: Turn on code coverage Jun 17, 2024
@jbrower95 jbrower95 requested a review from seanmcgary June 17, 2024 15:48
Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

Is there an easy way we can view the coverage report without having to download the report file? Or am I missing where the link is?

.github/workflows/coverage.yml Outdated Show resolved Hide resolved
@jbrower95 jbrower95 marked this pull request as draft June 17, 2024 18:01
@jbrower95 jbrower95 marked this pull request as ready for review June 17, 2024 18:01
@jbrower95 jbrower95 marked this pull request as draft June 17, 2024 18:09
@jbrower95 jbrower95 marked this pull request as ready for review June 17, 2024 18:11
@jbrower95 jbrower95 marked this pull request as draft June 17, 2024 18:13
@jbrower95 jbrower95 marked this pull request as ready for review June 17, 2024 18:13
@jbrower95 jbrower95 marked this pull request as draft June 17, 2024 18:14
@jbrower95 jbrower95 marked this pull request as ready for review June 17, 2024 18:14
Copy link

github-actions bot commented Jun 17, 2024

Reading tracefile ./lcov.info.pruned
                                               |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                |95.5%    44|91.7%  12|    -    0
libraries/BytesLib.sol                         | 8.0%    50| 7.1%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    30| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/DelayedWithdrawalRouter.sol               |93.2%    59|85.7%  14|    -    0
pods/EigenPod.sol                              | 100%   150| 100%  33|    -    0
pods/EigenPodManager.sol                       |98.8%    84|89.5%  19|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                         Total:|82.0%  1069|73.7% 297|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                |95.5%    44|91.7%  12|    -    0
libraries/BytesLib.sol                         | 8.0%    50| 7.1%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    30| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/DelayedWithdrawalRouter.sol               |93.2%    59|85.7%  14|    -    0
pods/EigenPod.sol                              | 100%   150| 100%  33|    -    0
pods/EigenPodManager.sol                       |98.8%    84|89.5%  19|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|82.0%  1069|73.7% 297|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                |95.5%    44|91.7%  12|    -    0
libraries/BytesLib.sol                         | 8.0%    50| 7.1%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    30| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/DelayedWithdrawalRouter.sol               |93.2%    59|85.7%  14|    -    0
pods/EigenPod.sol                              | 100%   150| 100%  33|    -    0
pods/EigenPodManager.sol                       |98.8%    84|89.5%  19|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|82.0%  1069|73.7% 297|    -    0

@jbrower95 jbrower95 merged commit 20273de into dev Jun 17, 2024
18 checks passed
@jbrower95 jbrower95 deleted the jb/coverage branch June 17, 2024 21:45
Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                |95.5%    44|91.7%  12|    -    0
libraries/BytesLib.sol                         | 8.0%    50| 7.1%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    30| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/DelayedWithdrawalRouter.sol               |93.2%    59|85.7%  14|    -    0
pods/EigenPod.sol                              | 100%   150| 100%  33|    -    0
pods/EigenPodManager.sol                       |98.8%    84|89.5%  19|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|82.0%  1069|73.7% 297|    -    0

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.

3 participants