Skip to content

Conversation

@3v0k4
Copy link
Contributor

@3v0k4 3v0k4 commented Nov 26, 2025

Description

Documentation:

KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE (RSpec)

By default, Knapsack Pro calculates the Split by Test Examples as part of the test run.

You may want to precalculate the split once to avoid doing it later in each node running Knapsack Pro.

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.

Default: unset

Example:

export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES_FILE=report.json

bundle exec rake knapsack_pro:rspec:precalculate_split_by_test_examples

# On each parallel CI node:
bundle exec rake knapsack_pro:queue:rspec

Checks

  • I added the changes to the UNRELEASED section of the CHANGELOG.md, including the needed bump (i.e., patch, minor, major)
  • I followed the architecture outlined below for RSpec in Queue Mode:
    • Pure: lib/knapsack_pro/pure/queue/rspec_pure.rb contains pure functions that are unit tested.
    • Extension: lib/knapsack_pro/extensions/rspec_extension.rb encapsulates calls to RSpec internals and is integration and E2E tested.
    • Runner: lib/knapsack_pro/runners/queue/rspec_runner.rb invokes the pure code and the extension to produce side effects, which are integration and E2E tested.

@ArturT
Copy link
Member

ArturT commented Nov 26, 2025

suggestion

I would update the description:

You may want to precalculate the split once to avoid doing it later in each node invoking Knapsack Pro.

into

You may want to pre calculate the split once to avoid doing it later in some of the nodes invoking Knapsack Pro that attempt to initialize the test suite split/queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants