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
Support fail fast #767
Support fail fast #767
Conversation
… exit code. So it makes possible to stop whole suite for all threads if every thread will works option `--fail-fast`.
… specs will be executed and different puts will be displayed. Changed puts to be the same at all specs to assert amount of puts outputs which should be the same
@@ -44,6 +44,7 @@ def execute_in_parallel(items, num_processes, options) | |||
simulate_output_for_ci options[:serialize_stdout] do | |||
Parallel.map(items, :in_threads => num_processes) do |item| | |||
result = yield(item) | |||
ParallelTests.stop_all_processes if result[:exit_status] != 0 && options[:fail_fast] | |||
reprint_output(result, lock.path) if options[:serialize_stdout] |
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.
- should go after the printing ?
- parallel has
raise Parallel::Kill
, that should work too ?
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 will change the order
-
raise the exception doesn't seems to be right solution. I would expect that tests will shutdown softly after running they after hooks, where they could perform cleaning code.
spec/integration_spec.rb
Outdated
["cucumber features/fail1.feature:2 # Scenario: xxx", "cucumber features/fail2.feature:2 # Scenario: xxx"] | ||
else | ||
["cucumber features/fail2.feature:2 # Scenario: xxx", "cucumber features/fail1.feature:2 # Scenario: xxx"] | ||
end |
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.
plz undo these reformattings or make them 2-space indent
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.
Sure, I will undo reformatting
Changed order of the command, reprint output before stopping all the processes
@AnewTranduil Any updates regarding this feature? Can I help? |
I need to find some time to review this, should be in the next few days and
then we can talk next steps unless it's a straight up merge :)
…On Thu, Jul 23, 2020 at 3:26 PM Mohamed Hamed ***@***.***> wrote:
@AnewTranduil <https://github.com/AnewTranduil> Any updates regarding
this feature? Can I help?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#767 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACYZ563ITQVPXYW5QRQITR5C2HVANCNFSM4OTLKLVQ>
.
|
here we go ... #770 just waiting for CI |
3.1.0 |
Great! Thanks @grosser! |
It is a possible solution to the issue: #279
Added an option
--fail-fast
to the parallel_tests, which stops all the processes if one of them return non zero exit code. As similar feature was implemented at rspec itself it makes it possible to stop whole suit on the first fail.Checked only with the rspec framework. (Might check other frameworks in the future)
Usage example:
parallel_rspec -n 2 spec/ --fail-fast --test-options '--fail-fast'
parallel_rspec -n 2 spec/ --fail-fast
while the option
--fail-fast
will be enabled at the .rspec_parallelComments and suggestions appreciated))