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

Coverage report inconsistent #4876

Closed
2 tasks done
oraclown opened this issue May 4, 2023 · 0 comments · Fixed by #7685
Closed
2 tasks done

Coverage report inconsistent #4876

oraclown opened this issue May 4, 2023 · 0 comments · Fixed by #7685
Labels
C-forge Command: forge Cmd-forge-coverage Command: forge coverage T-bug Type: bug

Comments

@oraclown
Copy link

oraclown commented May 4, 2023

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (e807429 2023-05-04T00:04:41.301525000Z)

What command(s) is the bug in?

forge coverage

Operating System

macOS (Apple Silicon)

Describe the bug

Description

  • forge coverage report shows seemingly-accurate percentages of tested functions for some contract files, but 0% for one that clearly has functions tested: src/ParachainRegistry.sol. The relevant test file is test/testParachainRegistry.t.sol.
  • To reproduce, run forge coverage for this repo here.
  • Example output that shows the behavior:
>>> forge coverage
[⠆] Compiling...
[⠰] Compiling 30 files with 0.8.3
[⠑] Compiling 28 files with 0.8.17
[⠰] Solc 0.8.17 finished in 2.27s
[⠒] Solc 0.8.3 finished in 4.94s
Compiler run successful
Analysing contracts...
Running tests...
| File                        | % Lines           | % Statements      | % Branches       | % Funcs         |
|-----------------------------|-------------------|-------------------|------------------|-----------------|
| src/Parachain.sol           | 50.00% (44/88)    | 50.00% (64/128)   | 100.00% (0/0)    | 50.00% (12/24)  |
| src/ParachainGovernance.sol | 100.00% (114/114) | 100.00% (121/121) | 88.16% (67/76)   | 100.00% (10/10) |
| src/ParachainRegistry.sol   | 0.00% (0/28)      | 0.00% (0/30)      | 0.00% (0/4)      | 0.00% (0/12)    |
| src/ParachainStaking.sol    | 100.00% (89/89)   | 100.00% (95/95)   | 90.00% (45/50)   | 100.00% (11/11) |
| Total                       | 77.43% (247/319)  | 74.87% (280/374)  | 86.15% (112/130) | 57.89% (33/57)  |

Apologies if this is a duplicate issue, but I didn't see the specific case searching, or here, but maybe related to this one.

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

Successfully merging a pull request may close this issue.

2 participants