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

Feat/test improvements #46

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Conversation

JohnGuilding
Copy link
Collaborator

@JohnGuilding JohnGuilding commented Sep 18, 2024

This PR:

  • Extracts duplicate logic from tests into fewer base tests. As opposed from having many base tests with the same logic
  • Renames some stuff
  • Fixes a load of compile warnings

Might be a difficult one to review without good context on how the tests are structured. Would try:

  1. Verify the assertions haven't fundamentally changed. Most of the changes in the test files themselves are just renames or some sort/changing parameters passed into test helper functions
  2. Focus on Base test files.
    • That Base.t.sol has everything you would expect
    • Review use of computeEmailAuthAddress as that is a virtual function in Base.t.sol and is implemented in other base tests
    • Review use of deployModule as that is a virtual function in Base.t.sol and is implemented in other base tests

There is still some work to be done here, for example abstracting away handleRecovery helper functions into fewer base test files. That will be covered in a future PR that can be merged on top of the audit fixes

@JohnGuilding JohnGuilding changed the base branch from main to feat/body-parsing September 18, 2024 20:15
@JohnGuilding JohnGuilding marked this pull request as ready for review October 2, 2024 14:13
@@ -14,6 +14,7 @@
"not-rely-on-time": "off",
"one-contract-per-file": "off",
"var-name-mixedcase": "off",
"immutable-vars-naming": "off"
"immutable-vars-naming": "off",
"no-console": "warn"
Copy link
Contributor

@wshino wshino Oct 21, 2024

Choose a reason for hiding this comment

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

Thank you, I sometimes forget to remove the console.log

@@ -25,35 +23,38 @@ contract EmailRecoveryManager_Integration_Test is
}

function test_RevertWhen_HandleAcceptanceCalled_BeforeConfigureRecovery() public {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay to remove this vm.prank?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it is unnecessary when calling instance1.uninstallModule and similar functions on instance1

Copy link
Contributor

@wshino wshino left a comment

Choose a reason for hiding this comment

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

reviewed and approved.

wshino

This comment was marked as duplicate.

@JohnGuilding JohnGuilding merged commit 8a087ae into feat/body-parsing Oct 21, 2024
7 checks passed
@JohnGuilding JohnGuilding deleted the feat/test-improvements branch October 21, 2024 06:25
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.

2 participants