-
Notifications
You must be signed in to change notification settings - Fork 32
[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
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
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
64cc135
draft
ArturT a0d4e3e
add tests
ArturT 63ff590
wip: pass queue to queue callbacks
ArturT 7477618
fix flaky tests
ArturT 845ac9d
stop using global var
ArturT 62020af
refactor: remove global var and english polishing
ArturT 476ec65
add integration test
ArturT fcc50e4
call public API methods that must be backward compatible
ArturT 43030e4
Update CHANGELOG.md
ArturT d7b7978
Update CHANGELOG.md
ArturT 9667cda
Update lib/knapsack_pro/hooks/queue.rb
ArturT 42a53c8
Update spec/integration/runners/queue/rspec_runner_spec.rb
ArturT 61cb8c4
Update spec/knapsack_pro/queue_spec.rb
ArturT 2f95afc
rename batched_tests_1 to test_files_paths_1 and more
ArturT 9763ad5
Update lib/knapsack_pro/queue.rb
ArturT 8d335ab
refactor: simplify batch public methods
ArturT 58b644d
Update CHANGELOG.md
ArturT 77d272c
Update CHANGELOG.md
ArturT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module KnapsackPro | ||
| class Batch | ||
| attr_reader :test_file_paths, :status | ||
|
|
||
| def initialize(test_file_paths) | ||
| @test_file_paths = test_file_paths | ||
| @status = :not_executed | ||
| end | ||
|
|
||
| def _passed | ||
| @status = :passed | ||
| end | ||
|
|
||
| def _failed | ||
| @status = :failed | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module KnapsackPro | ||
| class Queue | ||
| include Enumerable | ||
|
|
||
| def initialize | ||
| @batches = [] | ||
| end | ||
|
|
||
| def each(&block) | ||
| @batches.each(&block) | ||
| end | ||
|
|
||
| def add_batch_for(test_file_paths) | ||
| return if test_file_paths.empty? | ||
| @batches << KnapsackPro::Batch.new(test_file_paths) | ||
| end | ||
|
|
||
| def mark_batch_passed | ||
| current_batch._passed | ||
| end | ||
|
|
||
| def mark_batch_failed | ||
| current_batch._failed | ||
| end | ||
|
|
||
| def current_batch | ||
| @batches.last | ||
| end | ||
|
|
||
| def size | ||
| @batches.size | ||
| end | ||
|
|
||
| def [](index) | ||
| @batches[index] | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.