kunwardeep / paralleltest

Linter to check if your tests have been marked as parallel correctly
MIT License
48 stars 12 forks source link

t.Setenv vs paralleltest #13

Closed nasermirzaei89 closed 2 years ago

nasermirzaei89 commented 2 years ago

This library forces you to run parallel tests. But how can I test something that depends on environment variables?

Like this https://github.com/nasermirzaei89/env

kunwardeep commented 2 years ago

Hey @nasermirzaei89, unfortunately, I am not doing active development on this., but would be more than happy to have a look at a PR if you have one.

kunwardeep commented 2 years ago

Hey @nasermirzaei89, would you please be able to test the latest release and see if it solves your problem? We have just added a new flag -i which ignores missing calls to t.Parallel and only reports incorrect uses of it.

nasermirzaei89 commented 2 years ago

Yep. it doesn't show any error with -i flag!

kunwardeep commented 2 years ago

Thanks, @nasermirzaei89 for testing this out. I hope this solves your problem. I will now close this issue.

Fixed in 1.0.6

mitar commented 1 year ago

-i does not really solve this. I would want missing calls to be reported, but only that it does not report it if you use t.Setenv.