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

store/types: Fix pruning opts validation #6511

Merged
merged 2 commits into from
Jun 25, 2020
Merged

Conversation

alexanderbez
Copy link
Contributor


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.
  • Code follows the module structure standards.
  • 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

@alexanderbez alexanderbez added A:automerge Automatically merge PR once all prerequisites pass. R4R labels Jun 25, 2020
@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #6511 into master will increase coverage by 0.01%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #6511      +/-   ##
==========================================
+ Coverage   56.34%   56.36%   +0.01%     
==========================================
  Files         470      470              
  Lines       28232    28234       +2     
==========================================
+ Hits        15907    15913       +6     
+ Misses      11200    11195       -5     
- Partials     1125     1126       +1     

for _, tc := range testCases {
po := NewPruningOptions(tc.keepRecent, tc.keepEvery, tc.interval)
err := po.Validate()
require.Equal(t, tc.expectErr, err != nil, "options: %v, err: %s", po, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
require.Equal(t, tc.expectErr, err != nil, "options: %v, err: %s", po, err)
if tc.expectErr {
require.Error(t, err, po)
} else {
require.NoError(t, err, po)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whyyyyy

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

ACK

@mergify mergify bot merged commit 51c35f4 into master Jun 25, 2020
@mergify mergify bot deleted the bez/fix-pruning-opts-validate branch June 25, 2020 16:41
alexanderbez added a commit that referenced this pull request Jun 25, 2020
* store/types: Fix pruning opts validation

* store/types: Add case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants