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

refactor: TokenVoting and TokenVotingSetup tests #16

Merged
merged 33 commits into from
Apr 10, 2024

Conversation

heueristik
Copy link

@heueristik heueristik commented Mar 28, 2024

This PR refactors the

  • unit tests of TokenVoting and TokenVotingSetup
  • setup processing and upgradeability tests
  • removes redundant files
File % Stmts % Branch % Funcs % Lines Uncovered Lines
src/ 98.26 94.79 97.22 98.88
IMajorityVoting.sol 100 100 100 100
MajorityVotingBase.sol 96.15 92.5 95.45 97.22 323,331
TokenVoting.sol 100 97.5 100 100
TokenVotingSetup.sol 100 93.75 100 100
src/ERC20/ 100 100 100 100
IERC20MintableUpgradeable.sol 100 100 100 100
src/ERC20/governance/ 100 100 100 100
GovernanceERC20.sol 100 100 100 100
GovernanceWrappedERC20.sol 100 100 100 100
IGovernanceWrappedERC20.sol 100 100 100 100
All files 98.57 96.09 98 99.03

Task ID: OS-1121

@heueristik heueristik changed the title refactor: tests refactor: TokenVoting and TokenVotingSetup tests Apr 3, 2024
Copy link

@novaknole novaknole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't gone through the whole PR. Only reviewed this unit test of token-voting. I want to first get opinions and whether it makes sense for me to continue reviewing.

  • The token-voting unit test file is super big.
  • It's really not unit testing because it uses dao and tokens and doesn't mock calls. So not sure why we call it unit test at all.
  • I noticed the tendency that most of the tests retests things again and again, which clearly makes the file increase. The 3500 line for token-voting in my opinion is still huge and unmanageable. See my half-review on the PR.

I added my reviews, but stopped in the middle because none of you might agree with me, so I might be reviewing such details for no reason. As for the security thing, at first glance, it's testing all flows, but it took me quite some time to understand the token voting and not sure whether it's worth it to re-learn it at this point.

heueristik and others added 2 commits April 8, 2024 16:30
Co-authored-by: Giorgi Lagidze <[email protected]>
Copy link

@jordaniza jordaniza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looked like a lot of work. Thank you for getting it done.

Copy link

@clauBv23 clauBv23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let some minor comments

Copy link

@clauBv23 clauBv23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@heueristik heueristik merged commit c355d7f into develop Apr 10, 2024
7 checks passed
@heueristik heueristik deleted the feat/test-refactoring branch April 10, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants