Enable Split By Test Example by default in RSpec #288
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Story
https://trello.com/c/xBllV4js/589-enable-sbte-by-default
Notice that SBTE is disabled for Turnip as it was never supported:
When using Turnip, you are supposed to run it with:
That monkey-patches RSpec defining
Turnip::RSpec::Loader
: https://github.com/jnicklas/turnip/blob/5eb4a21147b3758c81f369b163d1ae74b23cb0f0/lib/turnip/rspec.rb#L130If SBTE was not disabled for Turnip, running
KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true bundle exec rake "knapsack_pro:queue:rspec[-r turnip/rspec]"
would fail to generate the JSON report because theRSpecTestExampleDetector
shells out to RSpec w/o requiring Turnip.Fails because Turnip being in the Gemfile is autorequired only as part of rails helper, but that test requires spec helper (and prolly even if it was rails helper it would happen too late.)
https://app.circleci.com/pipelines/github/KnapsackPro/knapsack_pro-ruby/1655/workflows/7621f513-9aef-42d9-962a-478d0aa19f43/jobs/25777
But the latest changes may fix this as the error is related to the time tracker not the generation at the beginning.
Checklist reminder
UNRELEASED
section of theCHANGELOG.md
, including the needed bump (ie, patch, minor, major)lib/knapsack_pro/pure/queue/rspec_pure.rb
contains pure functions that are unit tested.lib/knapsack_pro/extensions/rspec_extension.rb
encapsulates calls to RSpec internals and is integration and e2e tested.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.