| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 # MOCK Try Mac is listed because it's listed in the BuilderList in setUp
. | 317 # MOCK Try Mac is listed because it's listed in the BuilderList in setUp
. |
| 318 self.assertEqual( | 318 self.assertEqual( |
| 319 self.command.builders_with_no_results([Build('MOCK Try Linux', None)
, Build('MOCK Try Win', 123)]), | 319 self.command.builders_with_no_results([Build('MOCK Try Linux', None)
, Build('MOCK Try Win', 123)]), |
| 320 {'MOCK Try Mac', 'MOCK Try Linux'}) | 320 {'MOCK Try Mac', 'MOCK Try Linux'}) |
| 321 | 321 |
| 322 def test_bails_when_one_build_is_missing_results(self): | 322 def test_bails_when_one_build_is_missing_results(self): |
| 323 self.tool.buildbot.set_results(Build('MOCK Try Win', 5000), None) | 323 self.tool.buildbot.set_results(Build('MOCK Try Win', 5000), None) |
| 324 return_code = self.command.execute(self.command_options(), [], self.tool
) | 324 return_code = self.command.execute(self.command_options(), [], self.tool
) |
| 325 self.assertEqual(return_code, 1) | 325 self.assertEqual(return_code, 1) |
| 326 self.assertLog([ | 326 self.assertLog([ |
| 327 'ERROR: Failed to fetch results for: Build(builder_name=\'MOCK Try W
in\', build_number=5000)\n', | 327 'INFO: Failed to fetch results for Build(builder_name=\'MOCK Try Win
\', build_number=5000)\n', |
| 328 'ERROR: Results were expected to exist at:\n' | 328 'INFO: Results URL: https://storage.googleapis.com/chromium-layout-t
est-archives' |
| 329 'https://storage.googleapis.com/chromium-layout-test-archives/MOCK_T
ry_Win/5000/layout-test-results/results.html\n', | 329 '/MOCK_Try_Win/5000/layout-test-results/results.html\n', |
| 330 'ERROR: If the job failed, you could retry by running:\n' | 330 'INFO: Retry job by running: git cl try -b MOCK Try Win\n' |
| 331 'git cl try -b MOCK Try Win\n' | 331 ]) |
| 332 |
| 333 def test_continues_with_missing_results_when_filling_results(self): |
| 334 self.tool.buildbot.set_results(Build('MOCK Try Win', 5000), None) |
| 335 return_code = self.command.execute(self.command_options(fill_missing=Tru
e), ['fast/dom/prototype-taco.html'], self.tool) |
| 336 self.assertEqual(return_code, 0) |
| 337 self.assertLog([ |
| 338 'INFO: Failed to fetch results for Build(builder_name=\'MOCK Try Win
\', build_number=5000)\n', |
| 339 'INFO: Results URL: https://storage.googleapis.com/chromium-layout-t
est-archives' |
| 340 '/MOCK_Try_Win/5000/layout-test-results/results.html\n', |
| 341 'INFO: Retry job by running: git cl try -b MOCK Try Win\n', |
| 342 'INFO: For fast/dom/prototype-taco.html:\n', |
| 343 'INFO: Using Build(builder_name=\'MOCK Try Mac\', build_number=4000)
to supply results for test-win-win7.\n', |
| 344 'INFO: Rebaselining fast/dom/prototype-taco.html\n' |
| 332 ]) | 345 ]) |
| 333 | 346 |
| 334 def test_bails_when_there_are_unstaged_baselines(self): | 347 def test_bails_when_there_are_unstaged_baselines(self): |
| 335 git = self.tool.git() | 348 git = self.tool.git() |
| 336 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} | 349 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} |
| 337 return_code = self.command.execute(self.command_options(), [], self.tool
) | 350 return_code = self.command.execute(self.command_options(), [], self.tool
) |
| 338 self.assertEqual(return_code, 1) | 351 self.assertEqual(return_code, 1) |
| 339 self.assertLog([ | 352 self.assertLog([ |
| 340 'ERROR: Aborting: there are unstaged baselines:\n', | 353 'ERROR: Aborting: there are unstaged baselines:\n', |
| 341 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', | 354 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', |
| 342 ]) | 355 ]) |
| 343 | 356 |
| 344 def test_fill_in_missing_results(self): | 357 def test_fill_in_missing_results(self): |
| 345 test_baseline_set = TestBaselineSet(self.tool) | 358 test_baseline_set = TestBaselineSet(self.tool) |
| 346 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Li
nux', 100)) | 359 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Li
nux', 100)) |
| 347 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Wi
n', 200)) | 360 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Wi
n', 200)) |
| 348 self.command.fill_in_missing_results(test_baseline_set) | 361 self.command.fill_in_missing_results(test_baseline_set) |
| 349 self.assertEqual( | 362 self.assertEqual( |
| 350 test_baseline_set.build_port_pairs('fast/dom/prototype-taco.html'), | 363 test_baseline_set.build_port_pairs('fast/dom/prototype-taco.html'), |
| 351 [ | 364 [ |
| 352 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-l
inux-trusty'), | 365 (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'), | 366 (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'), | 367 (Build(builder_name='MOCK Try Linux', build_number=100), 'test-m
ac-mac10.11'), |
| 355 ]) | 368 ]) |
| 356 self.assertLog([ | 369 self.assertLog([ |
| 357 'INFO: For fast/dom/prototype-taco.html:\n', | 370 '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', | 371 'INFO: Using Build(builder_name=\'MOCK Try Linux\', build_number=100
) to supply results for test-mac-mac10.11.\n', |
| 359 ]) | 372 ]) |
| OLD | NEW |