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

(test): improve IBC check in e2e tests #2558

Merged
merged 3 commits into from
Jun 21, 2024
Merged

(test): improve IBC check in e2e tests #2558

merged 3 commits into from
Jun 21, 2024

Conversation

robert-zaremba
Copy link
Member

@robert-zaremba robert-zaremba commented Jun 20, 2024

Description

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during IBC transfers with additional parameters for better control and clarity.
  • Refactor
    • Enhanced argument positioning in IBC transfer functions to improve readability and functionality.
  • Tests
    • Updated end-to-end tests to reflect new argument structures and error handling mechanisms in IBC transfer functions.

@robert-zaremba robert-zaremba requested a review from a team as a code owner June 20, 2024 11:06
Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Walkthrough

These changes enhance the SendIBC functionality in the e2e IBC tests by modifying argument positions and adding an expectedErr parameter for improved error handling. These adjustments ensure better clarity and robustness in the function calls, making the test suite more reliable and expressive in its validations.

Changes

Files Change Summary
tests/e2e/e2e_ibc_memo_test.go Modified order of arguments in testIBCTokenTransferWithMemo function calls to s.SendIBC, replacing false with an empty string "".
tests/e2e/e2e_ibc_test.go Added errQuotaExceed constant and adjusted s.SendIBC calls to include error messages and change argument positions.
tests/e2e/setup/utils.go Modified SendIBC function in E2ETestSuite struct to include an expectedErr parameter, enhancing logging and error handling.

Sequence Diagram(s)

sequenceDiagram
    participant A as E2ETestSuite
    participant B as s.SendIBC
    participant C as IBC Transfer Handler
    participant D as Logger
    
    A->>B: Call s.SendIBC with params including expectedErr
    B->>C: Execute IBC Transfer
    C->>B: Return result or error
    B-->>D: Log result based on expectedErr
    B->>A: Return result to E2ETestSuite
Loading

Poem

Amidst the code in lines so bright,
A rabbit hopped with pure delight. 🐇✨
It shuffled args in swift array,
Ensuring tests would never stray.
With logs and errors handled true,
It made the suite robust, brand new. 🌟


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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/schema.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

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.77%. Comparing base (7f05ad4) to head (9262b32).
Report is 505 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2558       +/-   ##
===========================================
- Coverage   75.38%   62.77%   -12.62%     
===========================================
  Files         100      275      +175     
  Lines        8025    15969     +7944     
===========================================
+ Hits         6050    10024     +3974     
- Misses       1589     5171     +3582     
- Partials      386      774      +388     

see 239 files with indirect coverage changes

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.

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
tests/e2e/e2e_ibc_test.go (1)

31-31: The new constant errQuotaExceed should be documented to explain its usage and significance.

tests/e2e/setup/utils.go (1)

Line range hint 58-135: Review the modifications to the SendIBC function to ensure they align with the new error handling requirements and that the retry logic is robust.

Consider adding more detailed logging and possibly separating the command construction from the execution logic to enhance readability and maintainability.

+ // Detailed logging for each step
+ s.T().Logf("Constructing command for IBC transfer...")
- // retry up to 5 times
+ // Retry logic separated for clarity
+ retryCommand := func(cmd []string) {
+     for i := 0; i < 5; i++ {
+         if i > 0 {
+             s.T().Logf("...retry %d", i+1)
+         }
+         executeCommand(cmd)
+     }
+ }
+ retryCommand(cmd)
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0da6ee7 and f35bf50.

Files selected for processing (3)
  • tests/e2e/e2e_ibc_memo_test.go (3 hunks)
  • tests/e2e/e2e_ibc_test.go (6 hunks)
  • tests/e2e/setup/utils.go (2 hunks)
Additional comments not posted (4)
tests/e2e/e2e_ibc_memo_test.go (3)

85-85: Validate that the SendIBC function is called correctly with the serialized memo JSON.


47-47: Ensure proper handling of the empty string for error scenarios in the SendIBC function call.


63-63: Ensure that the SendIBC function is called with correct parameters, especially the empty strings for memo and error.

tests/e2e/e2e_ibc_test.go (1)

141-141: Confirm that all SendIBC function calls are updated according to the new signature and are handling errors correctly.

Also applies to: 150-150, 166-166, 174-175, 182-182, 189-190, 197-197, 204-204, 215-215, 219-219, 272-272

Copy link
Collaborator

@gsk967 gsk967 left a comment

Choose a reason for hiding this comment

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

Pre-Approving , can you check once e2e-tests , it is failing

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f35bf50 and 16ee741.

Files selected for processing (1)
  • tests/e2e/setup/utils.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/e2e/setup/utils.go

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 16ee741 and 9262b32.

Files selected for processing (1)
  • tests/e2e/setup/utils.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/e2e/setup/utils.go

@gsk967 gsk967 added this pull request to the merge queue Jun 21, 2024
Merged via the queue into main with commit 5408f2d Jun 21, 2024
24 of 27 checks passed
@gsk967 gsk967 deleted the robert/e2e-ibc-tests branch June 21, 2024 11:08
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