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 slave import recipe_api | 5 from slave import recipe_api |
6 | 6 |
7 class ChromiumApi(recipe_api.RecipeApi): | 7 class ChromiumApi(recipe_api.RecipeApi): |
8 def get_config_defaults(self): | 8 def get_config_defaults(self): |
9 return { | 9 return { |
10 'HOST_PLATFORM': self.m.platform.name, | 10 'HOST_PLATFORM': self.m.platform.name, |
(...skipping 29 matching lines...) Expand all Loading... |
40 args.append('--') | 40 args.append('--') |
41 args.extend(targets) | 41 args.extend(targets) |
42 return self.m.python(name or 'compile', | 42 return self.m.python(name or 'compile', |
43 self.m.path.build('scripts', 'slave', 'compile.py'), | 43 self.m.path.build('scripts', 'slave', 'compile.py'), |
44 args, abort_on_failure=True, **kwargs) | 44 args, abort_on_failure=True, **kwargs) |
45 | 45 |
46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None, | 46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None, |
47 results_url=None, perf_dashboard_id=None, test_type=None, | 47 results_url=None, perf_dashboard_id=None, test_type=None, |
48 generate_json_file=False, results_directory=None, | 48 generate_json_file=False, results_directory=None, |
49 build_number=None, builder_name=None, python_mode=False, | 49 build_number=None, builder_name=None, python_mode=False, |
50 **kwargs): | 50 spawn_dbus=False, **kwargs): |
51 """Return a runtest.py invocation.""" | 51 """Return a runtest.py invocation.""" |
52 args = args or [] | 52 args = args or [] |
53 assert isinstance(args, list) | 53 assert isinstance(args, list) |
54 | 54 |
55 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) | 55 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) |
56 if not python_mode and self.m.platform.is_win and ext == '': | 56 if not python_mode and self.m.platform.is_win and ext == '': |
57 test += '.exe' | 57 test += '.exe' |
58 | 58 |
59 full_args = [ | 59 full_args = [ |
60 '--target', self.c.build_config_fs, | 60 '--target', self.c.build_config_fs, |
(...skipping 15 matching lines...) Expand all Loading... |
76 if generate_json_file: | 76 if generate_json_file: |
77 full_args.append('--generate-json-file') | 77 full_args.append('--generate-json-file') |
78 if results_directory: | 78 if results_directory: |
79 full_args.append('--results-directory=%s' % results_directory) | 79 full_args.append('--results-directory=%s' % results_directory) |
80 if build_number: | 80 if build_number: |
81 full_args.append('--build-number=%s' % build_number) | 81 full_args.append('--build-number=%s' % build_number) |
82 if builder_name: | 82 if builder_name: |
83 full_args.append('--builder-name=%s' % builder_name) | 83 full_args.append('--builder-name=%s' % builder_name) |
84 if ext == '.py' or python_mode: | 84 if ext == '.py' or python_mode: |
85 full_args.append('--run-python-script') | 85 full_args.append('--run-python-script') |
| 86 if spawn_dbus: |
| 87 full_args.append('--spawn-dbus') |
86 full_args.append(test) | 88 full_args.append(test) |
87 full_args.extend(args) | 89 full_args.extend(args) |
88 | 90 |
89 # By default, always run the tests. | 91 # By default, always run the tests. |
90 kwargs.setdefault('always_run', True) | 92 kwargs.setdefault('always_run', True) |
91 | 93 |
92 return self.m.python( | 94 return self.m.python( |
93 name or t_name, | 95 name or t_name, |
94 self.m.path.build('scripts', 'slave', 'runtest.py'), | 96 self.m.path.build('scripts', 'slave', 'runtest.py'), |
95 full_args, | 97 full_args, |
96 **kwargs | 98 **kwargs |
97 ) | 99 ) |
98 | 100 |
99 def run_telemetry_test(self, runner, test, name='', args=None, | 101 def run_telemetry_test(self, runner, test, name='', args=None, |
100 results_directory=''): | 102 results_directory='', spawn_dbus=False): |
101 # Choose a reasonable default for the location of the sandbox binary | 103 # Choose a reasonable default for the location of the sandbox binary |
102 # on the bots. | 104 # on the bots. |
103 env = {} | 105 env = {} |
104 if self.m.platform.is_linux: | 106 if self.m.platform.is_linux: |
105 env['CHROME_DEVEL_SANDBOX'] = self.m.path.join( | 107 env['CHROME_DEVEL_SANDBOX'] = self.m.path.join( |
106 '/opt', 'chromium', 'chrome_sandbox') | 108 '/opt', 'chromium', 'chrome_sandbox') |
107 | 109 |
108 if not name: | 110 if not name: |
109 name = test | 111 name = test |
110 | 112 |
(...skipping 17 matching lines...) Expand all Loading... |
128 runner, | 130 runner, |
129 test_args, | 131 test_args, |
130 annotate='gtest', | 132 annotate='gtest', |
131 name=name, | 133 name=name, |
132 test_type=name, | 134 test_type=name, |
133 generate_json_file=True, | 135 generate_json_file=True, |
134 results_directory=results_directory, | 136 results_directory=results_directory, |
135 build_number=self.m.properties['buildnumber'], | 137 build_number=self.m.properties['buildnumber'], |
136 builder_name=self.m.properties['buildername'], | 138 builder_name=self.m.properties['buildername'], |
137 python_mode=True, | 139 python_mode=True, |
| 140 spawn_dbus=spawn_dbus, |
138 env=env) | 141 env=env) |
139 | 142 |
140 def runhooks(self, **kwargs): | 143 def runhooks(self, **kwargs): |
141 """Run the build-configuration hooks for chromium.""" | 144 """Run the build-configuration hooks for chromium.""" |
142 env = kwargs.get('env', {}) | 145 env = kwargs.get('env', {}) |
143 env.update(self.c.gyp_env.as_jsonish()) | 146 env.update(self.c.gyp_env.as_jsonish()) |
144 kwargs['env'] = env | 147 kwargs['env'] = env |
145 return self.m.gclient.runhooks(**kwargs) | 148 return self.m.gclient.runhooks(**kwargs) |
146 | 149 |
OLD | NEW |