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

fix: compatibility test change #2063

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

insumity
Copy link
Contributor

@insumity insumity commented Jul 18, 2024

Description

Compatibility test runs the provider for version v4.4.0 but in v4.4.0 this PR's removed testcase is not failing:

2024/07/18 18:17:58 expected error not raised: expected: 'a validator has assigned the consumer key already: consumer key is already in use by a validator', got 'gas estimate: 32519
{"height":"0","txhash":"110BA23D8388914624EC58F8842683B7DC238635CE93FD69F20A28E27541B9D2","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
'

The testcase starts failing after the change performed here.

This PR removes this testcase so that the compatibility test does not complain. Note however, that the removed testcase still resides here (e.g., in the happy-path) and hence we do not miss anything by removing this testcase from the compatibility test.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if the change is state-machine breaking
  • Confirmed this PR does not introduce changes requiring state migrations, OR migration code has been added to consumer and/or provider modules
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry to CHANGELOG.md
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed
  • If this PR is library API breaking, bump the go.mod version string of the repo, and follow through on a new major release

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! the type prefix if the change is state-machine breaking
  • confirmed this PR does not introduce changes requiring state migrations, OR confirmed migration code has been added to consumer and/or provider modules
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

Summary by CodeRabbit

  • Bug Fixes
    • Removed a test case that checked for operation failure when a consumer public key is assigned by the same validator, refining the testing logic.
    • Updated the remaining test case to focus on failure conditions related to consumer public keys assigned by different validators.

@github-actions github-actions bot added the C:Testing Assigned automatically by the PR labeler label Jul 18, 2024
@MSalopek
Copy link
Contributor

MSalopek commented Jul 18, 2024

I don't think that removing a valid test case that confirms that a key is already in use is a good solution.

It seems that the test is removed from the compatibility test traces. It will still remain in the happy path tests.

Sorry for the confusion, e2e tests are a bit difficult to follow.

@insumity insumity marked this pull request as ready for review July 19, 2024 07:12
@insumity insumity requested a review from a team as a code owner July 19, 2024 07:12
Copy link
Contributor

coderabbitai bot commented Jul 19, 2024

Walkthrough

Walkthrough

The recent changes involve the removal of a specific test case within the compstepsStartConsumerChain function, which previously validated the failure of assigning a consumer public key by the same validator. This adjustment shifts the focus of the testing logic to a different failure condition related to key assignment by another validator, indicating an update in test coverage or requirements.

Changes

File Path Change Summary
tests/e2e/steps_compatibility.go Removed a test case that checked for failure when a consumer public key is assigned by the same validator. Focus shifted to failure conditions with key assignment by another validator.

Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fde751e and d9f7252.

Files selected for processing (1)
  • tests/e2e/steps_compatibility.go (1 hunks)
Additional context used
Path-based instructions (1)
tests/e2e/steps_compatibility.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations. Only report issues that you have a high degree of confidence in.


Pattern tests/e2e/*: "Assess the e2e test code assessing sufficient code coverage for the changes associated in the pull request. Only report issues that you have a high degree of confidence in."

Additional comments not posted (3)
tests/e2e/steps_compatibility.go (3)

Line range hint 40-40:
Ensure comprehensive test coverage.

The remaining test cases should cover the necessary scenarios for consumer key assignments, including assigning keys by different validators and handling expected errors.


Line range hint 38-38:
Verify the removal of the test case.

The test case checking for an operation failure when a consumer public key is assigned by the same validator has been removed. Ensure that this scenario is covered in other tests, such as end-to-end tests, to maintain comprehensive test coverage.

Verification successful

Verify the presence of the test case or similar ones in tests/e2e/steps_compatibility.go.

We need to ensure that the scenario where a consumer public key is assigned by the same validator is still tested. Let's search for test cases in tests/e2e/steps_compatibility.go that reference the error message "consumer key is already in use by a validator".


The scenario where a consumer public key is assigned by the same validator is still covered in the tests.

The error message "consumer key is already in use by a validator" is still referenced in the tests/e2e/steps_compatibility.go file, indicating that the scenario is being tested.

  • The test case or a similar one ensuring this scenario is present and functioning as intended.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the removed test case scenario is covered in other tests.

# Test: Search for the removed test case scenario. Expect: Occurrences in other test files.
rg --type go -A 5 'consumer key is already in use by a validator'

Length of output: 1459


Script:

#!/bin/bash
# Description: Verify the presence of the test case or similar ones in `tests/e2e/steps_compatibility.go`.

# Test: Search for test cases referencing the error message "consumer key is already in use by a validator".
rg -A 10 'consumer key is already in use by a validator' tests/e2e/steps_compatibility.go

Length of output: 606


Line range hint 39-39:
Assess the impact on test coverage.

The removal of the test case may impact the overall test coverage. Ensure that the remaining test cases in the compstepsStartConsumerChain function cover all necessary scenarios for consumer key assignments.

Verification successful

Test Coverage Confirmed

The compstepsStartConsumerChain function includes steps to assign consumer keys, ensuring that the necessary scenarios for consumer key assignments are covered despite the removal of the specific test case.

  • The function includes an AssignConsumerPubKeyAction for the validator "carol".
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Assess the impact on test coverage.

# Test: Check the remaining test cases in the `compstepsStartConsumerChain` function. Expect: Comprehensive coverage for consumer key assignments.
rg --type go -A 5 'AssignConsumerPubKeyAction'

Length of output: 10275


Script:

#!/bin/bash
# Description: Verify the coverage of consumer key assignments in the `compstepsStartConsumerChain` function.

# Search for the `compstepsStartConsumerChain` function definition and its contents.
rg --type go -A 20 'func compstepsStartConsumerChain' 

Length of output: 1508


Script:

#!/bin/bash
# Description: Verify the coverage of consumer key assignments in the `compstepsStartConsumerChain` function.

# Search for the `compstepsStartConsumerChain` function definition and its contents, capturing 50 lines.
rg --type go -A 50 'func compstepsStartConsumerChain' 

Length of output: 3816


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 Configuration 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.

@MSalopek MSalopek added this pull request to the merge queue Jul 19, 2024
Merged via the queue into main with commit 9bdc104 Jul 19, 2024
16 of 17 checks passed
@MSalopek MSalopek deleted the insumity/fix-compatibility-test branch July 19, 2024 07:28
mergify bot pushed a commit that referenced this pull request Jul 19, 2024
init commit

(cherry picked from commit 9bdc104)
insumity added a commit that referenced this pull request Jul 19, 2024
fix: compatibility test change (#2063)

init commit

(cherry picked from commit 9bdc104)

Co-authored-by: insumity <[email protected]>
insumity added a commit that referenced this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v5.2.x C:Testing Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants