diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py')
| -rw-r--r-- | Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index 166d191ac..22e853491 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -97,79 +97,6 @@ class BuildCoverageExtrapolatorTest(unittest.TestCase): self.assertRaises(KeyError, extrapolator.extrapolate_test_configurations, "Potato") -class GardeningExpectationsUpdaterTest(unittest.TestCase): - def __init__(self, testFunc): - self.tool = MockTool() - self.tool.executive = MockExecutive(should_log=True) - self.tool.filesystem.files[TestPortFactory.path_to_test_expectations_file()] = "" - unittest.TestCase.__init__(self, testFunc) - - def assert_update(self, failure_info_list, expectations_before=None, expectations_after=None, expected_exception=None): - updater = GardeningExpectationsUpdater(self.tool, TestPortFactory.create()) - path_to_test_expectations_file = TestPortFactory.path_to_test_expectations_file() - self.tool.filesystem.files[path_to_test_expectations_file] = expectations_before or "" - if expected_exception: - self.assertRaises(expected_exception, updater.update_expectations, (failure_info_list)) - else: - updater.update_expectations(failure_info_list) - self.assertEquals(self.tool.filesystem.files[path_to_test_expectations_file], expectations_after) - - def test_empty_expectations(self): - failure_info_list = [] - expectations_before = "" - expectations_after = "" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_unknown_builder(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Bob", "failureTypeList": ["IMAGE"]}] - self.assert_update(failure_info_list, expected_exception=KeyError) - - def test_empty_failure_type_list(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": []}] - self.assert_update(failure_info_list, expected_exception=AssertionError) - - def test_empty_test_name(self): - failure_info_list = [{"testName": "", "builderName": "Webkit Win", "failureTypeList": ["TEXT"]}] - self.assert_update(failure_info_list, expected_exception=AssertionError) - - def test_unknown_failure_type(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE", "EXPLODE"]}] - expectations_before = "" - expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_add_new_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "" - expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_replace_old_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_pass_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["PASS"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_supplement_old_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/text.html = TEXT" - expectations_after = ("BUG_OLD XP RELEASE : failures/expected/text.html = TEXT\n" - "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE") - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_spurious_updates(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - class GardeningServerTest(unittest.TestCase): def _post_to_path(self, path, body=None, expected_stderr=None, expected_stdout=None, server=None): handler = TestGardeningHTTPRequestHandler(server or MockServer()) @@ -203,8 +130,3 @@ class GardeningServerTest(unittest.TestCase): expected_stderr = 'MOCK run_command: [\'echo\', \'rebaseline-json\'], cwd=/mock-checkout, input={"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}\n' expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout) - - def test_updateexpectations(self): - expected_stderr = "" - expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/updateexpectations", body="[]", expected_stderr=expected_stderr, expected_stdout=expected_stdout) |
