OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 logging | 5 import logging |
6 import os | 6 import os |
7 import posixpath | 7 import posixpath |
8 import re | 8 import re |
9 import sys | |
10 import tempfile | 9 import tempfile |
11 import time | 10 import time |
12 | 11 |
13 from devil.android import device_errors | 12 from devil.android import device_errors |
14 from devil.android import device_temp_file | 13 from devil.android import device_temp_file |
15 from devil.android import flag_changer | 14 from devil.android import flag_changer |
16 from devil.android.sdk import shared_prefs | 15 from devil.android.sdk import shared_prefs |
17 from devil.utils import reraiser_thread | 16 from devil.utils import reraiser_thread |
18 from pylib import valgrind_tools | 17 from pylib import valgrind_tools |
19 from pylib.android import logdog_logcat_monitor | 18 from pylib.android import logdog_logcat_monitor |
20 from pylib.base import base_test_result | 19 from pylib.base import base_test_result |
21 from pylib.constants import host_paths | 20 from pylib.constants import host_paths |
22 from pylib.instrumentation import instrumentation_test_instance | 21 from pylib.instrumentation import instrumentation_test_instance |
23 from pylib.local.device import local_device_environment | 22 from pylib.local.device import local_device_environment |
24 from pylib.local.device import local_device_test_run | 23 from pylib.local.device import local_device_test_run |
25 from pylib.utils import google_storage_helper | 24 from pylib.utils import google_storage_helper |
26 from pylib.utils import logdog_helper | 25 from pylib.utils import logdog_helper |
27 from py_trace_event import trace_event | 26 from py_trace_event import trace_event |
28 from py_utils import contextlib_ext | 27 from py_utils import contextlib_ext |
29 from py_utils import tempfile_ext | 28 from py_utils import tempfile_ext |
30 import tombstones | 29 import tombstones |
31 | 30 |
32 sys.path.append(os.path.join(host_paths.DIR_SOURCE_ROOT, 'third_party')) | 31 with host_paths.SysPath( |
33 import jinja2 # pylint: disable=import-error | 32 os.path.join(host_paths.DIR_SOURCE_ROOT, 'third_party'), 0): |
34 import markupsafe # pylint: disable=import-error,unused-import | 33 import jinja2 # pylint: disable=import-error |
| 34 import markupsafe # pylint: disable=import-error,unused-import |
35 | 35 |
36 | 36 |
37 _JINJA_TEMPLATE_DIR = os.path.join( | 37 _JINJA_TEMPLATE_DIR = os.path.join( |
38 host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'instrumentation') | 38 host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'instrumentation') |
39 _JINJA_TEMPLATE_FILENAME = 'render_test.html.jinja' | 39 _JINJA_TEMPLATE_FILENAME = 'render_test.html.jinja' |
40 | 40 |
41 _TAG = 'test_runner_py' | 41 _TAG = 'test_runner_py' |
42 | 42 |
43 TIMEOUT_ANNOTATIONS = [ | 43 TIMEOUT_ANNOTATIONS = [ |
44 ('Manual', 10 * 60 * 60), | 44 ('Manual', 10 * 60 * 60), |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) | 646 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) |
647 | 647 |
648 return timeout | 648 return timeout |
649 | 649 |
650 def _IsRenderTest(test): | 650 def _IsRenderTest(test): |
651 """Determines if a test or list of tests has a RenderTest amongst them.""" | 651 """Determines if a test or list of tests has a RenderTest amongst them.""" |
652 if not isinstance(test, list): | 652 if not isinstance(test, list): |
653 test = [test] | 653 test = [test] |
654 return any([RENDER_TEST_FEATURE_ANNOTATION in t['annotations'].get( | 654 return any([RENDER_TEST_FEATURE_ANNOTATION in t['annotations'].get( |
655 FEATURE_ANNOTATION, {}).get('value', ()) for t in test]) | 655 FEATURE_ANNOTATION, {}).get('value', ()) for t in test]) |
OLD | NEW |