Redefine Parallel

Redefine Parallel is Redefine's method of optimizing test distribution across multiple machines. It allows you to run tests as though they are being executed on a single machine while Redefine manages the distribution.

This approach utilizes test duration and failure probability to ensure that the most relevant tests are always running in parallel.


Follow the instructions in the Quick Start ⏱️guide to install Redefine.


Configure a shared session ID

To use Redefine Parallel, it is important to configure a shared session ID between all testing machines. This allows Redefine to connect the prediction and the execution of the tests.

Follow these steps to configure the shared Session ID:

  1. It is crucial to generate the session ID once and provide it to all testing machines, to avoid misalignment.

  2. You can use the CLI command redefine get session_id to generate the session ID, which represents the current session.

  3. Export the environment variable REDEFINE_SESSION_ID with the same value on all test-runners.


Make sure that the verify command ends with success on all testing machines -

redefine verify --<testing-framework>


When executing the redefine install command, you need to pass the number of machines and the index of each machine to the Redefine command in the following format:

redefine install --pytest --<selection_mode> --splits <number of machines> --group <machine index>
pytest -n auto tests/

Last updated