Skip to content

Enable Split By Test Example by default in RSpec #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Feb 25, 2025
Merged

Enable Split By Test Example by default in RSpec #288

merged 32 commits into from
Feb 25, 2025

Conversation

3v0k4
Copy link
Contributor

@3v0k4 3v0k4 commented Feb 17, 2025

Story

https://trello.com/c/xBllV4js/589-enable-sbte-by-default

Description

Enable KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES by default.

This should improve the speed of your builds, but you can disable it with KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=false.

Also, this PR adds support for RSpec tags when using RSpec split by examples.

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.

@3v0k4 3v0k4 self-assigned this Feb 17, 2025
@3v0k4 3v0k4 force-pushed the sbte branch 9 times, most recently from 4587490 to 9c4eb52 Compare February 21, 2025 09:29
@3v0k4 3v0k4 changed the base branch from master to improve-rspec-split-by-examples-execution-time-measures February 21, 2025 09:29
Base automatically changed from improve-rspec-split-by-examples-execution-time-measures to master February 21, 2025 09:29
Copy link
Contributor Author

@3v0k4 3v0k4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an important thing missing: the formatters are removed from the rspec options but not the ones coming from configuration files (eg, .rspec).

I think it would be simpler to allow formatters without manually parsing them out (fragile code). This would make all the formatters w/o --out print to stdout, but we could either:

  • Silence stdout but not stderr > /dev/null; we need to ensure we are not silencing anything that is needed for debug (in theory, errors should be printed to stderr, but most people throw everything to stdout)
  • Append --out /dev/null (or something like it) to all the existing formatters; we need to test what happens with -f json -o /dev/null -f json -o /path/to/report
  • Other ideas?

Are we also supporting --example and --example-matches with this PR?

@ArturT
Copy link
Member

ArturT commented Feb 25, 2025

Are we also supporting --example and --example-matches with this PR?

Yes.

@ArturT ArturT merged commit af5e0ce into master Feb 25, 2025
45 checks passed
@ArturT ArturT deleted the sbte branch February 25, 2025 16:11
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.

2 participants