I have a project which has more than 10-15 modules. I have split the tests in a way such that the unit tests are run separately and the integration tests are run separately. The unit tests can be easily parallelized. But the integration tests need a custom backend to run against and no two modules can run against the same backend.
I have the ability to provision multiple backends. The thing I am trying to achieve is to run the integration tests in parallel and ensure that all the different parallel modules hit different backends. Is there a way to specify the backends to the different tasks spawned such that each worker only talks to one backend?
Assumptions :
- max_workers = 2/3 (defined through the command line arguments)
- forkEvery is not set.
- maxParallelFork = 1 (so that each module only runs in one worker)
Ideally, I would like the following :
- Specify a list of backends which is equal to the number of max-workers flag.
- On starting a task, I pick one of the backends from the list specified and set it as the system property for the given worker.
- The worker uses the backend from the system properties to run the tests.
The guarantees that I need to provide are:
- No two workers are going to hit the same backend.
- All the backends are going to be used (to improve effeciency)