| 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 from recipe_engine.types import freeze | 5 from recipe_engine.types import freeze |
| 6 from recipe_engine import recipe_api | 6 from recipe_engine import recipe_api |
| 7 from . import builders | 7 from . import builders |
| 8 from . import steps | 8 from . import steps |
| 9 | 9 |
| 10 | 10 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if self.m.chromium.c.TARGET_PLATFORM == 'android': | 172 if self.m.chromium.c.TARGET_PLATFORM == 'android': |
| 173 self.m.chromium_android.common_tests_final_steps() | 173 self.m.chromium_android.common_tests_final_steps() |
| 174 | 174 |
| 175 with self.m.step.defer_results(): | 175 with self.m.step.defer_results(): |
| 176 for test in tests: | 176 for test in tests: |
| 177 if test.enable_swarming: | 177 if test.enable_swarming: |
| 178 self.m.swarming.collect_task(test.swarming_task) | 178 self.m.swarming.collect_task(test.swarming_task) |
| 179 | 179 |
| 180 | 180 |
| 181 def add_test(self, test, name=None, args=None, revision=None, env=None, | 181 def add_test(self, test, name=None, args=None, revision=None, env=None, |
| 182 perf_test=False, perf_dashboard_id=None, parallel=True): | 182 python_mode=False, perf_test=False, perf_dashboard_id=None, |
| 183 parallel=True): |
| 183 """Helper function to invoke chromium.runtest(). | 184 """Helper function to invoke chromium.runtest(). |
| 184 | 185 |
| 185 Notice that the name parameter should be the same as the test executable in | 186 Notice that the name parameter should be the same as the test executable in |
| 186 order to get the stdio links in the perf dashboard to become correct. | 187 order to get the stdio links in the perf dashboard to become correct. |
| 187 """ | 188 """ |
| 188 name = name or test | 189 name = name or test |
| 189 args = args or [] | 190 args = args or [] |
| 190 env = env or {} | 191 env = env or {} |
| 191 if perf_test and self.c.PERF_ID: | 192 if perf_test and self.c.PERF_ID: |
| 192 perf_dashboard_id = perf_dashboard_id or test | 193 perf_dashboard_id = perf_dashboard_id or test |
| 193 assert self.revision_number, ( | 194 assert self.revision_number, ( |
| 194 'A revision number must be specified for perf tests as they upload ' | 195 'A revision number must be specified for perf tests as they upload ' |
| 195 'data to the perf dashboard.') | 196 'data to the perf dashboard.') |
| 196 self.m.chromium.runtest( | 197 self.m.chromium.runtest( |
| 197 test=test, args=args, name=name, | 198 test=test, args=args, name=name, |
| 198 results_url=self.DASHBOARD_UPLOAD_URL, annotate='graphing', | 199 results_url=self.DASHBOARD_UPLOAD_URL, annotate='graphing', |
| 199 xvfb=True, perf_dashboard_id=perf_dashboard_id, | 200 xvfb=True, perf_dashboard_id=perf_dashboard_id, |
| 200 test_type=perf_dashboard_id, env=env, revision=self.revision_number, | 201 test_type=perf_dashboard_id, env=env, python_mode=python_mode, |
| 201 perf_id=self.c.PERF_ID, perf_config=self.c.PERF_CONFIG) | 202 revision=self.revision_number, perf_id=self.c.PERF_ID, |
| 203 perf_config=self.c.PERF_CONFIG) |
| 202 else: | 204 else: |
| 203 annotate = 'gtest' | 205 annotate = 'gtest' |
| 204 python_mode = False | |
| 205 test_type = test | 206 test_type = test |
| 206 flakiness_dash = (not self.m.tryserver.is_tryserver and | 207 flakiness_dash = (not self.m.tryserver.is_tryserver and |
| 207 not self.m.chromium.c.runtests.memory_tool) | 208 not self.m.chromium.c.runtests.memory_tool) |
| 208 | 209 |
| 209 # Dr Memory and Memcheck memory tools uses special scripts that doesn't | 210 # Dr Memory and Memcheck memory tools uses special scripts that doesn't |
| 210 # play well with the gtest-parallel script. | 211 # play well with the gtest-parallel script. |
| 211 if parallel and not self.m.chromium.c.runtests.memory_tool: | 212 if parallel and not self.m.chromium.c.runtests.memory_tool: |
| 212 test_executable = self.m.chromium.c.build_dir.join( | 213 test_executable = self.m.chromium.c.build_dir.join( |
| 213 self.m.chromium.c.build_config_fs, test) | 214 self.m.chromium.c.build_config_fs, test) |
| 214 args = [test_executable, '--'] + args | 215 args = [test_executable, '--'] + args |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 def clean_test_output(self): | 280 def clean_test_output(self): |
| 280 """Remove all test output in out/, since we have tests leaking files.""" | 281 """Remove all test output in out/, since we have tests leaking files.""" |
| 281 out_dir = self.m.path['checkout'].join('out') | 282 out_dir = self.m.path['checkout'].join('out') |
| 282 self.m.python('clean test output files', | 283 self.m.python('clean test output files', |
| 283 script=self.resource('cleanup_files.py'), | 284 script=self.resource('cleanup_files.py'), |
| 284 args=[out_dir], | 285 args=[out_dir], |
| 285 infra_step=True) | 286 infra_step=True) |
| 286 | 287 |
| 287 def virtual_webcam_check(self): | 288 def virtual_webcam_check(self): |
| 288 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) | 289 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) |
| OLD | NEW |