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

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 _start_engine_forwarder(self, output_linux_dir, **kwargs):
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 def _stop_engine_forwarder(self, output_linux_dir, **kwargs):
27 args = [
28 '-l', output_linux_dir,
29 'stop',
30 ]
31 self.m.python('[Blimp] Killing engine and forwarder',
32 self.c.client_engine_integration_script,
33 args,
34 **kwargs)
35
36
37 def load_client(self, output_linux_dir, apk_path, **kwargs):
38 """Installs apk in client and runs blimp."""
39 args = [
40 '-l', output_linux_dir,
41 'load',
42 '--apk-path', apk_path,
43 ]
44 self.m.python('[Blimp] Installing apk and running blimp',
45 self.c.client_engine_integration_script,
46 args,
47 **kwargs)
48
49 @contextlib.contextmanager
50 def engine_forwarder(self, output_linux_dir, **kwargs):
51 try:
52 self._start_engine_forwarder(output_linux_dir, **kwargs)
53 yield
54 finally:
55 self._stop_engine_forwarder(output_linux_dir)
56
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/blimp/__init__.py ('k') | scripts/slave/recipe_modules/blimp/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698