| 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 import optparse |
| 6 |
| 5 from webkitpy.layout_tests.builder_list import BuilderList | 7 from webkitpy.layout_tests.builder_list import BuilderList |
| 6 from webkitpy.layout_tests.layout_package import bot_test_expectations | 8 from webkitpy.layout_tests.layout_package import bot_test_expectations |
| 7 from webkitpy.tool.commands import flaky_tests | 9 from webkitpy.tool.commands import flaky_tests |
| 8 from webkitpy.tool.commands.command_test import CommandsTest | 10 from webkitpy.tool.commands.command_test import CommandsTest |
| 9 from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions | 11 from webkitpy.tool.mock_tool import MockWebKitPatch |
| 10 | 12 |
| 11 | 13 |
| 12 class FakeBotTestExpectations(object): | 14 class FakeBotTestExpectations(object): |
| 13 | 15 |
| 14 def expectation_lines(self): | 16 def expectation_lines(self): |
| 15 return [] | 17 return [] |
| 16 | 18 |
| 17 | 19 |
| 18 class FakeBotTestExpectationsFactory(object): | 20 class FakeBotTestExpectationsFactory(object): |
| 19 FAILURE_MAP = {"A": "AUDIO", "C": "CRASH", "F": "TEXT", "I": "IMAGE", "O": "
MISSING", | 21 FAILURE_MAP = {"A": "AUDIO", "C": "CRASH", "F": "TEXT", "I": "IMAGE", "O": "
MISSING", |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 lines = command._collect_expectation_lines(['foo-builder', 'bar-builder'
], factory) | 68 lines = command._collect_expectation_lines(['foo-builder', 'bar-builder'
], factory) |
| 67 self.assertEqual(len(lines), 1) | 69 self.assertEqual(len(lines), 1) |
| 68 self.assertEqual(lines[0].expectations, ['TEXT', 'TIMEOUT', 'PASS']) | 70 self.assertEqual(lines[0].expectations, ['TEXT', 'TIMEOUT', 'PASS']) |
| 69 self.assertEqual(lines[0].specifiers, ['Mac', 'Linux']) | 71 self.assertEqual(lines[0].specifiers, ['Mac', 'Linux']) |
| 70 | 72 |
| 71 def test_integration(self): | 73 def test_integration(self): |
| 72 command = flaky_tests.FlakyTests() | 74 command = flaky_tests.FlakyTests() |
| 73 tool = MockWebKitPatch() | 75 tool = MockWebKitPatch() |
| 74 tool.builders = self.fake_builders_list() | 76 tool.builders = self.fake_builders_list() |
| 75 command.expectations_factory = FakeBotTestExpectationsFactory | 77 command.expectations_factory = FakeBotTestExpectationsFactory |
| 76 options = MockOptions(upload=True) | 78 options = optparse.Values({'upload': True}) |
| 77 expected_stdout = flaky_tests.FlakyTests.OUTPUT % ( | 79 expected_stdout = flaky_tests.FlakyTests.OUTPUT % ( |
| 78 flaky_tests.FlakyTests.HEADER, | 80 flaky_tests.FlakyTests.HEADER, |
| 79 '', | 81 '', |
| 80 flaky_tests.FlakyTests.FLAKINESS_DASHBOARD_URL % '') + '\n' | 82 flaky_tests.FlakyTests.FLAKINESS_DASHBOARD_URL % '') + '\n' |
| 81 | 83 |
| 82 self.assert_execute_outputs(command, options=options, tool=tool, expecte
d_stdout=expected_stdout) | 84 self.assert_execute_outputs(command, options=options, tool=tool, expecte
d_stdout=expected_stdout) |
| OLD | NEW |