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

ci: actually enable v2 system test #21539

Merged
merged 27 commits into from
Sep 26, 2024
Merged

ci: actually enable v2 system test #21539

merged 27 commits into from
Sep 26, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Sep 4, 2024

Description

Closes: #21881

ref: #20800

Noticed when doing the CI overview to Claude.
Our system tests were not running on v2, but only on simapp v1 legacy and simapp v1 depinject.
Deleting as well, scripts that shouldn't have been pushed.

Additionally, it fixes all error that popped up to make the test pass.


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, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores

    • Updated the GitHub Actions workflow for system tests to streamline execution by removing job dependencies.
  • New Features

    • Introduced a new function to manage command-line arguments based on the simulator version, enhancing flexibility in test configurations.
    • Enhanced debugging capabilities in transaction processing with additional parameters for clearer logging.
  • Bug Fixes

    • Refined the skip message for a test to provide clearer context regarding the state of unordered transaction handling.
    • Clarified comments in tests to specify urgency for pending fixes before the next release.
    • Improved error handling in transaction validation to enhance response clarity.
    • Adjusted halt conditions in the consensus process for earlier triggering based on configured values.

@julienrbrt julienrbrt requested a review from a team as a code owner September 4, 2024 10:35
Copy link
Contributor

coderabbitai bot commented Sep 4, 2024

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes involve significant updates to the GitHub Actions workflow for system tests, including the removal of dependencies for the test-system job, allowing it to run independently. The commands for "system tests v1" and "system tests v2" have been modified, with the former simplifying the command and the latter explicitly setting the COSMOS_BUILD_OPTIONS to v2. Additionally, a new function has been introduced to conditionally manage command-line arguments based on the simulator version. Error handling in various components has been refined to improve clarity and robustness.

Changes

Files Change Summary
.github/workflows/test.yml Updated commands in "system tests v1" by removing COSMOS_BUILD_OPTIONS=legacy and simplifying to make test-system. In "system tests v2," added COSMOS_BUILD_OPTIONS=v2 before executing make test-system. Removed job dependencies for test-system.
tests/systemtests/testnet_init.go Added isV2 function to check for "simapp v2" configuration and adjusted command-line arguments accordingly based on the version.
tests/systemtests/unordered_tx_test.go Changed skip message in TestUnorderedTXDuplicate for clarity; test remains skipped.
x/auth/ante/basic_test.go Updated comment in TestConsumeGasForTxSize to clarify urgency regarding pending fixes.
server/v2/cometbft/abci.go Modified error handling in CheckTx function to refine conditions under which errors are returned.
server/v2/cometbft/utils.go Adjusted error handling in intoABCITxResults and modified halt conditions in checkHalt method to trigger on equality.
server/v2/cometbft/types/errors/errors.go Updated import path for errorsmod to versioned import cosmossdk.io/errors/v2.
server/v2/cometbft/query.go Updated import path for errorsmod to versioned import cosmossdk.io/errors/v2.
server/v2/cometbft/streaming.go Enhanced error information in streamDeliverBlockChanges function by extracting detailed error data.
server/v2/cometbft/go.mod Updated dependency version for cosmossdk.io/errors and reverted indirect requirement for cosmossdk.io/errors/v2.

Assessment against linked issues

Objective Addressed Explanation
Ensure TxResult.Code reflects the correct transaction status (21881) The changes do not address the core issue of incorrect transaction result codes.

Possibly related PRs

Suggested labels

C:x/staking, C:x/gov, C:x/slashing, C:x/distribution, C:x/mint, C:x/bank, C:x/params, C:x/evidence, C:x/upgrade, C:x/feegrant, C:x/authz, C:x/group, C:x/nft, C:x/consensus, C:collections, C:x/circuit, C:x/accounts, C:x/protocolpool, C:x/epochs, C:x/accounts/lockup, C:x/accounts/multisig

Suggested reviewers

  • sontrinh16
  • kocubinski
  • testinginprod
  • tac0turtle
  • julienrbrt

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between daef054 and 1c4061c.

Files selected for processing (1)
  • .github/workflows/test.yml (2 hunks)
Additional comments not posted (2)
.github/workflows/test.yml (2)

180-180: Looks good!

The removal of the COSMOS_BUILD_OPTIONS=legacy environment variable simplifies the command for running the v1 system tests.


190-190: LGTM!

The addition of the COSMOS_BUILD_OPTIONS=v2 environment variable ensures that the v2 system tests are executed with the appropriate build options.

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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1c4061c and e0337c5.

Files selected for processing (6)
  • Makefile (1 hunks)
  • client/grpc/cmtservice/status_test.go (1 hunks)
  • client/v2/autocli/query_test.go (1 hunks)
  • tests/systemtests/testnet_init.go (3 hunks)
  • tests/systemtests/unordered_tx_test.go (1 hunks)
  • x/auth/ante/basic_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • Makefile
  • client/grpc/cmtservice/status_test.go
  • x/auth/ante/basic_test.go
