-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Feature]: Investigate & Increase Test Coverage #426
Comments
Pasting the findings here for future reference. Reason for Coverage % NosediveCodecov shows that the % drop happened somewhere between October 28th and November 4th. Further investigation shows that the "problematic" commit was introduced by PR #379 (the commit is not actually "problematic", read further). Below is the link to all the files for which coverage was affected in this commit: Explaining the coverage file diff on Codecov in case it helps (link above): the image below shows the coverage change for contracts/src/token/erc20/extensions/capped.rs - it shows that previously this motsu test was included in the coverage report (the highlighted left column shows line numbers included in previous coverage, while the non-highlighted right column shows line numbers now excluded from coverage). In short, it seems that up until this commit, all motsu tests were included in the coverage %! This wrongly increased our coverage %. After this commit, the motsu tests were excluded from coverage. That means that the sudden 12% drop in coverage was not an anomaly, but a correction. The commit did not manually change anything to affect coverage in this way. The reason why tests were magically excluded is not yet absolutely clear, but it seems most likely that this Problems and Recommendations on Increasing Coverage %Below is a list of problems affecting our test coverage and possible mitigation steps:
Took the liberty to investigate why the number of ignored integration tests jumped 2->10, namely in Erc721 and Erc1155 contracts. The reason for this is that |
Disable code coverage for `sol!` and `sol_interface!` macros. Enforce `#[storage]` macro instead of `sol_storage!`. (`#[storage]` struct is recognized by codecov) Add missing tests to code coverage. Towards #426 --------- Co-authored-by: Daniel Bigos <[email protected]>
What is the feature you would like to see?
Problems and Recommendations on Increasing Coverage %
NOTE: for more details on each point, see #426 (comment). The below checklist is taken and updated from there.
sol!
macros (events, errors, storage) is included in test coverage. feat: improve code coverage #438IErc20::transfer
is tested by calling_update
, causing code coverage to registertransfer
as "unconvered").IErc165
-related tests exist verifying the generatedINTERFACE_ID
value is correct, but no tests exist that call<ContractName>::supports_interface
.MethodError
impls uncovered.#[public]
attr is included in coverage. feat: improve code coverage #438#[cfg(test)] mod tests
(unit tests) are included in coverage.#[motsu::test]
attributes included in test coverage.Contribution Guidelines
The text was updated successfully, but these errors were encountered: