-
Notifications
You must be signed in to change notification settings - Fork 851
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
fix(tests): Fix post-upgrade transactions in automated upgrade tests #2311
Conversation
Warning Rate Limit Exceeded@GAtom22 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 37 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates to the end-to-end (e2e) test suite primarily focus on enhancing code readability and maintainability through structured data usage and command execution improvements. These changes include adopting a new struct for query arguments, adding functionality for executing and testing transactions, refining the process of retrieving and testing account balances, adjusting command flags, and introducing ProtoCodec for serialization. These updates aim to optimize test operations and data handling within the suite. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (7)
- tests/e2e/e2e_suite_test.go (3 hunks)
- tests/e2e/tx.go (1 hunks)
- tests/e2e/upgrade/balances.go (1 hunks)
- tests/e2e/upgrade/balances_test.go (1 hunks)
- tests/e2e/upgrade/exec.go (1 hunks)
- tests/e2e/upgrade/manager.go (4 hunks)
- tests/e2e/upgrade/queryexec.go (1 hunks)
Files skipped from review due to trivial changes (1)
- tests/e2e/e2e_suite_test.go
Additional comments: 9
tests/e2e/upgrade/exec.go (1)
- 31-35: The addition of
--output=json
,--fees=500000000000aevmos
, and--yes
flags to theCreateModuleTxExec
method enhances the command's functionality by specifying the output format, adjusting the fees, and enabling automatic confirmation. These changes align with best practices for clarity and explicit command behavior in scripts.tests/e2e/upgrade/balances.go (2)
- 12-36: The
GetBalance
function correctly implements the process of constructing a query command using theQueryArgs
struct and executing it to retrieve balance information. The error handling is thorough, ensuring that any execution or parsing errors are caught and reported. The use ofQueryArgs
for encapsulating query parameters is a good practice for maintainability and readability.- 38-45: The
UnpackBalancesResponse
function demonstrates good practice in error handling and code clarity by checking for errors during the unmarshalling process and returning a clear error message if needed. This function is a good example of separating concerns by handling the specific task of parsing the balance query response.tests/e2e/upgrade/queryexec.go (2)
- 10-34: The introduction of the
QueryArgs
struct and itsValidate
method is a positive change, enhancing the robustness of the query execution process by ensuring that all necessary fields are populated before executing a query. This approach improves code maintainability and readability.- 36-59: Refactoring
CreateModuleQueryExec
to accept aQueryArgs
struct simplifies the function's signature and makes the code more readable. The validation step before building the command is a good practice, ensuring that the function operates on a valid set of arguments.tests/e2e/upgrade/balances_test.go (1)
- 15-69: The test cases for
UnpackBalancesResponse
are well-structured and cover various scenarios, including success, empty balances, and invalid output. The use of table-driven tests is a best practice in Go, facilitating the addition of new test cases and ensuring that the function behaves correctly under different conditions.tests/e2e/tx.go (1)
- 15-64: The
executeTransactions
andsendBankTransfer
methods demonstrate a clear and logical flow for executing transactions and verifying their effects. The use of context for cancellation, error handling, and the regex check for the gas estimate message are all best practices. However, ensure that the hardcoded receiver address and themykey
string are appropriate for all testing scenarios or consider making them configurable.tests/e2e/upgrade/manager.go (2)
- 63-79: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [20-76]
The addition of the
ProtoCodec
field to theManager
struct and its initialization in theNewManager
function is a significant improvement, enabling the use of protobuf for encoding and decoding. This change aligns with modern best practices for handling data serialization in distributed systems.
- 341-345: The modification of the
getVotingPeriod
method to use theCreateModuleQueryExec
with aQueryArgs
struct instead of separate string arguments is a good practice. It simplifies the method signature and leverages theQueryArgs
struct's validation, enhancing code readability and maintainability.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2311 +/- ##
==========================================
- Coverage 70.45% 70.29% -0.16%
==========================================
Files 293 294 +1
Lines 22559 22617 +58
==========================================
+ Hits 15893 15899 +6
- Misses 5800 5852 +52
Partials 866 866
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- tests/e2e/upgrade/balances.go (1 hunks)
- tests/e2e/upgrade/manager.go (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- tests/e2e/upgrade/balances.go
- tests/e2e/upgrade/manager.go
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.
LGTM!! Great work @MalteHerrmann!!
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.
LGTM. Need to fix the github actions
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.
Description
This PR fixes the post-upgrade transaction that is being sent in the automated upgrade tests.
There are a bunch of improvements and refactors bundled with this main change:
QueryArgs
type and refactor query calls inqueryexec.go
tx.go
which holds all methods related to the post-upgrade transactionsbalances.go
with utilities to parse the balances query responseCloses ENG-2492
Summary by CodeRabbit