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, |
| end | ||
|
|
||
| def reset_before_subset_queue | ||
| @before_subset_queue_store = nil |
There was a problem hiding this comment.
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
endI've released the knapsack_pro gem 3.5.0 version. |
|
@tubaxenor @ngan Thank you for the contribution. 🎉 |
Currently there is only
after_subset_queuehook 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.