Skip to content

fix(RSpec split by examples): properly disable split by test examples on a single node to speed up tests#283

Merged
ArturT merged 9 commits intomasterfrom
fix
Nov 1, 2024
Merged

fix(RSpec split by examples): properly disable split by test examples on a single node to speed up tests#283
ArturT merged 9 commits intomasterfrom
fix

Conversation

@ArturT
Copy link
Copy Markdown
Member

@ArturT ArturT commented Nov 1, 2024

Description

Fix for a bug introduced in the following PR when you run tests on a single CI node and use KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true.

vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/slow_test_file_determiner.rb:29:in `read_from_json_report'
/home/betterment/for_business/impersonate/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/adapters/base_adapter.rb:30:in `slow_test_file?'
/home/betterment/for_business/impersonate/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/formatters/time_tracker.rb:123:in `rspec_split_by_test_example?'
/home/betterment/for_business/impersonate/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/formatters/time_tracker.rb:117:in `path_for'
/home/betterment/for_business/impersonate/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/formatters/time_tracker.rb:102:in `record_example'
/home/betterment/for_business/impersonate/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.12.0/lib/knapsack_pro/formatters/time_tracker.rb:38:in `example_finished'

changes

  • fix(RSpec split by examples): properly disable split by test examples on a single node to speed up tests

Checklist reminder

  • You added the changes to the UNRELEASED section of the CHANGELOG.md, including the needed bump (ie, patch, minor, major)
  • You follow the architecture outlined below for RSpec in Queue Mode, which is a work in progress (feel free to propose changes):
    • 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 ArturT merged commit 180db3f into master Nov 1, 2024
@ArturT ArturT deleted the fix branch November 1, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant