Chromium Code Reviews| 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 datetime | 5 import datetime |
| 6 import json | 6 import json |
| 7 import re | 7 import re |
| 8 import string | 8 import string |
| 9 | 9 |
| 10 | 10 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 self._browser_name ='release' | 572 self._browser_name ='release' |
| 573 | 573 |
| 574 @property | 574 @property |
| 575 def name(self): | 575 def name(self): |
| 576 return 'dynamic_perf_tests' | 576 return 'dynamic_perf_tests' |
| 577 | 577 |
| 578 @property | 578 @property |
| 579 def uses_local_devices(self): | 579 def uses_local_devices(self): |
| 580 return True | 580 return True |
| 581 | 581 |
| 582 def pre_run(self, api, suffix): | |
| 583 if self._platform == 'android': | |
| 584 api.chromium_android.use_devil_adb() | |
|
jbudorick
2016/11/11 22:47:57
This happens too late.
| |
| 585 | |
| 582 def run(self, api, suffix, test_filter=None): | 586 def run(self, api, suffix, test_filter=None): |
| 583 tests = self._test_list(api) | 587 tests = self._test_list(api) |
| 584 | 588 |
| 585 if self._num_device_shards == 1: | 589 if self._num_device_shards == 1: |
| 586 self._run_serially(api, tests) | 590 self._run_serially(api, tests) |
| 587 else: | 591 else: |
| 588 self._run_sharded(api, tests) | 592 self._run_sharded(api, tests) |
| 589 | 593 |
| 590 def _test_list(self, api): | 594 def _test_list(self, api): |
| 591 if self._platform == 'android': | 595 if self._platform == 'android': |
| 592 # Must have already called device_status_check(). | 596 # Must have already called device_status_check(). |
| 593 device = api.chromium_android.devices[0] | 597 device = api.chromium_android.devices[0] |
| 594 else: | 598 else: |
| 595 device = None | 599 device = None |
| 596 | 600 |
| 601 # Don't want to clutter up the command line if we're not on android. | |
| 602 pass_adb_path = False | |
| 603 if self._platform == 'android' and self._pass_adb_path: | |
| 604 pass_adb_path = True | |
| 605 | |
| 597 tests = api.chromium.list_perf_tests( | 606 tests = api.chromium.list_perf_tests( |
| 598 browser=self._browser_name, | 607 browser=self._browser_name, |
| 599 num_shards=self._num_host_shards * self._num_device_shards, | 608 num_shards=self._num_host_shards * self._num_device_shards, |
| 600 device=device).json.output | 609 device=device, pass_adb_path=pass_adb_path).json.output |
| 601 | 610 |
| 602 tests['steps'] = {k: v for k, v in tests['steps'].iteritems() | 611 tests['steps'] = {k: v for k, v in tests['steps'].iteritems() |
| 603 if v['device_affinity'] / self._num_device_shards == self._shard_index} | 612 if v['device_affinity'] / self._num_device_shards == self._shard_index} |
| 604 for test_info in tests['steps'].itervalues(): | 613 for test_info in tests['steps'].itervalues(): |
| 605 test_info['device_affinity'] %= self._num_device_shards | 614 test_info['device_affinity'] %= self._num_device_shards |
| 606 | 615 |
| 607 return tests | 616 return tests |
| 608 | 617 |
| 609 def _run_sharded(self, api, tests): | 618 def _run_sharded(self, api, tests): |
| 610 api.chromium_android.run_sharded_perf_tests( | 619 api.chromium_android.run_sharded_perf_tests( |
| (...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1903 args=args) | 1912 args=args) |
| 1904 api.gsutil.upload( | 1913 api.gsutil.upload( |
| 1905 temp_output_dir.join( | 1914 temp_output_dir.join( |
| 1906 '%s-android-chrome.json' % timestamp_string), | 1915 '%s-android-chrome.json' % timestamp_string), |
| 1907 'chromium-annotated-tests', 'android') | 1916 'chromium-annotated-tests', 'android') |
| 1908 | 1917 |
| 1909 GOMA_TESTS = [ | 1918 GOMA_TESTS = [ |
| 1910 GTestTest('base_unittests'), | 1919 GTestTest('base_unittests'), |
| 1911 GTestTest('content_unittests'), | 1920 GTestTest('content_unittests'), |
| 1912 ] | 1921 ] |
| OLD | NEW |