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 for libraries is not updating #7054

Closed
2 tasks done
snreynolds opened this issue Feb 8, 2024 · 3 comments · Fixed by #7510
Closed
2 tasks done

forge coverage for libraries is not updating #7054

snreynolds opened this issue Feb 8, 2024 · 3 comments · Fixed by #7510
Labels
T-bug Type: bug

Comments

@snreynolds
Copy link

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 (a5efe4f 2024-02-08T00:16:00.244105000Z)

What command(s) is the bug in?

forge coverage

Operating System

macOS (Apple Silicon)

Describe the bug

I am writing unit tests for some libraries and am getting 0% coverage with forge coverage. Feel free to look at this branch as an example! Uniswap/relayer#57

@snreynolds snreynolds added the T-bug Type: bug label Feb 8, 2024
@gakonst gakonst added this to Foundry Feb 8, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 8, 2024
@0xalpharush
Copy link
Contributor

0xalpharush commented Feb 9, 2024

I believe this is a duplicate of #2567

EDIT: the PR that is referenced in the issue says:

This does not currently handle cases where using for is used for internal libraries since it seems like we lose information on what libraries were bound to what types..

A potential workaround is calling the library explicitly e.g. MyLib.helper(MyType) instead of using MyLib for MyType

@snreynolds
Copy link
Author

@0xalpharush

I moved to using the library explicitly and I'm still not seeing updates in forge coverage. See commits here Uniswap/relayer#57

@superical
Copy link

@0xalpharush I'm having a similar issue. I've tried calling my library functions explicitly and still don't see the coverage being updated. Are there other workarounds to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants