@@ -55,7 +55,7 @@ def initialize(build_id:, worker_id:, redis_opts:)
55
55
@fail_fast = 0
56
56
@files_or_dirs_to_run = "spec"
57
57
@populate_timings = false
58
- @file_split_threshold = 999999
58
+ @file_split_threshold = 999_999
59
59
@heartbeat_updated_at = nil
60
60
@max_requeues = 3
61
61
@@ -98,7 +98,7 @@ def work
98
98
# reconfigure rspec
99
99
RSpec . configuration . detail_color = :magenta
100
100
RSpec . configuration . seed = srand && srand % 0xFFFF
101
- RSpec . configuration . backtrace_formatter . filter_gem ( ' rspecq' )
101
+ RSpec . configuration . backtrace_formatter . filter_gem ( " rspecq" )
102
102
RSpec . configuration . add_formatter ( Formatters ::FailureRecorder . new ( queue , job , max_requeues ) )
103
103
RSpec . configuration . add_formatter ( Formatters ::ExampleCountRecorder . new ( queue ) )
104
104
RSpec . configuration . add_formatter ( Formatters ::WorkerHeartbeatRecorder . new ( self ) )
@@ -155,7 +155,7 @@ def try_publish_queue!(queue)
155
155
jobs . concat ( files_to_run )
156
156
end
157
157
158
- default_timing = timings . values [ timings . values . size / 2 ]
158
+ default_timing = timings . values [ timings . values . size / 2 ]
159
159
160
160
# assign timings (based on previous runs) to all jobs
161
161
jobs = jobs . each_with_object ( { } ) do |j , h |
@@ -180,7 +180,8 @@ def reset_rspec_state!
180
180
# see https://github.com/rspec/rspec-core/pull/2723
181
181
if Gem ::Version . new ( RSpec ::Core ::Version ::STRING ) <= Gem ::Version . new ( "3.9.1" )
182
182
RSpec . world . instance_variable_set (
183
- :@example_group_counts_by_spec_file , Hash . new ( 0 ) )
183
+ :@example_group_counts_by_spec_file , Hash . new ( 0 )
184
+ )
184
185
end
185
186
186
187
# RSpec.clear_examples does not reset those, which causes issues when
@@ -204,17 +205,17 @@ def files_to_example_ids(files)
204
205
205
206
if !cmd_result . success?
206
207
rspec_output = begin
207
- JSON . parse ( out )
208
- rescue JSON ::ParserError
209
- out
210
- end
208
+ JSON . parse ( out )
209
+ rescue JSON ::ParserError
210
+ out
211
+ end
211
212
212
213
log_event (
213
214
"Failed to split slow files, falling back to regular scheduling.\n #{ err } " ,
214
215
"error" ,
215
216
rspec_stdout : rspec_output ,
216
217
rspec_stderr : err ,
217
- cmd_result : cmd_result . inspect ,
218
+ cmd_result : cmd_result . inspect
218
219
)
219
220
220
221
pp rspec_output
@@ -236,7 +237,7 @@ def elapsed(since)
236
237
237
238
# Prints msg to standard output and emits an event to Sentry, if the
238
239
# SENTRY_DSN environment variable is set.
239
- def log_event ( msg , level , additional = { } )
240
+ def log_event ( msg , level , additional = { } )
240
241
puts msg
241
242
242
243
Raven . capture_message ( msg , level : level , extra : {
@@ -247,8 +248,8 @@ def log_event(msg, level, additional={})
247
248
populate_timings : populate_timings ,
248
249
file_split_threshold : file_split_threshold ,
249
250
heartbeat_updated_at : @heartbeat_updated_at ,
250
- object : self . inspect ,
251
- pid : Process . pid ,
251
+ object : inspect ,
252
+ pid : Process . pid
252
253
} . merge ( additional ) )
253
254
end
254
255
end
0 commit comments