Additional context used
Path-based instructions (3)
tests/systemtests/unordered_tx_test.go (3)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

tests/systemtests/testnet_init.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

client/v2/autocli/query_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (5)
tests/systemtests/unordered_tx_test.go (1)

Line range hint 14-47: LGTM!

The code changes in the TestUnorderedTXDuplicate function are approved. The removal of the t.Skip statement indicates that the test case is now expected to run without being skipped, suggesting that the conditions or dependencies that warranted the skip have been addressed.

The test function follows a clear scenario-based approach and provides comprehensive validation of the unordered transaction handling functionality.

tests/systemtests/testnet_init.go (3)

17-20: LGTM!

The code changes are approved.


66-70: LGTM!

The code changes are approved.


124-127: LGTM!

The code changes are approved.

client/v2/autocli/query_test.go (1)

Line range hint 1-1: Test enabled.

Removing the t.Skip() call enables the TestAddressValidation test. This indicates that any underlying issues related to keyring instantiation have been resolved or the test is now deemed ready for execution.

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, codebase verification and nitpick comments (1)
client/grpc/cmtservice/status_test.go (1)

17-17: Acknowledge the plan to rewrite the test as a system test.

The comment indicates that the test is to be rewritten as a system test, which is a good approach for testing the functionality at a higher level.

Consider creating a GitHub issue to track the task of rewriting the test and add a TODO comment with the issue number for better traceability:

-	t.Skip() // Rewrite as system test
+	t.Skip() // TODO: Rewrite as system test (https://github.com/cosmos/cosmos-sdk/issues/<issue-number>)
Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1c4061c and e0337c5.

Files selected for processing (6)
  • Makefile (1 hunks)
  • client/grpc/cmtservice/status_test.go (1 hunks)
  • client/v2/autocli/query_test.go (1 hunks)
  • tests/systemtests/testnet_init.go (3 hunks)
  • tests/systemtests/unordered_tx_test.go (1 hunks)
  • x/auth/ante/basic_test.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • Makefile
  • x/auth/ante/basic_test.go
Additional context used
Path-based instructions (4)
client/grpc/cmtservice/status_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

tests/systemtests/unordered_tx_test.go (3)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

tests/systemtests/testnet_init.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

client/v2/autocli/query_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (6)
tests/systemtests/unordered_tx_test.go (1)

14-14: LGTM! The test for duplicate transactions in the unordered transaction pool is now enabled.

The test TestUnorderedTXDuplicate was previously skipped due to missing functionality in v2. By removing the skip statement, the test will now run and validate the behavior of duplicate transactions in the unordered transaction pool. This improves the test coverage for the unordered transaction pool functionality.

The test setup and assertions seem appropriate for the scenario being tested.

tests/systemtests/testnet_init.go (4)

17-20: LGTM!

The code changes are approved.


65-71: LGTM!

The code changes are approved.


123-127: LGTM!

The code changes are approved.


Line range hint 1-217: Code conforms to the Uber Golang style guide.

No deviations from the style guide were found.

client/v2/autocli/query_test.go (1)

Line range hint 1-1: Test enabled.

Removing the t.Skip() call enables the TestAddressValidation test to run, which is a positive change. It suggests that the underlying issue related to keyring instantiation has been resolved or the test is now deemed ready for execution.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Sep 4, 2024
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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e0337c5 and 2e5d2bf.

Files selected for processing (3)
  • .github/workflows/test.yml (3 hunks)
  • tests/systemtests/testnet_init.go (4 hunks)
  • tests/systemtests/unordered_tx_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/test.yml
  • tests/systemtests/testnet_init.go
  • tests/systemtests/unordered_tx_test.go

Merged via the queue into main with commit f927e9b Sep 26, 2024
71 of 73 checks passed
@julienrbrt julienrbrt deleted the julien/system-test branch September 26, 2024 13:22
mergify bot pushed a commit that referenced this pull request Sep 26, 2024
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
(cherry picked from commit f927e9b)

# Conflicts:
#	core/server/app.go
#	server/v2/cometbft/go.mod
#	server/v2/cometbft/go.sum
#	server/v2/stf/stf.go
julienrbrt added a commit that referenced this pull request Sep 26, 2024
Co-authored-by: Julien Robert <julien@rbrt.fr>
@coderabbitai coderabbitai bot mentioned this pull request Dec 27, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release C:CLI C:server/v2 cometbft C:server/v2 stf C:server/v2 Issues related to server/v2 C:x/auth Type: Build Type: CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: server/v2/stf always returns TxResult.Code = 0
6 participants