Closed kadru closed 3 years ago
Thanks for reporting a bug! We also encountered it today. I'll try to come up with a fix.
The exit status of the subprocesses is ignored in https://github.com/serpapi/turbo_tests/blob/master/lib/turbo_tests/runner.rb#L121 - you can check it with wait_thr.value
, but this will block until all processes return.
Something like this:
@@ -48,7 +48,7 @@ module TurboTests
:runtime_log => @runtime_log
)
- tests_in_groups.each_with_index do |tests, process_id|
+ wait_threads = tests_in_groups.each_with_index.map do |tests, process_id|
start_regular_subprocess(tests, process_id + 1)
end
@@ -58,7 +58,7 @@ module TurboTests
@threads.each(&:join)
- @reporter.failed_examples.empty?
+ wait_threads.map(&:value).all?(&:success?) && @reporter.failed_examples.empty?
end
protected
@@ -106,7 +106,7 @@ module TurboTests
puts "TEST_ENV_NUMBER=#{env["TEST_ENV_NUMBER"]} #{rerun_command.join(" ")}"
- _stdin, stdout, stderr, _wait_thr = Open3.popen3(env, *command)
+ _stdin, stdout, stderr, wait_thr = Open3.popen3(env, *command)
@threads <<
Thread.new do
@@ -129,6 +129,8 @@ module TurboTests
end
@threads << start_copy_thread(stderr, STDERR)
+
+ wait_thr
end
end
would at least make the whole process return 1, so you'd get a failed run on CI instead of current silent failure.
@grk Thank you for looking into this and specifically for suggesting the possible fix! It's definitely a good starting point. I'll test the diff you've posted.
For example you can raise an exception in
spec/rails_helper.rb
withraise 'foo'
, eg:Then I run
bundle exec turbo_tests
And the output wil be:I expect the tests to fail, just like
bundle exec rspec
would fail:I'm using rails 6.0.3.4, rspec-rails 4.0.2 and turbo_tests 1.2.