-
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
Stop calling RSpec::Core::Runner#run
multiple times in Queue Mode
#237
Merged
+3,217
−1,142
Merged
Changes from all commits
Commits
Show all changes
405 commits
Select commit
Hold shift + click to select a range
f852836
update(CI): rename integration tests on CI to e2e tests
ArturT 74785b1
fix(time tracker): when RSpec crashes and @time_all is nil
ArturT 0775e61
[wip] queue rspec runner integration test
ArturT 5736b44
refactor(rspec integration tests): run queue mode integration tests f…
ArturT 9d8df3f
refactor: log command
ArturT 9b2f938
fix: batch tests
ArturT ac1801c
refactor: let specify the spec path name
ArturT d65b7dd
Update rspec_runner_spec.rb
ArturT 7ff341d
Update rspec_runner_spec.rb
ArturT 3e1ba77
Update queue_runner.rb
ArturT a65850c
Update rspec_runner_spec.rb
ArturT 97c90cb
Update rspec_runner_spec.rb
ArturT a82afd8
Update rspec_runner_spec.rb
ArturT 7ad07e0
Update rspec_runner_spec.rb
ArturT 0fa7e18
Update rspec_runner_spec.rb
ArturT 1557a60
Update rspec_runner_spec.rb
ArturT 0bbd561
Update rspec_runner_spec.rb
ArturT afd7dad
Update rspec_runner_spec.rb
ArturT 1a36178
Update rspec_runner_spec.rb
ArturT 58662da
Update rspec_runner_spec.rb
ArturT bf898fa
Update rspec_runner_spec.rb
ArturT 2dd2170
move a test up
ArturT 1927806
Update rspec_runner_spec.rb
ArturT 3189b23
fix(bug): returns 1 as exit code because RSpec wants to quit and exit…
ArturT 91015fc
Update rspec_runner_spec.rb
ArturT eb7748d
Update rspec_runner_spec.rb
ArturT bfd3e5f
fix(flaky spec): when spec_helper.rb has a missing KnapsackPro::Adapt…
ArturT 5de2e0c
Update rspec_runner_spec.rb
ArturT bc610c7
Update rspec_runner.rb
ArturT 0ce9d99
Update rspec_runner.rb
ArturT 1d8b5ac
Update rspec_runner_spec.rb
ArturT f3aab29
Update rspec_runner_spec.rb
ArturT 0abd0ea
Update rspec_runner_spec.rb
ArturT fd4b85e
Update rspec_runner_spec.rb
ArturT e450710
Update rspec_runner_spec.rb
ArturT 71a62ec
Update CHANGELOG.md
ArturT 46ffaf3
Update rspec_runner_spec.rb
ArturT 5c43940
Update rspec_runner_spec.rb
ArturT afd42bf
Update rspec_runner_spec.rb
ArturT 27ee506
feat: does not log copy&paste command when no test file paths returne…
ArturT cf101bf
Update rspec_runner_spec.rb
ArturT d0ce1ec
Update rspec_runner_spec.rb
ArturT 7fe320d
Update rspec_runner_spec.rb
ArturT 8198180
Update rspec_runner_spec.rb
ArturT b3fc00f
Update rspec_runner_spec.rb
ArturT eab8c29
Update rspec_runner_spec.rb
ArturT b081a72
Update rspec_runner_spec.rb
ArturT 3c5ef82
Update rspec_runner_spec.rb
ArturT 7281394
Update rspec_runner_spec.rb
ArturT 24f0973
Update rspec_runner_spec.rb
ArturT 7732a66
wip: mock build_distributions#last API endpoint
ArturT 590129a
Update rspec_runner_spec.rb
ArturT e372532
Update rspec_runner_spec.rb
ArturT 7d0981e
Update queue_runner.rb
ArturT 043de31
update(CI): split custom files by examples to ensure the rake task to…
ArturT 4f85f5a
add spec for the RSpec split by test examples
ArturT f8666b7
Update rspec_runner_spec.rb
ArturT 2552d2f
Update rspec_runner_spec.rb
ArturT 7c5791f
detects test execution times correctly before sending it to API
ArturT 1823b15
Update rspec_runner_spec.rb
ArturT 0974d8d
Update rspec_runner_spec.rb
ArturT 220771a
Update rspec_runner_spec.rb
ArturT 8600be7
add junit xml test
ArturT 5e5c7c0
Update Gemfile
ArturT fa47cf6
test when the RSpec split by examples is enabled AND simplecov is used
ArturT c4e2094
Update rspec_runner_spec.rb
ArturT 348f563
remove MOCK_QUEUE_API_RESPONSE
ArturT 885241b
call call_after_subset_queue after tests and before we log info about…
ArturT bc2c9d7
calls hooks defined with when_first_matching_example_defined only onc…
ArturT 40a4eba
Update rspec_runner_spec.rb
ArturT 34500b2
Update rspec_runner_spec.rb
ArturT dfab644
Update rspec_runner_spec.rb
ArturT 1fee46e
Update rspec_runner_spec.rb
ArturT ae4211e
Create .gitignore
ArturT 8bba777
ignore dynamically generated specs for time tracker
ArturT b774375
Update CHANGELOG.md
ArturT 8d1e02f
Update CHANGELOG.md
ArturT 3f4b100
Update CHANGELOG.md
ArturT ba8e756
Update CHANGELOG.md
ArturT a6ec3d5
Update .gitignore
ArturT f3a85ea
fix(bug): add support for the example_status_persistence_file_path op…
ArturT 1b2675a
Update rspec_runner_spec.rb
ArturT 3f64a7a
Update rspec_adapter.rb
ArturT 5937e9a
Update rspec_extension.rb
ArturT eb78cdb
Update rspec_extension.rb
ArturT b9df226
Update rspec_extension.rb
ArturT c83d2bf
Update rspec_extension.rb
ArturT fdb1258
Update rspec_extension.rb
ArturT 15e12ae
Update rspec_extension.rb
ArturT 4796be1
Update rspec_runner.rb
ArturT 4771d8c
Update rspec_runner.rb
ArturT 997deec
rename method to set_error_exit_code
ArturT 070c72d
typo
ArturT 667ef03
Update rspec_runner_spec.rb
ArturT ebf15fc
Update rspec_runner_spec.rb
ArturT e362390
rename method ensure_args_have_a_formatter
ArturT 3778a34
Update rspec_runner_spec.rb
ArturT d616591
move KNAPSACK_PRO_TEST_FILE_PATTERN where it belongs
ArturT b887b6d
Update queue_runner.rb
ArturT 394baff
Update queue_runner.rb
ArturT e759675
Update rspec_runner_spec.rb
ArturT 73f04a5
Update rspec_runner_spec.rb
ArturT a88e761
Update rspec_runner_spec.rb
ArturT bfcab69
Update rspec_runner_spec.rb
ArturT a2ba136
Update rspec_runner_spec.rb
ArturT f245738
Update rspec_runner_spec.rb
ArturT 06a1f9d
Update spec_integration/queue_runner.rb
ArturT 7c782a8
refactor: use the same order of blocks as in the original RSpec code
ArturT 448861c
remove unused exit_status
ArturT 488b096
shows summary of tests (pending + failures) for terminated process as…
ArturT 9543f64
make it alphabetically ordered
ArturT 6f63619
Update lib/knapsack_pro/extensions/rspec_extension.rb
ArturT 03b542c
Update lib/knapsack_pro/extensions/rspec_extension.rb
ArturT d462898
refactor: inline to_cli_args and remove spec
ArturT f7e2550
Merge branch 'refactor-queue-rspec-runner' of github.com:KnapsackPro/…
ArturT cee9bb7
Update spec/knapsack_pro/runners/queue/cucumber_runner_spec.rb
ArturT 5ad48f8
Update spec_integration/queue_runner.rb
ArturT ad26e2c
remove bind hooks tests that are tested in integration tests
ArturT 75e5dc8
fix(time_tracker)
3v0k4 0b7f72d
test(time_tracker): let ruby remove files
3v0k4 dcb6afb
fix(flaky spec): when time_tracker is nil then do not print global ti…
ArturT de611f7
fix(flaky spec): when TimeTracker calls the after_subset_queue hook t…
ArturT ca22567
update(spec): remove KNAPSACK_PRO_LOG_LEVEL=info when it's not needed…
ArturT 37c3213
Revert "update(spec): remove KNAPSACK_PRO_LOG_LEVEL=info when it's no…
ArturT 86aa4c4
Update spec_integration/queue_runner.rb
ArturT b993c8c
refactor: ivar @batch_index
ArturT 7a3aee1
refactor: add [INTEGRATION TEST] prefix to logs from mocked methods
ArturT 78e52a2
refactor: api token does not have a meaning in tests
ArturT b72542f
refactor: remove ivar @knapsack__setup_done and related code
ArturT e9066df
update required_ruby_version in gemspec and update readme
ArturT 133bd18
remove comment for `rspec_is_quitting` was added in RSpec 3.11.0
ArturT 278638a
refactor: remove _default = nil and add comment
ArturT fa5949a
refactor: rename node_assigned_test_file_paths to node_test_file_paths
ArturT eb83d07
ignore dynamically generated time tracker specs
ArturT 0a9d6b8
keep gitignore entries in one file
ArturT 642d661
refactor(spec): not to raise error
ArturT 661f86e
update(spec): returns no spec_opts
ArturT 32d7766
use spec_opts name
ArturT 1b331ee
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT b78d53b
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT 3932a7a
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT 50ea747
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT 0152020
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT a3fcfdb
remove copy & paste term
ArturT f3b6a94
update(gemspec description): be precise about test execution times
ArturT f480c96
Update lib/knapsack_pro/runners/queue/rspec_runner.rb
ArturT 2340dc1
Update lib/knapsack_pro/runners/queue/rspec_runner.rb
ArturT 682c400
refactor: move side effect outside of set_error_exit_code and rename …
ArturT 05398b7
refactor: inject adapter_class
ArturT 1cacb88
remove comments for args_with_seed_option_added_when_viable
ArturT e426099
rename wrapped_test_file_paths to test_file_paths
ArturT ccfa75f
fix typo function_core => functional_core
ArturT 424eebf
update(comment): add why in comments
ArturT 9e73e09
refactor: extract knapsack__announce_filters
ArturT 07ef604
refactor: rename with_batched_tests_from_queue to with_batch
ArturT c0e8745
refactor: remove with_queue_hooks and extract log_batch_rspec_command…
ArturT 8c155fa
refactor: inject KnapsackPro::Adapters::RSpecAdapter in test
ArturT eef6ea8
refactor: log rspec batch and queue commands
ArturT 76a3774
Update spec/knapsack_pro/runners/queue/rspec_runner_spec.rb
ArturT b49a49a
refactor(spec): inject KnapsackPro::Formatters::TimeTrackerFetcher
ArturT f041ebe
update(text): Global test execution duration
ArturT 1267eb1
refactor: log tests duration only once at the very end of the queue
ArturT 50e94af
refactor: extract bind_after_queue_hook to base adapter
ArturT 5cd2dd4
update(log message): show queue/regular mode name and improve english
ArturT a4ccd51
refactor: ensure_no_deprecated_run_all_when_everything_filtered_option!
ArturT 934e682
refactor: move logger outside of log_rspec_command
ArturT bf44952
refactor: log_fail_fast_limit_met is already tested in integration te…
ArturT a56d634
refactor: rspec_command
ArturT 8538cff
refactor: extract logger from exit_summary
ArturT 6ff45b6
refactor: remove unneeded return. Kernel.exit will terminate immediat…
ArturT fcf9899
refactor: add_knapsack_pro_formatters_to
ArturT e3041ba
refactor: args_with_at_least_one_formatter
ArturT 9819647
refactor: extract prepare_cli_args to core
ArturT 4e75264
refactor: extract seed (remove data clump)
ArturT 0b01bf1
Update rspec_extension.rb
ArturT ffd5fa5
fix: use injected time_tracker_fetcher
ArturT 71381ac
Create pull_request_template.md
ArturT 912d194
refactor: extract queue rspec pure functions
ArturT 3346349
Update pull_request_template.md
ArturT 60a26f6
refactor: move spec_integration/queue_runner.rb to spec directory
ArturT 307c5f7
refactor: clean up the spec_integration directory after tests execution
ArturT 2aa2013
refactor: move queue runner to integration directory
ArturT 7e98eee
refactor: use actual instead of result in tests
ArturT 38a02c2
refactor: spec item in less lines
ArturT c657eac
refactor(spec): mock batched tests only when needed for test cases
ArturT 8b2bcc1
Update rspec_runner_spec.rb
ArturT b715296
add(spec): when the .rspec file has RSpec options
ArturT 18b11c9
add(spec): when --options is set
ArturT 903536a
Update rspec_runner.rb
ArturT f34a2a1
feat: The default for `KNAPSACK_PRO_LOG_LEVEL` is `info` instead of `…
ArturT 3a15925
update(CI): do not reinstall gems and cache when rspec version change…
ArturT 0f2ef6e
update(CI): cache gems separately for different rspec versions
ArturT 7dac15e
Just empty commit
ArturT 79957bb
update(CI): add integration-rspec tests on CI for different versions …
ArturT 9942459
update(Gemfile): add an example rspec-core line in Gemfile so that we…
ArturT f002c64
fix(tests): fix tests that have different error messages depending on…
ArturT 3c01fd6
fix(spec): fix spec for different ruby version on CI
ArturT 49de3c6
fix(spec): fix a flaky tests when spec integration directory is not c…
ArturT a5638d2
skip test that is not supported by RSpec 3.10.2
ArturT 90ff153
remove world.respond_to?(:rspec_is_quitting) - will CI tests detect t…
ArturT c35b19e
Revert "remove world.respond_to?(:rspec_is_quitting) - will CI tests …
ArturT 229869b
try to reproduce the issue: https://github.com/KnapsackPro/knapsack_p…
ArturT 003a57e
Revert "try to reproduce the issue: https://github.com/KnapsackPro/kn…
ArturT 30381bd
Update .github/pull_request_template.md
ArturT 9b15817
Update .github/pull_request_template.md
ArturT e8bd38d
Update knapsack_pro.gemspec
ArturT 3e57cce
Update CHANGELOG.md
ArturT 12ca719
Update CHANGELOG.md
ArturT 3c628d3
Update lib/knapsack_pro/extensions/rspec_extension.rb
ArturT 526e965
Update CHANGELOG.md
ArturT cb15413
Update CHANGELOG.md
ArturT 03d633f
Update CHANGELOG.md
ArturT 8dfa7a7
Update spec/integration/runners/queue/rspec_runner.rb
ArturT 7de6567
Update lib/knapsack_pro/pure/queue/rspec_pure.rb
ArturT 6f48966
Update spec/knapsack_pro/hooks/queue_spec.rb
ArturT f231aa9
require at the top and add parenthesis
ArturT 381164c
refactor: rename SpecItem to Spec
ArturT 53b680a
rename spec_helper_content to spec_helper
ArturT 0b3a0ee
refactor: use spec_batches and TEST__SPEC_BATCHES
ArturT ebe95b8
Update spec/integration/runners/queue/rspec_runner_spec.rb
ArturT 7d1df77
refactor: stub_spec_batches
ArturT 855c304
Update CHANGELOG.md
ArturT 37c67f5
Update CHANGELOG.md
ArturT 7a42ad3
Update CHANGELOG.md
ArturT 41c0f32
is
ArturT 03220b0
Update CHANGELOG.md
ArturT 00f9ce0
Update CHANGELOG.md
ArturT dcea7c0
update(comment): Facade to abstract calls to internal RSpec methods.
ArturT a85d795
Merge branch 'refactor-queue-rspec-runner' of github.com:KnapsackPro/…
ArturT 257e2cf
Update CHANGELOG.md
ArturT 1df2375
Update CHANGELOG.md
ArturT b4a1b9b
Update CHANGELOG.md
ArturT b41daf5
Update CHANGELOG.md
ArturT 5341b89
Update CHANGELOG.md
ArturT 6bddc5e
Update CHANGELOG.md
ArturT f17699c
update(changelog): add link to KNAPSACK_PRO_MODIFY_DEFAULT_RSPEC_FORM…
ArturT d31a4ff
Update CHANGELOG.md
ArturT e797f1c
Update CHANGELOG.md
ArturT 3eeaa1f
refactor: define only seed in spec
ArturT 986fc02
Merge branch 'refactor-queue-rspec-runner' of github.com:KnapsackPro/…
ArturT 77db883
Update queue_spec.rb
ArturT 150bb1f
refactor: remove the indentation and yield
ArturT 64ddfab
refactor: change a logger message when a given mode is enabled
ArturT 94442e0
Update rspec_runner.rb
ArturT 027b5c9
Update rspec_pure_spec.rb
ArturT 9f4814e
refactor: remove adapter class dependency from RSpecPure
ArturT 0dfc8e8
refactor: remove time tracker as RSpecPure dependency
ArturT 1689bfa
refactor: extract unexecuted_test_files
ArturT 1482a5f
refactor: add test for unexecuted_test_files to ensure we cover case …
ArturT 1ccadf5
Update lib/knapsack_pro/extensions/rspec_extension.rb
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 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 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,22 @@ | ||
# Story | ||
|
||
TODO: link to the internal story | ||
|
||
## Related | ||
|
||
TODO: links to related PRs or issues | ||
|
||
# Description | ||
|
||
TODO | ||
|
||
# Changes | ||
|
||
TODO: changes introduced by this PR | ||
|
||
# Checklist reminder | ||
|
||
- [ ] You follow the architecture outlined below for RSpec in Queue Mode, which is a work in progress (feel free to propose changes): | ||
- Pure: `lib/knapsack_pro/pure/queue/rspec_pure.rb` contains pure functions that are unit tested. | ||
- Extension: `lib/knapsack_pro/extensions/rspec_extension.rb` encapsulates calls to RSpec internals and is integration and e2e tested. | ||
- Runner: `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. |
This file contains 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 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 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 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 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 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 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 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.
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.
What are the consequences? Do we want to document them here?
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.
In the past, I really wanted to call
KnapsackPro::Hooks::Queue.after_queue
inside of theafter(:suite)
hook, but it was impossible to know which batch is the final one. You know that after you execute the previous batch. So it is too late to run a hook if all tests are already executed. It must have been called outside of theafter(:suite)
context.Now, there is no problem like that, and we can do what should be working from the very beginning. The
KnapsackPro::Hooks::Queue.after_queue
hook should be run within theafter(:suite)
context.I don't think we can add anything useful here. Users simply get now access to the RSpec context within the
KnapsackPro::Hooks::Queue.after_queue
hook, which was not possible before.