Eventually, many projects reach a size where their tests no longer run in a comfortable amount of time on a single execture. For a while ,you can get away with splitting them up yourself, but then you find one executor still takes way longer than the rest.
With Check Run Reporter's persistent plan, we'll use the timing data from your historical tests to efficiently distribute your test across your hosts.
Check Run Reporter's test splitting works for any test runner that accepts a list of test file as an input. If you're test runnig specifies tests in a different way, please reach out to contact support.
First, supply your list of available test files to Check Run Reporter, then use the result in your test runner. The following example shows how to use it with Jest, using bash globbing to find all available tests.
npx jest $(crr split \ --label='Unit Tests' \ --nodeCount=3 \ --nodeIndex=1 \ --tests='src/**/*.spec.ts' \ --token=$CHECK_RUN_REPORTER_TOKEN
All CI integrations have native support for test splitting that vary slightly from the above command thanks to constraints of each platform. Please see the specific integration docs for more details.