Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ def is_expected(result):
add_to_dict_of_lists(passes, 'Expected to fail, but passed', test)
elif enabled_pixel_tests_in_retry and (actual == ['TEXT', 'IMAGE+TEXT'] or actual == ['TEXT', 'MISSING']):
add_to_dict_of_lists(regressions, actual[0], test)
elif results.get('report') == 'FLAKY':
# We group flaky tests by the first actual result we got.
add_to_dict_of_lists(flaky, actual[0], test)
elif results.get('report') == 'REGRESSION':
# A test failing in both the initial and retry runs is a
# regression, even when the result types differ between runs.
add_to_dict_of_lists(regressions, actual[0], test)
elif len(actual) > 1:
# We group flaky tests by the first actual result we got.
add_to_dict_of_lists(flaky, actual[0], test)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from webkitpy.common.host_mock import MockHost
from webkitpy.tool.mocktool import MockOptions
from webkitpy.layout_tests.models import test_expectations
from webkitpy.layout_tests.models import test_run_results
from webkitpy.layout_tests.models import test_run_results_unittest
from webkitpy.layout_tests.views import buildbot_results
Expand Down Expand Up @@ -86,6 +87,26 @@ def test_print_unexpected_results(self):
printer.print_unexpected_results(summary)
self.assertNotEmpty(out)

def test_print_unexpected_results_regression_with_differing_retry_result(self):
port = MockHost().port_factory.get('test', options=MockOptions(pixel_tests=False, world_leaks=False))
printer, out = self.get_printer()

# A test failing in both the initial and retry runs is a regression,
# even when the result types differ between the runs, and must be
# reported as a regression rather than as flakiness.
initial_results = test_run_results_unittest.run_results(port)
initial_results.add(test_run_results_unittest.get_result('passes/text.html', test_expectations.TIMEOUT), False)
retry_results = test_run_results_unittest.run_results(port)
retry_results.add(test_run_results_unittest.get_result('passes/text.html', test_expectations.CRASH), False)
summary = test_run_results.summarize_results(
port, {None: initial_results.expectations}, initial_results, retry_results, enabled_pixel_tests_in_retry=False)
self.assertEqual(summary['num_regressions'], 1)
self.assertEqual(summary['num_flaky'], 0)
printer.print_unexpected_results(summary)
self.assertIn('Regressions: Unexpected', out.getvalue())
self.assertIn('passes/text.html', out.getvalue())
self.assertNotIn('Unexpected flakiness', out.getvalue())

def test_print_unexpected_results_with_options(self):
port = MockHost().port_factory.get('test', options=MockOptions(pixel_tests=False, world_leaks=False))

Expand Down