@@ -8,6 +8,7 @@ class Runner
8
8
EXAMPLE_RUN_REASON = {
9
9
explicit_run : 'Explicit run' ,
10
10
no_cache : 'No cache' ,
11
+ interrupted : 'Interrupted previously' ,
11
12
flaky_example : 'Flaky example' ,
12
13
failed_example : 'Failed previously' ,
13
14
pending_example : 'Pending previously' ,
@@ -59,6 +60,10 @@ def on_example_pending(example_id, execution_result)
59
60
@reporter . on_example_pending ( example_id , execution_result )
60
61
end
61
62
63
+ def register_interrupted_examples
64
+ @reporter . register_interrupted_examples
65
+ end
66
+
62
67
def register_deleted_examples
63
68
@reporter . register_deleted_examples ( @cache . all_examples )
64
69
end
@@ -77,6 +82,7 @@ def generate_missed_coverage
77
82
78
83
@cache . cached_examples_coverage . each_pair do |example_id , example_coverage |
79
84
example_coverage . each_pair do |file_path , line_coverage |
85
+ next if @reporter . example_interrupted? ( example_id )
80
86
next unless @reporter . example_skipped? ( example_id )
81
87
82
88
file_name = RSpecTracer ::SourceFile . file_name ( file_path )
@@ -97,6 +103,8 @@ def register_dependency(examples_coverage)
97
103
filtered_files = Set . new
98
104
99
105
examples_coverage . each_pair do |example_id , example_coverage |
106
+ next if @reporter . example_interrupted? ( example_id )
107
+
100
108
register_example_files_dependency ( example_id )
101
109
102
110
example_coverage . each_key do |file_path |
@@ -122,6 +130,8 @@ def register_untraced_dependency(trace_point_files)
122
130
@reporter . register_source_file ( source_file )
123
131
124
132
@reporter . all_examples . each_key do |example_id |
133
+ next if @reporter . example_interrupted? ( example_id )
134
+
125
135
@reporter . register_dependency ( example_id , source_file [ :file_name ] )
126
136
end
127
137
end
@@ -169,6 +179,7 @@ def filter_examples_to_run
169
179
end
170
180
171
181
def filter_by_example_status
182
+ add_previously_interrupted_examples
172
183
add_previously_flaky_examples
173
184
add_previously_failed_examples
174
185
add_previously_pending_examples
@@ -183,6 +194,12 @@ def filter_by_files_changed
183
194
end
184
195
end
185
196
197
+ def add_previously_interrupted_examples
198
+ @cache . interrupted_examples . each do |example_id |
199
+ @filtered_examples [ example_id ] = EXAMPLE_RUN_REASON [ :interrupted ]
200
+ end
201
+ end
202
+
186
203
def add_previously_flaky_examples
187
204
@cache . flaky_examples . each do |example_id |
188
205
@filtered_examples [ example_id ] = EXAMPLE_RUN_REASON [ :flaky_example ]
@@ -249,6 +266,8 @@ def fetch_rspec_required_files
249
266
end
250
267
251
268
def register_example_files_dependency ( example_id )
269
+ return if @reporter . example_interrupted? ( example_id )
270
+
252
271
example = @reporter . all_examples [ example_id ]
253
272
254
273
register_example_file_dependency ( example_id , example [ :file_name ] )
@@ -259,13 +278,17 @@ def register_example_files_dependency(example_id)
259
278
end
260
279
261
280
def register_example_file_dependency ( example_id , file_name )
281
+ return if @reporter . example_interrupted? ( example_id )
282
+
262
283
source_file = RSpecTracer ::SourceFile . from_name ( file_name )
263
284
264
285
@reporter . register_source_file ( source_file )
265
286
@reporter . register_dependency ( example_id , file_name )
266
287
end
267
288
268
289
def register_file_dependency ( example_id , file_path )
290
+ return if @reporter . example_interrupted? ( example_id )
291
+
269
292
source_file = RSpecTracer ::SourceFile . from_path ( file_path )
270
293
271
294
return false if RSpecTracer . filters . any? { |filter | filter . match? ( source_file ) }
0 commit comments