paralleltest
paralleltest copied to clipboard
Is there a way to ignore an specific test function/file?
I'm using the gock library to test my HTTP request, but it doesn't play well with concurrency, so I need those tests to not run in parallel. Is there a way for me to ignore those tests without disabling the rule?
I am unsure of what your set-up is, but can't you avoid running your tests in parallel by doing
go test -p 1 ./...
Running the test in parallel speeds up the process, so if I run the test with the -p 1
, it defeats the whole point of using the t.Parallel()
. For now, I've removed the t.Parallel()
line for the test that uses the gock library
I am not sure of the test setup, but we do have two flags to ignore the tests. Would they work?
A few options can be activated by flag:
-i: Ignore missing calls to t.Parallel and only report incorrect uses of it.
-ignoremissingsubtests: Require that top-level tests specify t.Parallel, but don't require it in subtests (t.Run(...)).```