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

e2e: verify disabled ics27 host params #6067

Merged

Conversation

gjermundgaraba
Copy link
Contributor

@gjermundgaraba gjermundgaraba commented Mar 27, 2024

Description

Extends an existing e2e test to not just check that the host param shows as disabled, but also that the interchain account packets are stopped as expected.

closes: #2118


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/). (Comment: N/A)
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog) (Comment: N/A)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Summary by CodeRabbit

  • Tests
    • Enhanced testing for interchain account functionalities, including better validation of token transfers and error handling. Ensured tests cover scenarios before and after disabling the host to verify packet flow control.

Copy link
Contributor

coderabbitai bot commented Mar 27, 2024

Walkthrough

The update to params_test.go enhances the testing of interchain account functionality, focusing on the behavior before and after disabling the host. It includes additional package imports for improved test capabilities and revises the test logic to verify the flow of interchain account packets, particularly emphasizing token transfers and error handling under different host conditions.

Changes

File Path Change Summary
.../interchain_accounts/params_test.go Added imports; updated tests for account setup, relayers, interchain functionality, and host enable/disable scenarios.

Assessment against linked issues

Objective Addressed Explanation
Add e2e test for modifying ics27 host params (#2118)
Ensure host is enabled and packets can be received (#2118)
Test allowed and non-allowed messages execution (#2118)
Verify packets are not received after host is disabled (#2118)

Related issues

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.yml

Commits Files that changed from the base of the PR and between eecfa5c and f95aabc.
Files selected for processing (1)
  • e2e/tests/interchain_accounts/params_test.go (5 hunks)
Additional comments: 7
e2e/tests/interchain_accounts/params_test.go (7)
  • 8-8: Consider using a more precise time package if only specific functionalities of the time package are used, to avoid importing unnecessary functionalities.
  • 5-22: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [10-29]

The addition of new imports seems appropriate for the extended test functionalities, such as handling mathematical operations, bank types, and IBC-specific types. Ensure that all imported packages are used within the test to avoid unnecessary dependencies.

  • 121-122: The setup of relayers and channels between two chains is crucial for the test. Ensure that error handling is properly implemented for the SetupChainsRelayerAndChannel function to gracefully handle any setup failures.
  • 127-131: Creating users on both Chain A and Chain B is a good practice for testing interchain account functionality. However, ensure that the token amounts used for testing (testvalues.StartingTokenAmount) are consistent and realistic to avoid any misleading test outcomes.
  • 140-168: The test block "ensure ica packets are flowing before disabling the host" is well-structured and covers important aspects such as registering an interchain account and verifying its existence. However, consider adding more detailed comments explaining the rationale behind each sub-test for better readability and maintainability.
  • 137-172: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [169-180]

Disabling the host is a critical part of this test. The conditional logic based on chainBVersion and the use of governance proposals to change parameters are correctly implemented. Ensure that the governance proposal execution (ExecuteAndPassGovV1Proposal and ExecuteAndPassGovV1Beta1Proposal) includes proper error handling and validation of the proposal's success.

  • 196-266: The test block "ensure that ica packets are not flowing" is comprehensive, covering the funding of the interchain account, attempting a transaction, and verifying no tokens were transferred. Additionally, the verification of the acknowledgement error is a good practice. Consider adding a cleanup step to revert any changes made during the test, such as disabling the host, to ensure the test environment is clean for subsequent tests.

@gjermundgaraba gjermundgaraba force-pushed the e2e-test-ics27-host-params branch from f95aabc to 77054a4 Compare March 27, 2024 17:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.yml

Commits Files that changed from the base of the PR and between eecfa5c and 77054a4.
Files selected for processing (1)
  • e2e/tests/interchain_accounts/params_test.go (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • e2e/tests/interchain_accounts/params_test.go

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Looks fabulous to me. Thank you, @gjermundgaraba!

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

lgtm! squeaky clean, left just a tiny nit. Thanks @gjermundgaraba!

e2e/tests/interchain_accounts/params_test.go Show resolved Hide resolved
Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

Looks great thank you @gjermundgaraba 🥇 !

@crodriguezvega crodriguezvega merged commit 71d1014 into cosmos:main Apr 2, 2024
75 checks passed
@gjermundgaraba gjermundgaraba deleted the e2e-test-ics27-host-params branch April 2, 2024 14:13
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.

Add e2e test for ics27 host params
4 participants