-
Notifications
You must be signed in to change notification settings - Fork 13
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
dont flag tests which call Setenv directly or whose subtests do #33
dont flag tests which call Setenv directly or whose subtests do #33
Conversation
Setenv cannot be used in parallel tests or tests with parallel ancestors.
@mitar would you mind taking a first look at the added tests to see what's now being flagged/not-flagged, and if it addresses your comment? paralleltest/pkg/paralleltest/testdata/src/t/t_test.go Lines 166 to 219 in 7bc464a
|
Thanks. This looks great. Maybe add some test cases which use a test helper (function which calls |
Ah that's a great catch, though it's a harder case to handle with how the rest of the analyzer is written. I don't think I'll try to implement it in this PR, it would involve larger changes to the analyzer. My initial thoughts involve some sort of pre-pass to identify test helpers which call |
I like this simple approach implemented here. We are having the same issues where if we use t.Setenv() along with t.Parallel() we get a panic yet the linter is telling us we are wong. |
Sorry folks, I was away on holiday. I will take a look at this today |
Setenv cannot be used in parallel tests or tests with parallel ancestors.
This attempts to fix the issue raised in #13 (comment)