OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 collections | 5 import collections |
6 import datetime | 6 import datetime |
7 import math | 7 import math |
8 import re | 8 import re |
9 | 9 |
10 from infra.libs.infra_types import freeze | 10 from infra.libs.infra_types import freeze |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 like ia32. | 805 like ia32. |
806 suffix: Optional name suffix to differentiate multiple runs of the same | 806 suffix: Optional name suffix to differentiate multiple runs of the same |
807 step. | 807 step. |
808 upload: If true, uploads results to the performance dashboard. | 808 upload: If true, uploads results to the performance dashboard. |
809 extra_flags: List of flags to be passed to the test executable. | 809 extra_flags: List of flags to be passed to the test executable. |
810 Returns: A mapping of test config name->results map. Each results map has | 810 Returns: A mapping of test config name->results map. Each results map has |
811 an errors and a traces item. | 811 an errors and a traces item. |
812 """ | 812 """ |
813 | 813 |
814 results_mapping = collections.defaultdict(dict) | 814 results_mapping = collections.defaultdict(dict) |
815 def run_single_perf_test(test, name, json_file): | 815 def run_single_perf_test(test, name, json_file, download_test=None): |
816 """Call the v8 perf test runner. | 816 """Call the v8 perf test runner. |
817 | 817 |
818 Performance results are saved in the json test results file as a dict with | 818 Performance results are saved in the json test results file as a dict with |
819 'errors' for accumulated errors and 'traces' for the measurements. | 819 'errors' for accumulated errors and 'traces' for the measurements. |
820 """ | 820 """ |
821 full_args = [ | 821 full_args = [ |
822 '--arch', self.m.chromium.c.gyp_env.GYP_DEFINES['v8_target_arch'], | 822 '--arch', self.m.chromium.c.gyp_env.GYP_DEFINES['v8_target_arch'], |
823 '--buildbot', | 823 '--buildbot', |
824 '--json-test-results', self.m.json.output(add_json_log=False), | 824 '--json-test-results', self.m.json.output(add_json_log=False), |
825 json_file, | 825 json_file, |
826 ] | 826 ] |
827 | 827 |
828 if extra_flags: | 828 if extra_flags: |
829 full_args.append('--extra-flags="%s"' % ' '.join(extra_flags)) | 829 full_args.append('--extra-flags="%s"' % ' '.join(extra_flags)) |
830 | 830 |
831 step_test_data = lambda: self.test_api.perf_json( | 831 step_test_data = lambda: self.test_api.perf_json( |
832 self._test_data.get('perf_failures', False)) | 832 self._test_data.get('perf_failures', False)) |
833 | 833 |
834 try: | 834 try: |
| 835 if download_test is not None: |
| 836 self.m.python( |
| 837 '%s%s - download-data' % (name, suffix), |
| 838 self.m.path['checkout'].join('tools', 'run-test.py'), |
| 839 ['--download-data-only', download_test], |
| 840 cwd=self.m.path['checkout'], |
| 841 step_test_data=step_test_data, |
| 842 ) |
835 self.m.python( | 843 self.m.python( |
836 '%s%s' % (name, suffix), | 844 '%s%s' % (name, suffix), |
837 self.m.path['checkout'].join('tools', 'run_perf.py'), | 845 self.m.path['checkout'].join('tools', 'run_perf.py'), |
838 full_args, | 846 full_args, |
839 cwd=self.m.path['checkout'], | 847 cwd=self.m.path['checkout'], |
840 step_test_data=step_test_data, | 848 step_test_data=step_test_data, |
841 ) | 849 ) |
842 finally: | 850 finally: |
843 step_result = self.m.step.active_result | 851 step_result = self.m.step.active_result |
844 results_mapping[test] = step_result.json.output | 852 results_mapping[test] = step_result.json.output |
(...skipping 10 matching lines...) Expand all Loading... |
855 self.revision_number, | 863 self.revision_number, |
856 bot=category) | 864 bot=category) |
857 | 865 |
858 failed = False | 866 failed = False |
859 for t in tests: | 867 for t in tests: |
860 assert perf_configs[t] | 868 assert perf_configs[t] |
861 assert perf_configs[t]['name'] | 869 assert perf_configs[t]['name'] |
862 assert perf_configs[t]['json'] | 870 assert perf_configs[t]['json'] |
863 try: | 871 try: |
864 run_single_perf_test( | 872 run_single_perf_test( |
865 t, perf_configs[t]['name'], perf_configs[t]['json']) | 873 t, perf_configs[t]['name'], perf_configs[t]['json'], |
| 874 download_test=perf_configs[t].get('download_test')) |
866 except self.m.step.StepFailure: | 875 except self.m.step.StepFailure: |
867 failed = True | 876 failed = True |
868 | 877 |
869 # Collect all perf data of the previous steps. | 878 # Collect all perf data of the previous steps. |
870 if upload: | 879 if upload: |
871 self.perf_upload( | 880 self.perf_upload( |
872 [results_mapping[k] for k in sorted(results_mapping.keys())], | 881 [results_mapping[k] for k in sorted(results_mapping.keys())], |
873 category) | 882 category) |
874 | 883 |
875 if failed: | 884 if failed: |
(...skipping 19 matching lines...) Expand all Loading... |
895 properties = { | 904 properties = { |
896 'revision': self.revision, | 905 'revision': self.revision, |
897 'parent_got_revision': self.revision, | 906 'parent_got_revision': self.revision, |
898 'parent_got_revision_cp': self.revision_cp, | 907 'parent_got_revision_cp': self.revision_cp, |
899 } | 908 } |
900 properties.update(**additional_properties) | 909 properties.update(**additional_properties) |
901 self.m.trigger(*[{ | 910 self.m.trigger(*[{ |
902 'builder_name': builder_name, | 911 'builder_name': builder_name, |
903 'properties': properties, | 912 'properties': properties, |
904 } for builder_name in triggers]) | 913 } for builder_name in triggers]) |
OLD | NEW |