-
Notifications
You must be signed in to change notification settings - Fork 28
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
[Queue Mode][RSpec] Pass each batch of tests to the queue hooks: KnapsackPro::Hooks::Queue.before_subset_queue
and KnapsackPro::Hooks::Queue.after_subset_queue
#253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic job!
If you end up applying all the comments related to the public API (batch.rb
), consider this approved.
Happy to have a chat if you have any doubts about the CR.
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
KnapsackPro::Hooks::Queue.before_subset_queue
and KnapsackPro::Hooks::Queue.after_subset_queue
KnapsackPro::Hooks::Queue.before_subset_queue
and KnapsackPro::Hooks::Queue.after_subset_queue
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
@3v0k4 I applied all the comments. I'll release the new gem version today. |
Story
Link to the internal story
Related
Inspired by draft of PR:
Description
In RSpec when you use Queue Mode, the queue hooks
KnapsackPro::Hooks::Queue.before_subset_queue
andKnapsackPro::Hooks::Queue.after_subset_queue
get a 3rd variable - thequeue
.The
queue
variable stores an enumerable collection with each batch of tests fetched from the Queue API. The batch has:KnapsackPro::Batch#test_file_paths
returns an array like['a_spec.rb', 'b_spec.rb']
)KnapsackPro::Batch#status
returns:not_executed
,:passed
or:failed
)Example usage:
Checklist reminder
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.