-
Notifications
You must be signed in to change notification settings - Fork 90
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
testutil: replace math/rand deprecation #2850
testutil: replace math/rand deprecation #2850
Conversation
@KaloyanTanev thank you for the contribution. You can run
p.s. some tests are known to be flakey, like |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2850 +/- ##
==========================================
- Coverage 53.44% 53.40% -0.05%
==========================================
Files 200 200
Lines 28011 28034 +23
==========================================
+ Hits 14971 14972 +1
- Misses 11180 11208 +28
+ Partials 1860 1854 -6 ☔ View full report in Codecov by Sentry. |
Hi @pinebit , wasn't aware of the pre-commit, thanks. I've ran only Fixed the linting. |
@KaloyanTanev you should install pre-commit This should report all possible linting errors that you're having rn |
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.
LFTM, good to merge once linter issues are fixed.
@KaloyanTanev
|
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Hmmm, a bit weird as locally the
However, running golangci-lint on its own gave me the expected linting errors:
I think it should be good after latest commit. |
Thank you @KaloyanTanev for the effort. Running a new build now, and if it succeeds we will get it merged. |
@pinebit I see one of the unit tests failed - |
This seems to be one bug I likely introduced today :(
in |
@KaloyanTanev I created separate PR for this issue #2857 because our main is also broken. Your build should succeed eventually. |
golangci-lint was on older version that did not support go1.22 yet, which causes false alarms. --- This update introduced a lot of new, deprecated and modified linters. There are a lot of changes in the files and I would advise for easier review to go over the commits, as I've tried to keep them concise, so there are only changes from one linter or if many, the changes are little. Most eye catching changes in the files are: - `testifylint`: we had quite a lot of assertions inside of go routines, this is a bit of a red flag, because as observed in [this small example](https://go.dev/play/p/WoBGMiKQDEk), a failed assertion might or might not be caught - The `golangci-lint` used in pre-commit was a default `golangci-lint` from [here](https://github.com/golangci/golangci-lint), using its default config, which made the linter pass locally all the time. This is something I've observed multiple times ([dating back to my very first PR](#2850 (comment)) :)). Now the pre-commit hook is running the locally installed `golangci-lint` tool and it checks if the version is the same as the one in the pipelines. - Added `max-same-issues=0` and `max-issues-per-linter=0` so there is no limit on what we see in the output. Previously the default of 3 was used, so if there were hundreds of errors with one linter, it would have displayed only 3, which made it quite a hassle to fix. - Bump the `golangci-lint` action's version to v6. It now points where exactly the issue is, which is great! category: fixbuild ticket: #3179
rand.Seed(x)
with localrand.New(rand.NewSource(x))
;math/rand.Read(x)
withcrypto/rand.Read(x)
(not included in the issue, but deprecated as well).category: refactor
ticket: #2831