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: increase x/oracle unit test coverage #798

Merged
merged 9 commits into from
Apr 12, 2022
Merged

Conversation

RafilxTenfen
Copy link
Contributor

@RafilxTenfen RafilxTenfen commented Apr 12, 2022

Description

  • Add unit test to
    • x/oracle/keeper/msg_server_test.go
    • x/oracle/keeper/params_test.go
    • x/oracle/keeper/reward_test.go
    • x/oracle/types/ballot_test.go
    • x/oracle/types/codec_test.go
    • x/oracle/types/genesis_test.go
    • x/oracle/types/msgs_test.go

helps: #661


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 appropriate labels to the PR
  • 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
  • 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)

@RafilxTenfen RafilxTenfen requested a review from a team as a code owner April 12, 2022 01:17
@RafilxTenfen RafilxTenfen self-assigned this Apr 12, 2022
@RafilxTenfen RafilxTenfen requested a review from a team as a code owner April 12, 2022 01:20
Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

Nice!! 🚀

x/oracle/keeper/reward_test.go Outdated Show resolved Hide resolved
x/oracle/types/ballot_test.go Outdated Show resolved Hide resolved
x/oracle/types/ballot_test.go Outdated Show resolved Hide resolved
x/oracle/types/msgs_test.go Outdated Show resolved Hide resolved
x/oracle/types/test_utils.go Show resolved Hide resolved
x/oracle/types/test_utils.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #798 (24c185d) into main (f0389b7) will increase coverage by 1.12%.
The diff coverage is 80.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #798      +/-   ##
==========================================
+ Coverage   49.77%   50.90%   +1.12%     
==========================================
  Files          64       64              
  Lines        9426     9428       +2     
==========================================
+ Hits         4692     4799     +107     
+ Misses       4486     4385     -101     
+ Partials      248      244       -4     
Impacted Files Coverage Δ
x/oracle/types/test_utils.go 49.55% <80.95%> (+7.16%) ⬆️
x/oracle/types/vote.go 95.00% <0.00%> (-5.00%) ⬇️
x/ibctransfer/keeper/keeper.go 77.02% <0.00%> (-0.90%) ⬇️
x/oracle/keeper/keeper.go 77.72% <0.00%> (-0.21%) ⬇️
x/leverage/keeper/keeper.go 47.53% <0.00%> (-0.13%) ⬇️
x/leverage/simulation/operations.go 91.66% <0.00%> (-0.03%) ⬇️
x/leverage/keeper/invariants.go 57.57% <0.00%> (ø)
x/leverage/keeper/msg_server.go 0.96% <0.00%> (+0.02%) ⬆️
x/leverage/module.go 57.14% <0.00%> (+0.89%) ⬆️
x/oracle/keeper/reward.go 86.04% <0.00%> (+6.97%) ⬆️
... and 5 more

Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

Just one nit but LGTM! 😄

x/oracle/types/msgs_test.go Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 060fbfe into main Apr 12, 2022
@mergify mergify bot deleted the rafilx/test/oracle branch April 12, 2022 16:35
mergify bot pushed a commit that referenced this pull request Apr 12, 2022
## Description

- Add unit test to
  -  `x/oracle/keeper/msg_server_test.go`
  - `x/oracle/keeper/params_test.go`
  - `x/oracle/keeper/reward_test.go`
  - `x/oracle/types/ballot_test.go`
  - `x/oracle/types/codec_test.go`
  - `x/oracle/types/genesis_test.go`
  - `x/oracle/types/msgs_test.go`

helps: #661

----

### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added appropriate labels to the PR
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)

(cherry picked from commit 060fbfe)
adamewozniak pushed a commit that referenced this pull request Apr 12, 2022
## Description

- Add unit test to
  -  `x/oracle/keeper/msg_server_test.go`
  - `x/oracle/keeper/params_test.go`
  - `x/oracle/keeper/reward_test.go`
  - `x/oracle/types/ballot_test.go`
  - `x/oracle/types/codec_test.go`
  - `x/oracle/types/genesis_test.go`
  - `x/oracle/types/msgs_test.go`

helps: #661

----

### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added appropriate labels to the PR
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)

(cherry picked from commit 060fbfe)

Co-authored-by: Rafael Tenfen <rafaeltenfen.rt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants