-
Notifications
You must be signed in to change notification settings - Fork 241
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
Problem: reopen ica account is not tested #1234
Conversation
WalkthroughThe changes primarily revolve around enhancing the functionality and reliability of the integration tests in the Changes
Poem
TipsChat with CodeRabbit Bot (
|
d105830
to
4334aa1
Compare
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 (2)
- integration_tests/ibc_utils.py (2 hunks)
- integration_tests/test_ica_precompile.py (7 hunks)
Additional comments: 8
integration_tests/ibc_utils.py (1)
- 589-595: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [578-595]
The function
wait_for_check_channel_ready
has been updated to accept a new parametertarget
which is used to check the state of the channel. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.integration_tests/test_ica_precompile.py (7)
23-27: The import of the new function
wait_for_new_blocks
is correctly placed in alphabetical order.180-191: The function
wait_for_packet_log
has been renamed and updated to include a new parameterstatus
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.204-216: The
get_next_channel
function is now called withcli_controller
andconnid
as arguments. This change seems to be in line with the new functionality.260-266: The
wait_for_packet_log
function is called with the newstatus
argument. This change seems to be in line with the new functionality.303-314: The
submit_msgs
function has been updated to include a newtimeout
value. This change seems to be in line with the new functionality.324-338: The
get_next_channel
function is now called withcli_controller
andconnid
as arguments. This change seems to be in line with the new functionality.341-360: The new function
wait_for_new_blocks
is used correctly. This change seems to be in line with the new functionality.
Co-authored-by: yihuang <[email protected]> Signed-off-by: mmsqe <[email protected]>
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 ignored due to filter (1)
- nix/sources.json
Files selected for processing (1)
- integration_tests/test_ica_precompile.py (7 hunks)
Additional comments: 6
integration_tests/test_ica_precompile.py (6)
115-121: The
wait_for_check_tx
function is now being used to wait for a transaction to be processed. This is a good change as it makes the code more robust by ensuring that the transaction has been processed before proceeding. However, it's important to ensure that thewait_for_check_tx
function handles all possible transaction statuses correctly.179-190: The
wait_for_packet_log
function has been introduced to wait for a specific log event. This is a good change as it makes the code more robust by ensuring that the expected log event has occurred before proceeding. However, it's important to ensure that thewait_for_packet_log
function handles all possible log events correctly.193-194: The
test_sc_call
function has been marked as flaky. This is a good practice for tests that intermittently fail. However, it's important to investigate the root cause of the flakiness and fix it to improve the reliability of the tests.204-216: The
get_next_channel
function is now being called withcli_controller
andconnid
as arguments. This is a good change as it makes the code more flexible by allowing the next channel to be determined dynamically. However, it's important to ensure that theget_next_channel
function handles all possible scenarios correctly.324-329: The
wait_for_packet_log
function is being used to wait for a specific log event after a status change. This is a good change as it makes the code more robust by ensuring that the expected log event has occurred before proceeding. However, it's important to ensure that thewait_for_packet_log
function handles all possible log events correctly.309-314: The
submit_msgs
function is now being called with a timeout value. This is a good change as it makes the code more robust by allowing the function to timeout if it takes too long to complete. However, it's important to ensure that thesubmit_msgs
function handles the timeout correctly.
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: 1
Configuration used: CodeRabbit UI
Files selected for processing (3)
- integration_tests/ibc_utils.py (4 hunks)
- integration_tests/test_ica_precompile.py (7 hunks)
- scripts/run-integration-tests (1 hunks)
Files skipped from review due to trivial changes (1)
- scripts/run-integration-tests
Additional comments: 9
integration_tests/ibc_utils.py (3)
1-3: The
os
module has been imported to use itssetsid
function for creating a new session for the subprocess. This is a good practice as it allows the subprocess to run independently of the parent process.179-198: The
prepare_network
function has been updated to launch a subprocess forrly
ifis_hermes
is False. This is a good practice as it allows the function to support bothhermes
andrly
relayers. However, ensure that therly
command and its arguments are correct and that therly
executable is available in the system's PATH.601-607: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [591-607]
The
wait_for_check_channel_ready
function now accepts an additionaltarget
parameter, which defaults to "STATE_OPEN". This is a good practice as it allows the function to wait for the channel to reach a specific state. However, ensure that thetarget
parameter is always one of the valid channel states.integration_tests/test_ica_precompile.py (6)
179-190: The
wait_for_packet_log
function is introduced to wait for a specific log event. This is a good practice as it ensures that the test waits for the specific event before proceeding, reducing the chance of flaky tests.203-215: The
channel_id
variable is introduced and used in theregister_acc
function. This is a good practice as it makes the code more readable and maintainable.259-265: The
wait_for_packet_log
function is used to wait for a specific log event. This is a good practice as it ensures that the test waits for the specific event before proceeding, reducing the chance of flaky tests.280-286: The
wait_for_packet_log
function is used again to wait for a specific log event. This is a good practice as it ensures that the test waits for the specific event before proceeding, reducing the chance of flaky tests.302-313: The
wait_for_packet_log
function is used again to wait for a specific log event. This is a good practice as it ensures that the test waits for the specific event before proceeding, reducing the chance of flaky tests.323-357: The
wait_for_check_channel_ready
function is used to wait for the channel to be in a specific state. This is a good practice as it ensures that the test waits for the specific state before proceeding, reducing the chance of flaky tests.
e65c0c0
to
e56cf41
Compare
1aa866f
to
38319c1
Compare
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 ignored due to filter (3)
- integration_tests/poetry.lock
- integration_tests/pyproject.toml
- nix/sources.json
Files selected for processing (2)
- integration_tests/test_ica.py (2 hunks)
- integration_tests/test_ica_precompile.py (9 hunks)
Additional comments: 11
integration_tests/test_ica_precompile.py (6)
78-82: The
submit_msgs
function now includes a new parametermsg_num
with a default value of 2. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.88-94: The
submit_msgs
function call is updated to pass themsg_num
parameter. This change seems to be correct as it allows for the generation of a variable number of messages.116-122: The previous comment about the potential issue when
timeout
is equal tono_timeout
is still valid. Consider adjusting the condition to include this case.180-191: The
assert_packet_result
function is replaced with the newwait_for_packet_log
function. This change seems to be correct as it includes a retry mechanism.203-227: The
test_sc_call
function has been updated to include changes related to gas and channel ID handling. Ensure that these changes do not affect the expected behavior of the function.334-362: The
test_sc_call
function now includes additional assertions and function calls. Ensure that these changes do not affect the expected behavior of the function.integration_tests/test_ica.py (5)
16-27: The
ibc
fixture has been updated to include a new parameterrelayer
. Ensure that all calls to this fixture throughout the codebase have been updated to match the new signature.35-49: The
register_acc
helper function has been added. It registers an interchain account and waits for the channel to be ready. It then queries the interchain account and returns the account address and channel ID. This function seems to be well-structured and follows good practices.57-70: The
generated_tx_txt
helper function has been added. It generates a transaction to send to the host chain and writes it to a file. The function seems to be well-structured and follows good practices.74-86: The
submit_msgs
helper function has been added. It submits a transaction on the host chain on behalf of the interchain account and waits for the transaction to be processed. The function seems to be well-structured and follows good practices.88-100: The
test_ica
function has been refactored to use the new helper functions. It tests the process of submitting large transactions to trigger a timeout, reopening the interchain account after the channel gets closed, and submitting normal transactions. The function seems to be well-structured and follows good practices.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
===========================================
- Coverage 36.89% 16.67% -20.23%
===========================================
Files 115 79 -36
Lines 10255 5786 -4469
===========================================
- Hits 3784 965 -2819
+ Misses 6097 4743 -1354
+ Partials 374 78 -296 |
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit