Skip to content

Commit db80b8b

Browse files
authored
chore: KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE
1 parent 3ca8721 commit db80b8b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docusaurus/docs/ruby/reference.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,27 @@ Available:
328328
- `"MY_CUSTOM_VARIABLE='value' bundle exec"` in case you need to pass a custom environment variable to the `rake knasack_pro:rspec_test_example_detector` task that generates a test examples report of slow test files
329329
- try `""` to remove the `bundle exec` prefix in case of [issues](split-by-test-examples.mdx#how-do-i-fix-dont-know-how-to-build-task-knapsack_prorspec_test_example_detector)
330330

331+
## `KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE` (RSpec)
332+
333+
By default, Knapsack Pro calculates the [Split by Test Examples](split-by-test-examples.mdx) as part of the test run.
334+
335+
You may want to precalculate the split *once* to avoid doing it later in each node running Knapsack Pro.
336+
337+
To enable the precalculation set `KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE` for both the `bundle exec rake knapsack_pro:rspec:precalculate_split_by_test_examples` and `bundle exec rake knapsack_pro:queue:rspec`.
338+
339+
Default: unset
340+
341+
Example:
342+
343+
```bash
344+
export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE=report.json
345+
346+
bundle exec rake knapsack_pro:rspec:precalculate_split_by_test_examples
347+
348+
# On each parallel CI node:
349+
bundle exec rake knapsack_pro:queue:rspec
350+
```
351+
331352
## `KNAPSACK_PRO_SALT`
332353

333354
Salt to use to [Encrypt Test File Names or Branch Names](encryption.mdx).

0 commit comments

Comments
 (0)