-
Notifications
You must be signed in to change notification settings - Fork 602
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
chore: check all errors in tests #5104
Conversation
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.
Approving, but going to wait for one more internal ack before merging. Thanks!
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.
LGTM, thanks for this 🧹
Ready to merge once few nits are addressed and PR is refreshed against |
Cool, refreshing now :) |
Co-authored-by: Roman <[email protected]>
* run golangci-lint and resolve ineffectual assignment to err * go work sync * waypoint in "check all errors in tests" * 50 error checks remaining * 42 errors remaining to check in tests * all tests pass and as many errors as possible have been checked * revert enabling golangci-lint to check tests, as it would always fail afterwards * update changelog * use thelper in golangci-lint without linting every test * Update tests/e2e/containers/containers.go Co-authored-by: Roman <[email protected]> * thelper for incentives bench test * Update x/concentrated-liquidity/position_test.go Co-authored-by: Adam Tucker <[email protected]> * Update CHANGELOG.md Co-authored-by: Roman <[email protected]> * return error in SetIncentiveRecord * revert change to .golanci.yml --------- Co-authored-by: Roman <[email protected]> Co-authored-by: Adam Tucker <[email protected]>
Closes: #5060
What is the purpose of the change
This PR is designed to enhance the rigor of tests in Osmosis by checking errors whenever possible.
It also extends the changes found in:
Note that the t.Helper() thing can be a bit all or nothing, so this PR contains those changes as well. If you'd prefer to close that one, no worries :).
By applying thelper to the whole repository. This is a part of an initiative to allow Osmosis to use golangci-lint on its tests, by setting
and then progressively adding additional tools like thelper. Note to vscode users: now that we're using t.Helper() at the beginning of every test helper, you'll get these really cool inline stack traces if there's an issue with a test.
Since we want golangci-lint to pass, this PR does not yet make the change to the configuration mentioned above, but it is what was used while writing the PR.
Brief Changelog
Testing and Verifying
This change is tests, and I suppose that the best way to test it is to maybe break some tests and check out the cool stack trace? I am actually not certain, but would love to hear ideas.
Reviewing
I'd recommend reviewing
before this one, it will reduce the size of this. To make sure that this merges smoothly, I cherry picked that into this.
There are about 200-300 miscellaneous linter changes that Id need to make for us to be able to enable the linter on the tests. I'm going to open one or more additional smaller PR's for that since I know this one is already pretty big.
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes