-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Bug] Fix broken consensus tests on main branch - mocking StoreBlock in persistence module #259
Conversation
Finish PR description before requesting review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Versioning OB1
Sounds good. I jumped the 🔫 on this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Olshansk LGTM, I realized you asked me to fix actor_test
before merging and I did not see that until after I had merged. I planned on following up with another PR, but was wondering if you'd be able to patch that up in this PR.
If not NBD -lmk
@andrewnguyen22 Patched, updated, pushed, verified & merged. |
Also, I just misunderstood what you meant by
|
@Olshansk can't reproduce the issue - seems fine |
@andrewnguyen22 Following up here for posterity, fix is in #282 |
## Description Fix unit tests that exist on the main branch. ## Origin Document Fixes conversation in #259: <img width="1059" alt="Screen Shot 2022-10-04 at 4 07 23 PM" src="https://user-images.githubusercontent.com/1892194/193946742-8a9f3914-86f1-4ccb-92fb-a1b025c5258a.png"> ## Issue Rather than the [core Go documentation](https://pkg.go.dev/testing), I believe [this article](https://medium.com/goingogo/why-use-testmain-for-testing-in-go-dafb52b406bc) does a better job at explaining why we had broken tests: <img width="780" alt="Screen Shot 2022-10-04 at 4 12 38 PM" src="https://user-images.githubusercontent.com/1892194/193947366-5cd62ef3-a01a-4d74-95d3-45929ee9348a.png"> Before this change, even when a unit test failed, we still got a pass: <img width="1241" alt="Screen Shot 2022-10-04 at 4 26 09 PM" src="https://user-images.githubusercontent.com/1892194/193948965-9079896e-5ab0-40dc-8f1b-f8bdcf4593c2.png"> ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [x] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Update `test_utility` target in the `Makefile` - Not ignoring the exit code of `m.Run()` in all the files where we use it (several modules) - Fix tests in the utility module: - Remove redundant tests (e.g. `TestUtilityContext_UnstakesPausedBefore` which was replaced by `TestUtilityContext_UnstakePausedBefore`) - Do not ignore `m.Run` exit code so broken tests are caught - Improve readability of some tests (whitespace) - Do not unnecessarily export helpers - Fix unit tests in the persistence module related to type casting ## Testing - [x] `make develop_test` - [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) w/ all of the steps outlined in the `README` ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have tested my changes using the available tooling - [x] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [x] I have updated the corresponding README(s); local and/or global - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
Description
Fix a small bug on main introduced by removal of
UtilityModule
'sStoreBlock
function.Issue
No associated issue. This is a quick followup to #254.
Type of change
Please mark the relevant option(s):
List of changes
StoreBlock
function on the persistence module in a consensus testStoreBlock
function in the utility moduleTesting
make develop_test
README
Required Checklist
If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)