From 2b6766eeb6cadd3b5af8b3b10731241f63353877 Mon Sep 17 00:00:00 2001 From: il3ven Date: Tue, 5 Apr 2022 14:37:41 +0530 Subject: [PATCH 1/2] add utilizeParallelBuilds config --- lib/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 482766850..a4c89ac09 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -393,7 +393,7 @@ export default async function loadCli() { // eslint-disable-line complexity } let parallelRuns = null; - if (isCi && ciParallelVars) { + if (isCi && ciParallelVars && combined.utilizeParallelBuilds !== false) { const {index: currentIndex, total: totalRuns} = ciParallelVars; parallelRuns = {currentIndex, totalRuns}; } From 29c78b5d584f0f348687c58a6812f7d638e3e85a Mon Sep 17 00:00:00 2001 From: il3ven Date: Tue, 5 Apr 2022 15:21:50 +0530 Subject: [PATCH 2/2] update docs --- docs/06-configuration.md | 1 + docs/recipes/splitting-tests-ci.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/06-configuration.md b/docs/06-configuration.md index ccf081d50..3bb063b0b 100644 --- a/docs/06-configuration.md +++ b/docs/06-configuration.md @@ -59,6 +59,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con - `timeout`: Timeouts in AVA behave differently than in other test frameworks. AVA resets a timer after each test, forcing tests to quit if no new test results were received within the specified timeout. This can be used to handle stalled tests. See our [timeout documentation](./07-test-timeouts.md) for more options. - `nodeArguments`: Configure Node.js arguments used to launch worker processes. - `sortTestFiles`: A comparator function to sort test files with. Available only when using a `ava.config.*` file. See an example use case [here](recipes/splitting-tests-ci.md). +- `utilizeParallelBuilds`: If `false`, disable [parallel builds](/docs/recipes/splitting-tests-ci.md) (default: true) Note that providing files on the CLI overrides the `files` option. diff --git a/docs/recipes/splitting-tests-ci.md b/docs/recipes/splitting-tests-ci.md index 95849d3dd..c2d354a88 100644 --- a/docs/recipes/splitting-tests-ci.md +++ b/docs/recipes/splitting-tests-ci.md @@ -20,3 +20,7 @@ export default { sortTestFiles: (file1, file2) => testData[file1].order - testData[file2].order, }; ``` + +**Disable parallel builds** + +To disable this feature, set `utilizeParallelBuilds` to `false` in your [AVA configuration](/docs/06-configuration.md#options).