@@ -8,6 +8,7 @@ class Runner
88 EXAMPLE_RUN_REASON = {
99 explicit_run : 'Explicit run' ,
1010 no_cache : 'No cache' ,
11+ interrupted : 'Interrupted previously' ,
1112 flaky_example : 'Flaky example' ,
1213 failed_example : 'Failed previously' ,
1314 pending_example : 'Pending previously' ,
@@ -59,6 +60,10 @@ def on_example_pending(example_id, execution_result)
5960 @reporter . on_example_pending ( example_id , execution_result )
6061 end
6162
63+ def register_interrupted_examples
64+ @reporter . register_interrupted_examples
65+ end
66+
6267 def register_deleted_examples
6368 @reporter . register_deleted_examples ( @cache . all_examples )
6469 end
@@ -77,6 +82,7 @@ def generate_missed_coverage
7782
7883 @cache . cached_examples_coverage . each_pair do |example_id , example_coverage |
7984 example_coverage . each_pair do |file_path , line_coverage |
85+ next if @reporter . example_interrupted? ( example_id )
8086 next unless @reporter . example_skipped? ( example_id )
8187
8288 file_name = RSpecTracer ::SourceFile . file_name ( file_path )
@@ -97,6 +103,8 @@ def register_dependency(examples_coverage)
97103 filtered_files = Set . new
98104
99105 examples_coverage . each_pair do |example_id , example_coverage |
106+ next if @reporter . example_interrupted? ( example_id )
107+
100108 register_example_files_dependency ( example_id )
101109
102110 example_coverage . each_key do |file_path |
@@ -122,6 +130,8 @@ def register_untraced_dependency(trace_point_files)
122130 @reporter . register_source_file ( source_file )
123131
124132 @reporter . all_examples . each_key do |example_id |
133+ next if @reporter . example_interrupted? ( example_id )
134+
125135 @reporter . register_dependency ( example_id , source_file [ :file_name ] )
126136 end
127137 end
@@ -169,6 +179,7 @@ def filter_examples_to_run
169179 end
170180
171181 def filter_by_example_status
182+ add_previously_interrupted_examples
172183 add_previously_flaky_examples
173184 add_previously_failed_examples
174185 add_previously_pending_examples
@@ -183,6 +194,12 @@ def filter_by_files_changed
183194 end
184195 end
185196
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+
186203 def add_previously_flaky_examples
187204 @cache . flaky_examples . each do |example_id |
188205 @filtered_examples [ example_id ] = EXAMPLE_RUN_REASON [ :flaky_example ]
@@ -249,6 +266,8 @@ def fetch_rspec_required_files
249266 end
250267
251268 def register_example_files_dependency ( example_id )
269+ return if @reporter . example_interrupted? ( example_id )
270+
252271 example = @reporter . all_examples [ example_id ]
253272
254273 register_example_file_dependency ( example_id , example [ :file_name ] )
@@ -259,13 +278,17 @@ def register_example_files_dependency(example_id)
259278 end
260279
261280 def register_example_file_dependency ( example_id , file_name )
281+ return if @reporter . example_interrupted? ( example_id )
282+
262283 source_file = RSpecTracer ::SourceFile . from_name ( file_name )
263284
264285 @reporter . register_source_file ( source_file )
265286 @reporter . register_dependency ( example_id , file_name )
266287 end
267288
268289 def register_file_dependency ( example_id , file_path )
290+ return if @reporter . example_interrupted? ( example_id )
291+
269292 source_file = RSpecTracer ::SourceFile . from_path ( file_path )
270293
271294 return false if RSpecTracer . filters . any? { |filter | filter . match? ( source_file ) }
0 commit comments