DEV: Print proper summary when errors have been reporter in turbo_rspec

DEV: Print proper summary when errors have been reporter in turbo_rspec

diff --git a/lib/turbo_tests/json_rows_formatter.rb b/lib/turbo_tests/json_rows_formatter.rb
index c83ee32..453edd4 100644
--- a/lib/turbo_tests/json_rows_formatter.rb
+++ b/lib/turbo_tests/json_rows_formatter.rb
@@ -9,6 +9,7 @@ module TurboTests
       :example_failed,
       :example_passed,
       :example_pending,
+      :message,
       :seed
     )
 
@@ -95,6 +96,13 @@ module TurboTests
       )
     end
 
+    def message(notification)
+      output_row(
+        type: :message,
+        message: notification.message
+      )
+    end
+
     private
 
     def output_row(obj)
diff --git a/lib/turbo_tests/reporter.rb b/lib/turbo_tests/reporter.rb
index 62a3db2..6d02a1f 100644
--- a/lib/turbo_tests/reporter.rb
+++ b/lib/turbo_tests/reporter.rb
@@ -27,6 +27,8 @@ module TurboTests
       @failed_examples = []
       @all_examples = []
       @start_time = start_time
+      @messages = []
+      @errors_outside_of_examples_count = 0
     end
 
     def add(name, outputs)
@@ -63,6 +65,15 @@ module TurboTests
       @failed_examples << example
     end
 
+    def message(message)
+      delegate_to_formatters(:message, RSpec::Core::Notifications::MessageNotification.new(message))
+      @messages << message
+    end
+
+    def error_outside_of_examples
+      @errors_outside_of_examples_count += 1
+    end
+
     def finish
       end_time = Time.now
 
@@ -86,7 +97,7 @@ module TurboTests
           @failed_examples,
           @pending_examples,
           0,
-          0
+          @errors_outside_of_examples_count
         )
       )
       delegate_to_formatters(:close,
diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rb
index c0e9053..3faff70 100644
--- a/lib/turbo_tests/runner.rb
+++ b/lib/turbo_tests/runner.rb
@@ -44,7 +44,6 @@ module TurboTests
       group_opts = {}
 
       if use_runtime_info
-        FileUtils.rm("tmp/turbo_rspec_runtime.log", force: true)
         group_opts[:runtime_log] = "tmp/turbo_rspec_runtime.log"
       else
         group_opts[:group_by] = :filesize
@@ -189,14 +188,12 @@ module TurboTests
             @messages << { type: 'exit', process_id: process_id }
           end
 
-        stdout_thread = start_copy_thread(stdout, STDOUT)
-        stderr_thread = start_copy_thread(stderr, STDERR)
-        @threads << stdout_thread
-        @threads << stderr_thread
+        @threads << start_copy_thread(stdout, STDOUT)
+        @threads << start_copy_thread(stderr, STDERR)
 
         @threads << Thread.new do
           if wait_thr.value.exitstatus != 0
-            @messages << { type: 'error', record_runtime: record_runtime }
+            @messages << { type: 'error' }
           end
         end
       end
@@ -238,15 +235,13 @@ module TurboTests
               @threads.each(&:kill)
               break
             end
+          when 'message'
+            @reporter.message(message[:message])
           when 'seed'
           when 'close'
           when 'error'
-            if message[:record_runtime]
-              STDERR.puts File.read("tmp/turbo_rspec_runtime.log")
-            end
-            @threads.each(&:kill)
+            @reporter.error_outside_of_examples
             @error = true
-            break
           when 'exit'
             exited += 1
             if exited == @num_processes + 1

GitHub sha: 1157d2a0