Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: scripts/slave/recipe_modules/blimp/api.py

Issue 2416253003: Add the recipe_modules/blimp for integration bot (Closed)
Patch Set: Case comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import contextlib
6
7 from recipe_engine import recipe_api
8 from recipe_engine.config_types import Path
9
10 class BlimpApi(recipe_api.RecipeApi):
11 def get_config_defaults(self):
12 return {
13 'CHECKOUT_PATH': self.m.path['checkout'],
14 }
15
16 def _run_engine_forwarder(self, output_linux_dir, **kwargs):
mikecase (-- gone --) 2016/10/17 23:38:35 suuuper nit: I would personally name this just _st
shenghuazhang 2016/10/18 20:39:07 Done.
17 args = [
18 '-l', output_linux_dir,
19 'run',
20 ]
21 self.m.python('[Blimp] Starting engine and forwarder',
22 self.c.client_engine_integration_script,
23 args,
24 **kwargs)
25
26 # Installs apk in client and runs blimp.
mikecase (-- gone --) 2016/10/17 23:38:35 nit: Change this comment to a proper docstring lik
shenghuazhang 2016/10/18 20:39:07 Done.
27 def load_client(self, output_linux_dir, apk_path, **kwargs):
28 args = [
29 '-l', output_linux_dir,
30 'load',
31 '--apk-path', apk_path,
32 ]
33 self.m.python('[Blimp] Installing apk and running blimp',
34 self.c.client_engine_integration_script,
35 args,
36 **kwargs)
37
38 def _stop_engine_forwarder(self, output_linux_dir, **kwargs):
mikecase (-- gone --) 2016/10/17 23:38:35 Nit: Move this function next to _run_engine_forwar
shenghuazhang 2016/10/18 20:39:07 Done.
39 args = [
40 '-l', output_linux_dir,
41 'stop',
42 ]
43 self.m.python('[Blimp] Killing engine and forwarder',
44 self.c.client_engine_integration_script,
45 args,
46 **kwargs)
47
48 @contextlib.contextmanager
49 def engine_forwarder_process(self, output_linux_dir, **kwargs):
mikecase (-- gone --) 2016/10/17 23:38:35 suuuper nit: I would personally name this just eng
shenghuazhang 2016/10/18 20:39:08 Done.
50 self._run_engine_forwarder(output_linux_dir, **kwargs)
mikecase (-- gone --) 2016/10/17 23:38:35 Not 100% sure, but Im guessing you want to put thi
shenghuazhang 2016/10/18 20:39:08 Done.
51
52 try:
53 yield
54 finally:
55 self._stop_engine_forwarder(output_linux_dir)
56
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698