-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Update coverage of test #14326
base: master
Are you sure you want to change the base?
Update coverage of test #14326
Conversation
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @deepsea514 on file. |
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @deepsea514 on file. |
@deepsea514 You need to submit a separate pr with .calbot file changes |
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @deepsea514 on file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello ! So far so good. I left some minor text edits and a few tests that seems to be missing.
Looking at the coverage results below, it seems that CardPurchaser.sol
is still lacking tests. Also I will remove all *.flatten.sol
. It is a mistake and the flattened files should not be commited to the repo.
Thanks!
------------------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
------------------------------|----------|----------|----------|----------|----------------|
contracts/ | 53.76 | 50 | 66.07 | 54.94 | |
CardPurchaser.sol | 0 | 0 | 0 | 0 |... 170,196,197 |
KeyManager.sol | 100 | 90 | 100 | 100 | |
Kickback.flatten.sol | 0 | 0 | 0 | 0 |... 935,937,939 |
PublicLock.sol | 100 | 100 | 100 | 100 | |
Unlock.sol | 94.12 | 81.08 | 93.75 | 91.27 |... 643,644,650 |
contracts/hooks/ | 95.35 | 100 | 89.47 | 96.34 | |
CaptchaHook.sol | 100 | 100 | 100 | 100 | |
DiscountCodeHook.sol | 100 | 100 | 100 | 100 | |
ERC1155BalanceOfHook.sol | 100 | 100 | 100 | 100 | |
ERC20BalanceOfHook.sol | 100 | 100 | 100 | 100 | |
ERC721BalanceOfHook.sol | 100 | 100 | 100 | 100 | |
GitcoinHook.sol | 87.5 | 100 | 80 | 90.91 | 60,64 |
GuildHook.sol | 88.24 | 100 | 80 | 91.3 | 61,65 |
PasswordRequiredHook.sol | 86.67 | 100 | 77.78 | 91.3 | 69,73 |
TokenUriHook.sol | 100 | 100 | 100 | 100 | |
contracts/interfaces/ | 100 | 100 | 100 | 100 | |
IMintableERC20.sol | 100 | 100 | 100 | 100 | |
IPermit2.sol | 100 | 100 | 100 | 100 | |
IPublicLock.sol | 100 | 100 | 100 | 100 | |
ISwapBurner.sol | 100 | 100 | 100 | 100 | |
IUSDC.sol | 100 | 100 | 100 | 100 | |
IUniswapOracleV3.sol | 100 | 100 | 100 | 100 | |
IUniversalRouter.sol | 100 | 100 | 100 | 100 | |
IUnlock.sol | 100 | 100 | 100 | 100 | |
IWETH.sol | 100 | 100 | 100 | 100 | |
contracts/interfaces/hooks/ | 100 | 100 | 100 | 100 | |
ILockKeyCancelHook.sol | 100 | 100 | 100 | 100 | |
ILockKeyExtendHook.sol | 100 | 100 | 100 | 100 | |
ILockKeyGrantHook.sol | 100 | 100 | 100 | 100 | |
ILockKeyPurchaseHook.sol | 100 | 100 | 100 | 100 | |
ILockKeyTransferHook.sol | 100 | 100 | 100 | 100 | |
ILockTokenURIHook.sol | 100 | 100 | 100 | 100 | |
ILockValidKeyHook.sol | 100 | 100 | 100 | 100 | |
contracts/mixins/ | 98.78 | 92.73 | 98.92 | 97.5 | |
MixinConvenienceOwnable.sol | 100 | 100 | 100 | 100 | |
MixinDisable.sol | 100 | 100 | 100 | 100 | |
MixinERC721Enumerable.sol | 100 | 100 | 100 | 100 | |
MixinErrors.sol | 100 | 100 | 100 | 100 | |
MixinFunds.sol | 100 | 66.67 | 100 | 88.89 | 32 |
MixinGrantKeys.sol | 100 | 100 | 100 | 100 | |
MixinKeys.sol | 96.34 | 95.31 | 96.67 | 96.3 |... 147,159,160 |
MixinLockCore.sol | 100 | 95.83 | 100 | 98.11 | 121 |
MixinLockMetadata.sol | 100 | 100 | 100 | 100 | |
MixinPurchase.sol | 100 | 98.15 | 100 | 100 | |
MixinRefunds.sol | 100 | 100 | 100 | 100 | |
MixinRoles.sol | 100 | 66.67 | 100 | 100 | |
MixinTransfer.sol | 98.28 | 79.41 | 100 | 93.9 |... 202,299,328 |
contracts/tokens/UDT/ | 20 | 15 | 13.33 | 15.15 | |
UnlockDiscountTokenV3.sol | 100 | 37.5 | 100 | 71.43 | 34,39 |
UnlockProtocolGovernor.sol | 0 | 0 | 0 | 0 |... 109,118,129 |
UnlockProtocolTimelock.sol | 0 | 0 | 0 | 0 | 12 |
contracts/tokens/UP/ | 97.73 | 66.67 | 96 | 88.46 | |
UPGovernor.sol | 94.12 | 50 | 91.67 | 94.12 | 142 |
UPSwap.sol | 100 | 57.14 | 100 | 78.26 | 64,73,83,89,95 |
UPTimelock.sol | 100 | 50 | 100 | 100 | |
UPToken.sol | 100 | 100 | 100 | 100 | |
------------------------------|----------|----------|----------|----------|----------------|
All files | 83.57 | 76.67 | 83.74 | 83.1 | |
------------------------------|----------|----------|----------|----------|----------------|
The test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please uncomment and cleanup a bunch of things.!
Also let's get @clemsos to fo a final check!
I have cleaned up things you mentioned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work ! Most of it LG
Nevertheless, running the entirety of the tests coverage suite on a mainnet fork is a not good practice and we need to avoid it.
If you need to run some of the tests on a fork, please add a coverage:mainnet
task with the RUN_FORK=1
flag. That task should run only the tests suffixed with *mainnet.js
. All the other unit tests files should run on a clean node, not load state from a fork.
Yeah, I know that but many functions are designed to run on mainnet only so coverage is falling down. |
@clemsos |
Description
Update tests to increase coverage.
Some cases, coverage is not 100% because there are mainnet features with static addresses and duplicated and private functions are not used.
Issues
Fixes #13831
Refs #13831
Checklist:
Release Note Draft Snippet