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

Forge Coverage Always at 0% #3072

Closed
2 tasks done
trajan0x opened this issue Sep 3, 2022 · 2 comments
Closed
2 tasks done

Forge Coverage Always at 0% #3072

trajan0x opened this issue Sep 3, 2022 · 2 comments
Labels
C-forge Command: forge Cmd-forge-coverage Command: forge coverage T-bug Type: bug

Comments

@trajan0x
Copy link

trajan0x commented Sep 3, 2022

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

1c41585

What command(s) is the bug in?

forge coverage -vvv

Operating System

macOS (Apple Silicon)

Describe the bug

This appears to be a regression in #3068. The memory growth issue (#3067) is fixed, but now coverage is coming across at 0% across repositories.

Steps to replicate:

  1. foundryup -C 1c415857dd7b617190834dbcb361506f6143fed4
  2. git clone https://github.com/transmissions11/solmate
  3. forge coverage -vvv

Output:

solc@solcs-MacBook-Pro-3 solmate % forge coverage -vvv
[⠊] Compiling...
[⠢] Compiling 51 files with 0.8.15
[⠰] Solc 0.8.15 finished in 2.22s
Compiler run successful
Analysing contracts...
Running tests...
+---------------------------------------------------------------------------+---------------+---------------+---------------+---------------+
| File                                                                      | % Lines       | % Statements  | % Branches    | % Funcs       |
+===========================================================================================================================================+
| /Users/solc/solmate/src/auth/Auth.sol                                     | 0.00% (0/7)   | 0.00% (0/7)   | 0.00% (0/2)   | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/auth/Owned.sol                                    | 0.00% (0/2)   | 0.00% (0/2)   | 100.00% (0/0) | 0.00% (0/1)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/auth/authorities/MultiRolesAuthority.sol          | 0.00% (0/17)  | 0.00% (0/16)  | 0.00% (0/6)   | 0.00% (0/7)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/auth/authorities/RolesAuthority.sol               | 0.00% (0/13)  | 0.00% (0/11)  | 0.00% (0/4)   | 0.00% (0/6)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/mixins/ERC4626.sol                                | 0.00% (0/40)  | 0.00% (0/42)  | 0.00% (0/12)  | 0.00% (0/16)  |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/Auth.t.sol                                   | 0.00% (0/1)   | 0.00% (0/1)   | 100.00% (0/0) | 0.00% (0/1)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/ERC1155.t.sol                                | 0.00% (0/18)  | 0.00% (0/18)  | 100.00% (0/0) | 0.00% (0/8)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/ERC20.t.sol                                  | 0.00% (0/11)  | 0.00% (0/11)  | 100.00% (0/0) | 0.00% (0/7)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/ERC721.t.sol                                 | 0.00% (0/7)   | 0.00% (0/7)   | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/ReentrancyGuard.t.sol                        | 0.00% (0/6)   | 0.00% (0/8)   | 0.00% (0/4)   | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/WETH.t.sol                                   | 0.00% (0/7)   | 0.00% (0/7)   | 100.00% (0/0) | 0.00% (0/5)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/DSInvariantTest.sol                    | 0.00% (0/3)   | 0.00% (0/3)   | 0.00% (0/2)   | 0.00% (0/2)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/DSTestPlus.sol                         | 0.00% (0/48)  | 0.00% (0/59)  | 0.00% (0/16)  | 0.00% (0/16)  |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockAuthChild.sol                | 0.00% (0/1)   | 0.00% (0/1)   | 100.00% (0/0) | 0.00% (0/1)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockAuthority.sol                | 0.00% (0/1)   | 0.00% (0/1)   | 100.00% (0/0) | 0.00% (0/1)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockERC1155.sol                  | 0.00% (0/4)   | 0.00% (0/4)   | 100.00% (0/0) | 0.00% (0/5)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockERC20.sol                    | 0.00% (0/2)   | 0.00% (0/2)   | 100.00% (0/0) | 0.00% (0/2)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockERC4626.sol                  | 0.00% (0/3)   | 0.00% (0/3)   | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockERC721.sol                   | 0.00% (0/4)   | 0.00% (0/4)   | 100.00% (0/0) | 0.00% (0/5)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/mocks/MockOwned.sol                    | 0.00% (0/1)   | 0.00% (0/1)   | 100.00% (0/0) | 0.00% (0/1)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/MissingReturnToken.sol    | 0.00% (0/10)  | 0.00% (0/11)  | 0.00% (0/2)   | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/ReturnsFalseToken.sol     | 0.00% (0/3)   | 0.00% (0/3)   | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/ReturnsGarbageToken.sol   | 0.00% (0/14)  | 0.00% (0/15)  | 0.00% (0/2)   | 0.00% (0/4)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/ReturnsTooLittleToken.sol | 100.00% (0/0) | 100.00% (0/0) | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/ReturnsTooMuchToken.sol   | 0.00% (0/10)  | 0.00% (0/11)  | 0.00% (0/2)   | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/ReturnsTwoToken.sol       | 0.00% (0/3)   | 0.00% (0/3)   | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/test/utils/weird-tokens/RevertingToken.sol        | 0.00% (0/3)   | 0.00% (0/3)   | 100.00% (0/0) | 0.00% (0/3)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/tokens/ERC1155.sol                                | 0.00% (0/44)  | 0.00% (0/49)  | 0.00% (0/20)  | 0.00% (0/11)  |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/tokens/ERC20.sol                                  | 0.00% (0/26)  | 0.00% (0/28)  | 0.00% (0/6)   | 0.00% (0/8)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/tokens/ERC721.sol                                 | 0.00% (0/38)  | 0.00% (0/38)  | 0.00% (0/26)  | 0.00% (0/13)  |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/tokens/WETH.sol                                   | 0.00% (0/5)   | 0.00% (0/5)   | 100.00% (0/0) | 0.00% (0/2)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/Bytes32AddressLib.sol                       | 0.00% (0/2)   | 0.00% (0/2)   | 100.00% (0/0) | 0.00% (0/2)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/CREATE3.sol                                 | 0.00% (0/9)   | 0.00% (0/11)  | 0.00% (0/4)   | 0.00% (0/2)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/FixedPointMathLib.sol                       | 0.00% (0/40)  | 0.00% (0/30)  | 0.00% (0/10)  | 0.00% (0/8)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/SSTORE2.sol                                 | 0.00% (0/12)  | 0.00% (0/14)  | 0.00% (0/4)   | 0.00% (0/5)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/SafeCastLib.sol                             | 0.00% (0/22)  | 0.00% (0/22)  | 0.00% (0/22)  | 0.00% (0/11)  |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| /Users/solc/solmate/src/utils/SafeTransferLib.sol                         | 0.00% (0/12)  | 0.00% (0/12)  | 0.00% (0/8)   | 0.00% (0/4)   |
|---------------------------------------------------------------------------+---------------+---------------+---------------+---------------|
| Total                                                                     | 0.00% (0/449) | 0.00% (0/465) | 0.00% (0/152) | 0.00% (0/184) |
+---------------------------------------------------------------------------+---------------+---------------+---------------+---------------+

