A platform for community discussion. Free, open, simple.
DEV: lint a bunch of files we missed
Sam Saffron5bc92296be85
diff --git a/lib/tasks/turbo.rake b/lib/tasks/turbo.rakeindex b14ec56fb91..48c5a91b7f7 100644--- a/lib/tasks/turbo.rake+++ b/lib/tasks/turbo.rake@@ -1,5 +1,7 @@+# frozen_string_literal: true+task 'turbo:spec' => :test do |t|require './lib/turbo_tests'- TurboTests::Runner.run([{name: 'progress', outputs: ['-']}], ['spec'])+ TurboTests::Runner.run([{ name: 'progress', outputs: ['-'] }], ['spec'])enddiff --git a/lib/turbo_tests.rb b/lib/turbo_tests.rbindex 5e88601667f..b3715ae5332 100644--- a/lib/turbo_tests.rb+++ b/lib/turbo_tests.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require 'open3'require 'fileutils'require 'json'diff --git a/lib/turbo_tests/json_rows_formatter.rb b/lib/turbo_tests/json_rows_formatter.rbindex e9379c574db..2ec66d0f8db 100644--- a/lib/turbo_tests/json_rows_formatter.rb+++ b/lib/turbo_tests/json_rows_formatter.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TurboTests# An RSpec formatter used for each subprocess during parallel test executionclass JsonRowsFormatter@@ -50,37 +52,37 @@ module TurboTestsenddef example_passed(notification)- output_row({+ output_row(type: :example_passed,example: example_to_json(notification.example)- })+ )enddef example_pending(notification)- output_row({+ output_row(type: :example_pending,example: example_to_json(notification.example)- })+ )enddef example_failed(notification)- output_row({+ output_row(type: :example_failed,example: example_to_json(notification.example)- })+ )enddef seed(notification)- output_row({+ output_row(type: :seed,seed: notification.seed,- })+ )enddef close(notification)- output_row({+ output_row(type: :close,- })+ )endprivatediff --git a/lib/turbo_tests/reporter.rb b/lib/turbo_tests/reporter.rbindex f9442fc410d..62a3db2e48d 100644--- a/lib/turbo_tests/reporter.rb+++ b/lib/turbo_tests/reporter.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TurboTestsclass Reporterdef self.from_config(formatter_config, start_time)diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rbindex 2e27f20fdb8..9f9b78d1b6c 100644--- a/lib/turbo_tests/runner.rb+++ b/lib/turbo_tests/runner.rb@@ -1,6 +1,8 @@+# frozen_string_literal: true+module TurboTestsclass Runner- def self.run(formatter_config, files, start_time=Time.now)+ def self.run(formatter_config, files, start_time = Time.now)reporter = Reporter.from_config(formatter_config, start_time)new(reporter, files).run@@ -49,16 +51,19 @@ module TurboTestsdef start_subprocess(tests, process_num)if tests.empty?- @messages << {type: 'exit', process_num: process_num}+ @messages << {+ type: 'exit',+ process_num: process_num+ }elsebeginFile.mkfifo("tmp/test-pipes/subprocess-#{process_num}")rescue Errno::EEXISTend- stdin, stdout, stderr, wait_thr =+ _stdin, stdout, stderr, _wait_thr =Open3.popen3(- {'TEST_ENV_NUMBER' => process_num.to_s},+ { 'TEST_ENV_NUMBER' => process_num.to_s },"bundle", "exec", "rspec","-f", "TurboTests::JsonRowsFormatter","-o", "tmp/test-pipes/subprocess-#{process_num}",@@ -76,7 +81,7 @@ module TurboTestsendend- @messages << {type: 'exit', process_num: process_num}+ @messages << { type: 'exit', process_num: process_num }end@threads << start_copy_thread(stdout, STDOUT)