-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add t.Parallel to unit tests #3297
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3297 +/- ##
==========================================
- Coverage 97.72% 93.01% -4.72%
==========================================
Files 153 172 +19
Lines 13390 11777 -1613
==========================================
- Hits 13085 10954 -2131
- Misses 215 729 +514
- Partials 90 94 +4 ☔ View full report in Codecov by Sentry. |
@alexandear - might you have time to review this PR, please? |
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.
Do we need to enable tparallel
and paralleltest
in golangci-lint's config to automatically verify existence of t.Parallel
in a test?
From https://golangci-lint.run/usage/linters/
tparallel detects inappropriate usage of t.Parallel() method in your Go test codes.
paralleltest detects missing usage of t.Parallel() method in your Go test.
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.
This is a good idea. There are some tests that cannot use t.Parallel because of a helper function, but those could be exceptions. Thanks, I'll investigate.
test/integration/activity_test.go
Outdated
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.
The PR's title states, "Add t.Parallel to unit tests". But changes include integration tests. Is it intentional, or we should revert changes on the integration
folder?
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.
Good point!
I'll revert the changes to the integration tests.
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
On my system, this cuts testing time by approximately half.