foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.25k stars 1.73k forks source link

Coverage report's total wrong #8127

Closed ChiHaoLu closed 4 months ago

ChiHaoLu commented 4 months ago

Component

Forge

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

What version of Foundry are you on?

forge 0.2.0 (81896c5 2024-06-11T00:18:27.357467000Z)

What command(s) is the bug in?

forge coverage --report summary

Operating System

macOS (Apple Silicon)

Describe the bug

It seems that the coverage report's total includes the test and script files.

File % Lines % Statements % Branches % Funcs
src/account/AccountEntryModular.sol 100.00% (45/45) 100.00% (62/62) 100.00% (28/28) 100.00% (8/8)
src/account/base/AccountManager.sol 100.00% (21/21) 100.00% (27/27) 100.00% (10/10) 100.00% (8/8)
src/account/base/EntryManager.sol 100.00% (11/11) 100.00% (13/13) 100.00% (6/6) 100.00% (5/5)
src/account/base/FallbackManager.sol 100.00% (14/14) 100.00% (17/17) 100.00% (7/7) 100.00% (5/5)
src/account/base/SelfAuth.sol 100.00% (1/1) 100.00% (1/1) 100.00% (2/2) 100.00% (1/1)
src/account/base/ValidatorManager.sol 100.00% (33/33) 100.00% (40/40) 100.00% (12/12) 100.00% (11/11)
src/account/base/ValidatorSpace.sol 100.00% (12/12) 100.00% (14/14) 100.00% (2/2) 100.00% (6/6)
src/account/factory/AccountEntryFactory.sol 100.00% (40/40) 100.00% (49/49) 100.00% (20/20) 100.00% (14/14)
src/account/factory/AccountEntryProxy.sol 100.00% (3/3) 100.00% (5/5) 100.00% (0/0) 100.00% (3/3)
src/account/factory/CreateAccount.sol 100.00% (4/4) 100.00% (4/4) 100.00% (0/0) 100.00% (2/2)
src/account/factory/CreateAccountEntry.sol 100.00% (4/4) 100.00% (4/4) 100.00% (0/0) 100.00% (2/2)
src/account/factory/imAccountFactory.sol 100.00% (26/26) 100.00% (34/34) 100.00% (10/10) 100.00% (8/8)
src/account/handler/FallbackHandler.sol 100.00% (9/9) 100.00% (13/13) 100.00% (0/0) 100.00% (4/4)
src/account/imAccount.sol 100.00% (14/14) 100.00% (17/17) 100.00% (11/11) 100.00% (7/7)
src/account/libraries/Base64URL.sol 100.00% (14/14) 96.30% (26/27) 62.50% (5/8) 100.00% (1/1)
src/account/libraries/P256.sol 100.00% (6/6) 100.00% (9/9) 100.00% (4/4) 100.00% (2/2)
src/account/libraries/Signature.sol 100.00% (11/11) 100.00% (17/17) 100.00% (10/10) 100.00% (1/1)
src/account/libraries/WebAuthn.sol 100.00% (11/11) 100.00% (13/13) 100.00% (10/10) 100.00% (4/4)
src/account/validators/ECDSAValidator.sol 100.00% (10/10) 100.00% (14/14) 100.00% (4/4) 100.00% (5/5)
src/account/validators/ECDSAValidatorWithECDSAGuardian.sol 100.00% (54/54) 100.00% (64/64) 100.00% (24/24) 100.00% (17/17)
src/account/validators/SimpleMultiSigValidator.sol 100.00% (94/94) 100.00% (124/124) 100.00% (40/40) 100.00% (18/18)
src/account/validators/WebAuthnValidator.sol 100.00% (19/19) 100.00% (20/20) 100.00% (10/10) 100.00% (6/6)
src/account/validators/base/BaseGuardian.sol 100.00% (37/37) 100.00% (50/50) 75.00% (12/16) 100.00% (10/10)
src/account/validators/base/BaseSignature.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (1/1)
src/account/validators/base/BaseStorage.sol 100.00% (28/28) 100.00% (37/37) 100.00% (12/12) 100.00% (13/13)
src/account/validators/base/ECDSAActor.sol 100.00% (8/8) 100.00% (12/12) 100.00% (2/2) 100.00% (3/3)
src/account/validators/base/Initializable.sol 100.00% (2/2) 100.00% (2/2) 100.00% (2/2) 100.00% (1/1)
src/account/validators/base/SignatureValidator.sol 100.00% (3/3) 100.00% (4/4) 100.00% (0/0) 100.00% (2/2)
src/account/validators/base/WebAuthnActor.sol 100.00% (24/24) 100.00% (33/33) 100.00% (6/6) 100.00% (8/8)
src/paymaster/OffChainOraclePaymaster.sol 82.22% (37/45) 84.21% (48/57) 68.18% (15/22) 70.00% (7/10)
src/paymaster/PriceFeed.sol 100.00% (4/4) 100.00% (4/4) 100.00% (0/0) 100.00% (2/2)
src/paymaster/base/Paymaster.sol 0.00% (0/16) 0.00% (0/18) 0.00% (0/2) 0.00% (0/10)
Total 71.32% (1042/1461) 70.98% (1367/1926) 76.69% (329/429) 73.61% (318/432)
zerosnacks commented 4 months ago

Related: https://github.com/foundry-rs/foundry/pull/7301

Marking as duplicate of: https://github.com/foundry-rs/foundry/issues/2988