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

refactor(distribution): CLI tests using Tendermint Mock #13692

Merged
merged 16 commits into from
Nov 3, 2022

Conversation

likhita-809
Copy link
Contributor

Description

Closes: #13479


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 API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building 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

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 ! in the type prefix if API or client breaking change
  • 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
  • manually tested (if applicable)

@github-actions github-actions bot added C:CLI C:x/distribution distribution module related labels Oct 29, 2022
@codecov
Copy link

codecov bot commented Oct 29, 2022

Codecov Report

Merging #13692 (6187e84) into main (27f9851) will increase coverage by 0.56%.
The diff coverage is 100.00%.

❗ Current head 6187e84 differs from pull request most recent head 97f84a0. Consider uploading reports for the commit 97f84a0 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13692      +/-   ##
==========================================
+ Coverage   55.43%   56.00%   +0.56%     
==========================================
  Files         646      646              
  Lines       55779    55784       +5     
==========================================
+ Hits        30922    31240     +318     
+ Misses      22341    22003     -338     
- Partials     2516     2541      +25     
Impacted Files Coverage Δ
x/gov/abci.go 90.29% <100.00%> (+0.49%) ⬆️
x/distribution/simulation/operations.go 80.64% <0.00%> (-9.68%) ⬇️
x/staking/simulation/operations.go 74.54% <0.00%> (-1.38%) ⬇️
x/distribution/client/cli/tx.go 75.27% <0.00%> (+69.78%) ⬆️
x/distribution/client/cli/query.go 73.94% <0.00%> (+73.94%) ⬆️

@likhita-809 likhita-809 marked this pull request as ready for review October 29, 2022 16:40
@likhita-809 likhita-809 requested a review from a team as a code owner October 29, 2022 16:40
@@ -1,4 +1,4 @@
package testutil
package distribution
Copy link
Member

Choose a reason for hiding this comment

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

Personally, I am confused. Given that it uses depinject, isn't it more an integration test than an e2e test?
cc @kocubinski

responseQuery abci.ResponseQuery
}

func newMockTendermintRPC(respQuery abci.ResponseQuery) mockTendermintRPC {
Copy link
Member

Choose a reason for hiding this comment

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

Probably not for this PR, but could we have this in a single place? I've seen it many times and mayyybe we can centralize it

Copy link
Member

@julienrbrt julienrbrt Nov 3, 2022

Choose a reason for hiding this comment

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

Oh yeah that would be great! It should be under testutil/cli as it's used in all CLI tests.

Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

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

lgtm, a small doubt

x/distribution/client/cli/suite_test.go Outdated Show resolved Hide resolved
@tac0turtle tac0turtle enabled auto-merge (squash) November 3, 2022 13:15
@tac0turtle tac0turtle merged commit 155bcfa into main Nov 3, 2022
@tac0turtle tac0turtle deleted the likhita/distribution-cli-tests branch November 3, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor x/distribution cli tests to use TendermintMock
8 participants