| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 json | 5 import json |
| 6 import optparse | 6 import optparse |
| 7 | 7 |
| 8 from webkitpy.common.net.buildbot import Build | 8 from webkitpy.common.net.buildbot import Build |
| 9 from webkitpy.common.net.git_cl import GitCL | 9 from webkitpy.common.net.git_cl import GitCL |
| 10 from webkitpy.common.checkout.git_mock import MockGit | 10 from webkitpy.common.checkout.git_mock import MockGit |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 test_baseline_set.build_port_pairs('fast/dom/prototype-taco.html'), | 350 test_baseline_set.build_port_pairs('fast/dom/prototype-taco.html'), |
| 351 [ | 351 [ |
| 352 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-l
inux-trusty'), | 352 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-l
inux-trusty'), |
| 353 (Build(builder_name='MOCK Try Win', build_number=200), 'test-win
-win7'), | 353 (Build(builder_name='MOCK Try Win', build_number=200), 'test-win
-win7'), |
| 354 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-m
ac-mac10.11'), | 354 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-m
ac-mac10.11'), |
| 355 ]) | 355 ]) |
| 356 self.assertLog([ | 356 self.assertLog([ |
| 357 'INFO: For fast/dom/prototype-taco.html:\n', | 357 'INFO: For fast/dom/prototype-taco.html:\n', |
| 358 'INFO: Using Build(builder_name=\'MOCK Try Linux\', build_number=100
) to supply results for test-mac-mac10.11.\n', | 358 'INFO: Using Build(builder_name=\'MOCK Try Linux\', build_number=100
) to supply results for test-mac-mac10.11.\n', |
| 359 ]) | 359 ]) |
| 360 |
| 361 def test_fill_in_missing_results_prefers_build_with_same_os_type(self): |
| 362 self.tool.builders = BuilderList({ |
| 363 'MOCK Foo12': { |
| 364 'port_name': 'foo-foo12', |
| 365 'specifiers': ['Foo12', 'Release'], |
| 366 'is_try_builder': True, |
| 367 }, |
| 368 'MOCK Foo45': { |
| 369 'port_name': 'foo-foo45', |
| 370 'specifiers': ['Foo45', 'Release'], |
| 371 'is_try_builder': True, |
| 372 }, |
| 373 'MOCK Bar3': { |
| 374 'port_name': 'bar-bar3', |
| 375 'specifiers': ['Bar3', 'Release'], |
| 376 'is_try_builder': True, |
| 377 }, |
| 378 'MOCK Bar4': { |
| 379 'port_name': 'bar-bar4', |
| 380 'specifiers': ['Bar4', 'Release'], |
| 381 'is_try_builder': True, |
| 382 }, |
| 383 }) |
| 384 test_baseline_set = TestBaselineSet(self.tool) |
| 385 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Foo12'
, 100)) |
| 386 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Bar4',
200)) |
| 387 self.command.fill_in_missing_results(test_baseline_set) |
| 388 self.assertEqual( |
| 389 test_baseline_set.build_port_pairs('fast/dom/prototype-taco.html'), |
| 390 [ |
| 391 (Build(builder_name='MOCK Foo12', build_number=100), 'foo-foo12'
), |
| 392 (Build(builder_name='MOCK Bar4', build_number=200), 'bar-bar4'), |
| 393 (Build(builder_name='MOCK Foo12', build_number=100), 'foo-foo45'
), |
| 394 (Build(builder_name='MOCK Bar4', build_number=200), 'bar-bar3'), |
| 395 ]) |
| 396 self.assertLog([ |
| 397 'INFO: For fast/dom/prototype-taco.html:\n', |
| 398 'INFO: Using Build(builder_name=\'MOCK Foo12\', build_number=100) to
supply results for foo-foo45.\n', |
| 399 'INFO: Using Build(builder_name=\'MOCK Bar4\', build_number=200) to
supply results for bar-bar3.\n', |
| 400 ]) |
| OLD | NEW |