Prior to 1c41585 this is coming in at ~59.02% total

@trajan0x trajan0x added the T-bug Type: bug label Sep 3, 2022
@gakonst gakonst added this to Foundry Sep 3, 2022
@gakonst gakonst moved this to Todo in Foundry Sep 3, 2022
trajan0x added a commit to synapsecns/sanguine that referenced this issue Sep 3, 2022
@trajan0x trajan0x changed the title Forge Coverage at 0% Forge Coverage Always at 0% Sep 3, 2022
@eugenioclrc
Copy link

same issue here!

@rkrasiuk rkrasiuk added C-forge Command: forge Cmd-forge-coverage Command: forge coverage labels Sep 4, 2022
@gakonst
Copy link
Member

gakonst commented Sep 4, 2022

Should be fixed in latest master per #3073.

@gakonst gakonst closed this as completed Sep 4, 2022
Repository owner moved this from Todo to Done in Foundry Sep 4, 2022
trajan0x added a commit to synapsecns/sanguine that referenced this issue Sep 5, 2022
trajan0x added a commit to synapsecns/sanguine that referenced this issue Sep 5, 2022
Foundry nightly release should work now making a6b87ca and #161 no longer neccesary (workarounds for foundry-rs/foundry#3072 and foundry-rs/foundry#3067 respectively

Co-authored-by: Trajan0x <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-coverage Command: forge coverage T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

4 participants