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 most of the unit tests. #1943

Merged
merged 46 commits into from
Apr 25, 2024
Merged

Fix most of the unit tests. #1943

merged 46 commits into from
Apr 25, 2024

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented Apr 19, 2024

Description

This PR fixes most of the CLI unit tests, and a lot of the other unit tests too.

Since most test are now fixed, this also tweaks the test github action workflow to sort all the failing packages into 03, and split the others among 00-02. So after this is merged, I'll update the repo settings to require 0-2 to pass (instead of just making sure they build).

Here's some info on the tests that still fail in this PR:

  • github.com/provenance-io/provenance/app - Need to fix the bank migration. Getting this panic from the umber upgrade tests: "parameter SendEnabled not registered"
  • github.com/provenance-io/provenance/cmd/provenanced/cmd:
    • cmd/provenanced/cmd/config_test.go - Need to update with updated config data.
    • cmd/provenanced/cmd/pre_upgrade_test.go - There's a TODO in the RootCmd.PersistentPreRunE about the client context that I think is causing a test to fail here.
  • github.com/provenance-io/provenance/internal/antewrapper - Still some TODOS left in here.
  • github.com/provenance-io/provenance/x/ibchooks - These all fail with "tx parse error" indicating that some codec isn't being shared/used as expected.
    • In vendor/github.com/cosmos/cosmos-sdk/x/auth/tx/decoder.go: Error coming back from unknownproto.RejectUnknownFields: unable to resolve type URL /ibc.lightclients.tendermint.v1.ClientState
    • Need to add the ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" module to the app so that the codec stuff is registered.
    • Then, need to bump the max gas because this is the new error: transaction gas exceeds maximum allowed; got: 10000000 max allowed: 4000000: tx too large
  • github.com/provenance-io/provenance/x/ibcratelimit/module - "tx parse error"
  • github.com/provenance-io/provenance/x/ibcratelimit/simulation - This fails because a msg that should be a gov prop is not being submitted as a gov prop.
  • github.com/provenance-io/provenance/x/oracle/simulation
    • TestSimulateMsgSendQueryOracle fails because the op msg is not okay. It has the comment "cannot get random channel because none exist".
    • TestSimulateMsgUpdateOracle fails because a msg that should be a gov prop is not being submitted as a gov prop.

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 correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

…t was added to make things compile, but is no longer needed since the rest of the functionality around it has been restored.
…pt getting wrong). Switch all uses of WaitForHeight to the testutil one.
…rn the one provided if the one provided doesn't have code 0.
…ew so that some trigger validate basic things can get the signers of messages. Fix the trigger unit tests.
…it has something in the raw log or somehow already has a Tx.
… the events that come back in a txResp. Create MutateGenesisState as an easier way to update a module's genesis state during test setup. Create createQueryCmd as a helper that will create a query command for a url. Create CmdGetAllGovProps that uses createQueryCmd to get all governance proposals.
Copy link
Contributor

coderabbitai bot commented Apr 19, 2024

Important

Auto Review Skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

33 files out of 91 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@SpicyLemon SpicyLemon marked this pull request as ready for review April 24, 2024 20:24
@SpicyLemon SpicyLemon requested a review from a team as a code owner April 24, 2024 20:24
@SpicyLemon SpicyLemon changed the title Fix all of the CLI unit tests Fix most of the unit tests. Apr 24, 2024
Taztingo
Taztingo previously approved these changes Apr 24, 2024
…ause TestSanctionValidatorImmediateUsingGovCmds keeps failing the race tests because the votes aren't coming in fast enough.
@SpicyLemon SpicyLemon enabled auto-merge (squash) April 24, 2024 22:16
@SpicyLemon SpicyLemon merged commit a2b8cae into main Apr 25, 2024
22 of 33 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/1760-broadcast branch April 25, 2024 15:15
@SpicyLemon
Copy link
Contributor Author

This was part of the v0.50 updates

@SpicyLemon SpicyLemon mentioned this pull request Apr 25, 2024
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.

3 participants