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 re | 5 import re |
6 import string | 6 import string |
7 | 7 |
8 | 8 |
9 class Test(object): | 9 class Test(object): |
10 """ | 10 """ |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 str(script_spec['name']), | 527 str(script_spec['name']), |
528 script_spec['script'], | 528 script_spec['script'], |
529 scripts_compile_targets, | 529 scripts_compile_targets, |
530 script_spec.get('args', []), | 530 script_spec.get('args', []), |
531 script_spec.get('override_compile_targets', [])) | 531 script_spec.get('override_compile_targets', [])) |
532 | 532 |
533 | 533 |
534 class DynamicPerfTests(Test): | 534 class DynamicPerfTests(Test): |
535 def __init__(self, perf_id, platform, target_bits, max_battery_temp=None, | 535 def __init__(self, perf_id, platform, target_bits, max_battery_temp=None, |
536 num_device_shards=1, num_host_shards=1, shard_index=0, | 536 num_device_shards=1, num_host_shards=1, shard_index=0, |
537 known_devices_file=None, override_browser_name=None): | 537 override_browser_name=None): |
538 self._perf_id = perf_id | 538 self._perf_id = perf_id |
539 self._platform = platform | 539 self._platform = platform |
540 self._target_bits = target_bits | 540 self._target_bits = target_bits |
541 | 541 |
542 self._max_battery_temp = max_battery_temp | 542 self._max_battery_temp = max_battery_temp |
543 self._num_host_shards = num_host_shards | 543 self._num_host_shards = num_host_shards |
544 self._num_device_shards = num_device_shards | 544 self._num_device_shards = num_device_shards |
545 self._shard_index = shard_index | 545 self._shard_index = shard_index |
546 self._known_devices_file = known_devices_file | |
547 | 546 |
548 if override_browser_name: | 547 if override_browser_name: |
549 self._browser_name = override_browser_name | 548 self._browser_name = override_browser_name |
550 else: | 549 else: |
551 if platform == 'android': | 550 if platform == 'android': |
552 self._browser_name = 'android-chromium' | 551 self._browser_name = 'android-chromium' |
553 elif platform == 'win' and target_bits == 64: | 552 elif platform == 'win' and target_bits == 64: |
554 self._browser_name = 'release_x64' | 553 self._browser_name = 'release_x64' |
555 else: | 554 else: |
556 self._browser_name ='release' | 555 self._browser_name ='release' |
(...skipping 27 matching lines...) Expand all Loading... |
584 device=device).json.output | 583 device=device).json.output |
585 | 584 |
586 tests['steps'] = {k: v for k, v in tests['steps'].iteritems() | 585 tests['steps'] = {k: v for k, v in tests['steps'].iteritems() |
587 if v['device_affinity'] / self._num_device_shards == self._shard_index} | 586 if v['device_affinity'] / self._num_device_shards == self._shard_index} |
588 for test_info in tests['steps'].itervalues(): | 587 for test_info in tests['steps'].itervalues(): |
589 test_info['device_affinity'] %= self._num_device_shards | 588 test_info['device_affinity'] %= self._num_device_shards |
590 | 589 |
591 return tests | 590 return tests |
592 | 591 |
593 def _run_sharded(self, api, tests): | 592 def _run_sharded(self, api, tests): |
594 known_devices_file = ( | |
595 api.path['build'].join( | |
596 'site_config', self._known_devices_file) if self._known_devices_file | |
597 else None) | |
598 api.chromium_android.run_sharded_perf_tests( | 593 api.chromium_android.run_sharded_perf_tests( |
599 config=api.json.input(data=tests), | 594 config=api.json.input(data=tests), |
600 perf_id=self._perf_id, | 595 perf_id=self._perf_id, |
601 chartjson_file=True, | 596 chartjson_file=True, |
602 max_battery_temp=self._max_battery_temp, | 597 max_battery_temp=self._max_battery_temp, |
603 known_devices_file=known_devices_file) | 598 known_devices_file=api.chromium_android.known_devices_file) |
604 | 599 |
605 def _run_serially(self, api, tests): | 600 def _run_serially(self, api, tests): |
606 failure = None | 601 failure = None |
607 for test_name, test in sorted(tests['steps'].iteritems()): | 602 for test_name, test in sorted(tests['steps'].iteritems()): |
608 test_name = str(test_name) | 603 test_name = str(test_name) |
609 annotate = api.chromium.get_annotate_by_test_name(test_name) | 604 annotate = api.chromium.get_annotate_by_test_name(test_name) |
610 cmd = test['cmd'].split() | 605 cmd = test['cmd'].split() |
611 try: | 606 try: |
612 api.chromium.runtest( | 607 api.chromium.runtest( |
613 cmd[1] if len(cmd) > 1 else cmd[0], | 608 cmd[1] if len(cmd) > 1 else cmd[0], |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 def run(self, api, suffix, test_filter=None): | 1856 def run(self, api, suffix, test_filter=None): |
1862 api.chromium_android.coverage_report(upload=False) | 1857 api.chromium_android.coverage_report(upload=False) |
1863 api.chromium_android.get_changed_lines_for_revision() | 1858 api.chromium_android.get_changed_lines_for_revision() |
1864 api.chromium_android.incremental_coverage_report() | 1859 api.chromium_android.incremental_coverage_report() |
1865 | 1860 |
1866 | 1861 |
1867 GOMA_TESTS = [ | 1862 GOMA_TESTS = [ |
1868 GTestTest('base_unittests'), | 1863 GTestTest('base_unittests'), |
1869 GTestTest('content_unittests'), | 1864 GTestTest('content_unittests'), |
1870 ] | 1865 ] |
OLD | NEW |