Skip to content
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 all queue hooks examples for RSpec, Cucumber, Minitest #61

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions features/support/knapsack_pro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@
# CUSTOM_CONFIG_GOES_HERE
KnapsackPro::Hooks::Queue.before_queue do |queue_id|
print '-'*10
print 'Before Queue Hook - run before test suite'
print 'Before Queue Hook - run before the test suite'
print '-'*10
end

KnapsackPro::Hooks::Queue.before_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'Before Subset Queue Hook - run before the next subset of tests'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'After Subset Queue Hook - run after subset of test suite'
print 'After Subset Queue Hook - run after the previous subset of tests'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_queue do |queue_id|
print '-'*10
print 'After Queue Hook - run after test suite'
print 'After Queue Hook - run after the test suite'
print '-'*10
end

Expand Down
12 changes: 4 additions & 8 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
# CUSTOM_CONFIG_GOES_HERE
KnapsackPro::Hooks::Queue.before_queue do |queue_id|
print '-'*10
print 'Before Queue Hook - run before test suite'
print 'Before Queue Hook - run before the test suite'
print '-'*10
puts

SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}")
end
Expand All @@ -46,29 +45,26 @@

KnapsackPro::Hooks::Queue.before_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'Before Subset Queue Hook - run before the subset of the test suite'
print 'Before Subset Queue Hook - run before the next subset of tests'
print '-'*10
puts
end
KnapsackPro::Hooks::Queue.before_subset_queue do |queue_id, subset_queue_id|
puts '2nd KnapsackPro::Hooks::Queue.before_subset_queue'
end

KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'After Subset Queue Hook - run after the subset of the test suite'
print 'After Subset Queue Hook - run after the previous subset of tests'
print '-'*10
puts
end
KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
puts '2nd KnapsackPro::Hooks::Queue.after_subset_queue'
end

KnapsackPro::Hooks::Queue.after_queue do |queue_id|
print '-'*10
print 'After Queue Hook - run after test suite'
print 'After Queue Hook - run after the test suite'
print '-'*10
puts
end
KnapsackPro::Hooks::Queue.after_queue do |queue_id|
puts '2nd KnapsackPro::Hooks::Queue.after_queue'
Expand Down
12 changes: 9 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,25 @@
# CUSTOM_CONFIG_GOES_HERE
KnapsackPro::Hooks::Queue.before_queue do |queue_id|
print '-'*10
print 'Before Queue Hook - run before test suite'
print 'Before Queue Hook - run before the test suite'
print '-'*10
end

KnapsackPro::Hooks::Queue.before_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'Before Subset Queue Hook - run before the next subset of tests'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'After Subset Queue Hook - run after subset of test suite'
print 'After Subset Queue Hook - run after the previous subset of tests'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_queue do |queue_id|
print '-'*10
print 'After Queue Hook - run after test suite'
print 'After Queue Hook - run after the test suite'
print '-'*10
end

Expand Down
Loading