| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from webkitpy.layout_tests.builder_list import BuilderList | 5 from webkitpy.layout_tests.builder_list import BuilderList |
| 6 from webkitpy.layout_tests.layout_package import bot_test_expectations | 6 from webkitpy.layout_tests.layout_package import bot_test_expectations |
| 7 from webkitpy.tool.commands import flaky_tests | 7 from webkitpy.tool.commands import flaky_tests |
| 8 from webkitpy.tool.commands.command_test import CommandsTest | 8 from webkitpy.tool.commands.command_test import CommandsTest |
| 9 from webkitpy.tool.mock_tool import MockTool, MockOptions | 9 from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions |
| 10 | 10 |
| 11 | 11 |
| 12 class FakeBotTestExpectations(object): | 12 class FakeBotTestExpectations(object): |
| 13 | 13 |
| 14 def expectation_lines(self): | 14 def expectation_lines(self): |
| 15 return [] | 15 return [] |
| 16 | 16 |
| 17 | 17 |
| 18 class FakeBotTestExpectationsFactory(object): | 18 class FakeBotTestExpectationsFactory(object): |
| 19 FAILURE_MAP = {"A": "AUDIO", "C": "CRASH", "F": "TEXT", "I": "IMAGE", "O": "
MISSING", | 19 FAILURE_MAP = {"A": "AUDIO", "C": "CRASH", "F": "TEXT", "I": "IMAGE", "O": "
MISSING", |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 command = flaky_tests.FlakyTests() | 63 command = flaky_tests.FlakyTests() |
| 64 factory = FakeBotTestExpectationsFactory(self.fake_builders_list()) | 64 factory = FakeBotTestExpectationsFactory(self.fake_builders_list()) |
| 65 | 65 |
| 66 lines = command._collect_expectation_lines(['foo-builder', 'bar-builder'
], factory) | 66 lines = command._collect_expectation_lines(['foo-builder', 'bar-builder'
], factory) |
| 67 self.assertEqual(len(lines), 1) | 67 self.assertEqual(len(lines), 1) |
| 68 self.assertEqual(lines[0].expectations, ['TEXT', 'TIMEOUT', 'PASS']) | 68 self.assertEqual(lines[0].expectations, ['TEXT', 'TIMEOUT', 'PASS']) |
| 69 self.assertEqual(lines[0].specifiers, ['Mac', 'Linux']) | 69 self.assertEqual(lines[0].specifiers, ['Mac', 'Linux']) |
| 70 | 70 |
| 71 def test_integration(self): | 71 def test_integration(self): |
| 72 command = flaky_tests.FlakyTests() | 72 command = flaky_tests.FlakyTests() |
| 73 tool = MockTool() | 73 tool = MockWebKitPatch() |
| 74 tool.builders = self.fake_builders_list() | 74 tool.builders = self.fake_builders_list() |
| 75 command.expectations_factory = FakeBotTestExpectationsFactory | 75 command.expectations_factory = FakeBotTestExpectationsFactory |
| 76 options = MockOptions(upload=True) | 76 options = MockOptions(upload=True) |
| 77 expected_stdout = flaky_tests.FlakyTests.OUTPUT % ( | 77 expected_stdout = flaky_tests.FlakyTests.OUTPUT % ( |
| 78 flaky_tests.FlakyTests.HEADER, | 78 flaky_tests.FlakyTests.HEADER, |
| 79 '', | 79 '', |
| 80 flaky_tests.FlakyTests.FLAKINESS_DASHBOARD_URL % '') + '\n' | 80 flaky_tests.FlakyTests.FLAKINESS_DASHBOARD_URL % '') + '\n' |
| 81 | 81 |
| 82 self.assert_execute_outputs(command, options=options, tool=tool, expecte
d_stdout=expected_stdout) | 82 self.assert_execute_outputs(command, options=options, tool=tool, expecte
d_stdout=expected_stdout) |
| OLD | NEW |