alexliesenfeld / httpmock

HTTP mocking library for Rust.
MIT License
436 stars 40 forks source link

Optionally disable parallelism #15

Closed jeremyandrews closed 3 years ago

jeremyandrews commented 3 years ago

Is there any way to optionally disable parallelism between specific tests? In my project I have some complex tests that use global state and therefor can't be run in parallel. One solution I have found is to move them into their own integration test files, but I'm trying to keep like-tests in the same files.

alexliesenfeld commented 3 years ago

I see three options:

jeremyandrews commented 3 years ago

Thanks for the quick response!

Your first option works, but I don't want to slow down all tests -- most tests can run in parallel and it greatly speeds up all tests. Plus, I don't want tests to fail for someone that doesn't know this is required.

Your second option doesn't work for the reason you state: some of my tests require more than one MockServer.

Your third option solves my problem perfectly. I've added this as a dev-dependency. Thanks again!