@@ -11,10 +11,12 @@ def setup
1111 end
1212
1313 def test_bisect
14+ result = nil
1415 out , err = capture_subprocess_io do
15- run_bisect ( 'log/leaky_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
16+ result = run_bisect ( 'log/leaky_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
1617 end
1718
19+ assert_equal true , result , "bisect should exit 0 when a leaky test is identified"
1820 assert_empty filter_deprecation_warnings ( err )
1921 expected_output = strip_heredoc <<-EOS
2022 --- Testing the failing test in isolation
@@ -101,10 +103,12 @@ def test_bisect
101103 end
102104
103105 def test_inconclusive
106+ result = nil
104107 out , err = capture_subprocess_io do
105- run_bisect ( 'log/unconclusive_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
108+ result = run_bisect ( 'log/unconclusive_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
106109 end
107110
111+ assert_equal true , result , "inconclusive bisect should exit 0; it ran successfully and reported a valid diagnostic outcome"
108112 assert_empty filter_deprecation_warnings ( err )
109113 expected_output = strip_heredoc <<-EOS
110114 --- Testing the failing test in isolation
@@ -178,10 +182,12 @@ def test_inconclusive
178182 end
179183
180184 def test_failing_test_is_the_first_entry_in_the_test_order
185+ result = nil
181186 out , err = capture_subprocess_io do
182- run_bisect ( 'log/unconclusive_test_order.log' , 'LeakyTest#test_useless_0' )
187+ result = run_bisect ( 'log/unconclusive_test_order.log' , 'LeakyTest#test_useless_0' )
183188 end
184189
190+ assert_equal true , result , "should exit 0 when there is nothing to bisect; the run completed normally"
185191 assert_empty filter_deprecation_warnings ( err )
186192 expected_output = strip_heredoc <<-EOS
187193 --- Testing the failing test in isolation
@@ -193,10 +199,12 @@ def test_failing_test_is_the_first_entry_in_the_test_order
193199 end
194200
195201 def test_broken_tests_which_are_not_evaluated_are_ignored
202+ result = nil
196203 out , err = capture_subprocess_io do
197- run_bisect ( 'log/leaky_with_broken_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
204+ result = run_bisect ( 'log/leaky_with_broken_test_order.log' , 'LeakyTest#test_sensible_to_leak' )
198205 end
199206
207+ assert_equal true , result , "inconclusive bisect should exit 0 even when broken tests are skipped along the way"
200208 assert_empty filter_deprecation_warnings ( err )
201209 expected_output = strip_heredoc <<-EOS
202210 --- Testing the failing test in isolation
@@ -270,10 +278,12 @@ def test_broken_tests_which_are_not_evaluated_are_ignored
270278 end
271279
272280 def test_broken
281+ result = nil
273282 out , err = capture_subprocess_io do
274- run_bisect ( 'log/broken_test_order.log' , 'LeakyTest#test_broken_test' )
283+ result = run_bisect ( 'log/broken_test_order.log' , 'LeakyTest#test_broken_test' )
275284 end
276285
286+ assert_equal true , result , "should exit 0 when the failing test fails in isolation; bisect ran and produced a useful diagnostic"
277287 assert_empty filter_deprecation_warnings ( err )
278288 expected_output = strip_heredoc <<-EOS
279289 --- Testing the failing test in isolation
@@ -287,10 +297,12 @@ def test_broken
287297 end
288298
289299 def test_failing_test_is_not_present
300+ result = nil
290301 out , err = capture_subprocess_io do
291- run_bisect ( 'log/leaky_test_order.log' , 'LeakyTestDoesNotExist#test_sensible_to_leak' )
302+ result = run_bisect ( 'log/leaky_test_order.log' , 'LeakyTestDoesNotExist#test_sensible_to_leak' )
292303 end
293304
305+ assert_equal false , result , "should exit non-zero when the failing test cannot be found; the run could not actually execute"
294306 assert_empty filter_deprecation_warnings ( err )
295307 expected_output = strip_heredoc <<-EOS
296308 --- Testing the failing test in isolation
0 commit comments