-
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
Add before_subset_queue hook in queue mode #183
Add before_subset_queue hook in queue mode #183
Conversation
Hi @tubaxenor Please share more context why this is needed in your case. Do you use RSpec or another test runner? In the case of RSpec, you can run Have you tried it? If so, why it's not good enough? |
Hey @ArturT, you’re right, |
:after_subset_queue_store, | ||
:after_queue_store | ||
|
||
def reset_before_queue | ||
@before_queue_store = nil | ||
end | ||
|
||
def reset_before_subset_queue | ||
@before_subset_queue_store = nil |
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.
I noticed specs where flaky (randomly failing) and I could not figure out why. It turned out there was a wrong name for this instance variable. I've fixed it and now specs are passing.
code exampleYou can use the KnapsackPro::Hooks::Queue.before_subset_queue do |queue_id|
# list of test files fetched from the Queue API for a given batch/subset
# tests are not executed yet so the time_execution is 0 seconds
puts KnapsackPro.tracker.to_a
end I've released the knapsack_pro gem 3.5.0 version. |
@tubaxenor @ngan Thank you for the contribution. 🎉 |
Currently there is only
after_subset_queue
hook and only works when subset finished. Adding a before subset hook to provide an ability to access to the subset queue to preserve some information beforehand which might be loss while CI node terminated in the middle of processing.