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 #782

Merged
merged 7 commits into from
Apr 8, 2022

Conversation

RafilxTenfen
Copy link
Contributor

Description

  • Add unit test cover to x/oracle/types/denom.go and x/oracle/types/keys.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 7, 2022 21:07
@RafilxTenfen RafilxTenfen self-assigned this Apr 7, 2022
adamewozniak added a commit that referenced this pull request Apr 7, 2022
@adamewozniak adamewozniak changed the title chore: increase unit test coverage test: increase x/oracle unit test coverage Apr 7, 2022
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.

🚀

x/oracle/types/keys_test.go Outdated Show resolved Hide resolved
x/oracle/types/denom_test.go Outdated Show resolved Hide resolved
x/oracle/types/denom_test.go Outdated Show resolved Hide resolved
}{
{
val: []byte("addr________________"),
expectedKey: []byte{0x4, 0x14, 0x61, 0x64, 0x64, 0x72, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f},
Copy link
Member

Choose a reason for hiding this comment

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

Could add a comment as to the origin of these bytes - that would also clarify what the meaning would be if the test ever failed.

Copy link
Member

Choose a reason for hiding this comment

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

For example:

// keyPrefixAggregateExchangeRatePrevote | lengthPrefixed(addr)

@adamewozniak
Copy link
Collaborator

Changelog entry pls! Don't be like me

@RafilxTenfen RafilxTenfen requested a review from a team as a code owner April 7, 2022 22:54
@codecov-commenter
Copy link

Codecov Report

Merging #782 (60531d7) into main (a176fb2) will decrease coverage by 0.15%.
The diff coverage is 13.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #782      +/-   ##
==========================================
- Coverage   48.03%   47.87%   -0.16%     
==========================================
  Files          64       64              
  Lines        9329     9426      +97     
==========================================
+ Hits         4481     4513      +32     
- Misses       4581     4646      +65     
  Partials      267      267              
Impacted Files Coverage Δ
ante/fee.go 93.61% <ø> (ø)
ante/spam_prevention.go 61.76% <ø> (ø)
x/ibctransfer/keeper/keeper.go 77.92% <ø> (ø)
x/leverage/abci.go 0.00% <ø> (ø)
x/leverage/client/cli/proposal.go 72.72% <ø> (ø)
x/leverage/client/cli/query.go 0.00% <ø> (ø)
x/leverage/client/cli/tx.go 0.00% <ø> (ø)
x/leverage/client/tests/suite.go 100.00% <ø> (ø)
x/leverage/client/tests/util.go 87.69% <ø> (ø)
x/leverage/genesis.go 50.00% <ø> (ø)
... and 37 more

@RafilxTenfen RafilxTenfen merged commit 2343d70 into main Apr 8, 2022
@RafilxTenfen RafilxTenfen deleted the rafilx/increase-code-coverage branch April 8, 2022 11:56
mergify bot pushed a commit that referenced this pull request Apr 8, 2022
* chore: increasce test coverage

* rename variables

Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>

* moved test vars and const to test_utils

* add comments to keys

* fix string unit test

* add changelog

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
(cherry picked from commit 2343d70)
toteki pushed a commit that referenced this pull request Apr 8, 2022
* chore: increasce test coverage

* rename variables

Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>

* moved test vars and const to test_utils

* add comments to keys

* fix string unit test

* add changelog

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
(cherry picked from commit 2343d70)

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.

4 participants