Skip to content
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

Is there a way to ignore an specific test function/file? #31

Open
Esequiel378 opened this issue Jun 2, 2023 · 3 comments
Open

Is there a way to ignore an specific test function/file? #31

Esequiel378 opened this issue Jun 2, 2023 · 3 comments

Comments

@Esequiel378
Copy link

Esequiel378 commented Jun 2, 2023

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?

@kunwardeep
Copy link
Owner

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 ./...

@Esequiel378
Copy link
Author

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

@kunwardeep
Copy link
Owner

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(...)).```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants