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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/blimp/api.py
diff --git a/scripts/slave/recipe_modules/blimp/api.py b/scripts/slave/recipe_modules/blimp/api.py
new file mode 100644
index 0000000000000000000000000000000000000000..57443a6785fdb62b274cd253e72bef988af3ca28
--- /dev/null
+++ b/scripts/slave/recipe_modules/blimp/api.py
@@ -0,0 +1,56 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import contextlib
+
+from recipe_engine import recipe_api
+from recipe_engine.config_types import Path
+
+class BlimpApi(recipe_api.RecipeApi):
+ def get_config_defaults(self):
+ return {
+ 'CHECKOUT_PATH': self.m.path['checkout'],
+ }
+
+ def _start_engine_forwarder(self, output_linux_dir, **kwargs):
+ args = [
+ '-l', output_linux_dir,
+ 'run',
+ ]
+ self.m.python('[Blimp] Starting engine and forwarder',
+ self.c.client_engine_integration_script,
+ args,
+ **kwargs)
+
+ def _stop_engine_forwarder(self, output_linux_dir, **kwargs):
+ args = [
+ '-l', output_linux_dir,
+ 'stop',
+ ]
+ self.m.python('[Blimp] Killing engine and forwarder',
+ self.c.client_engine_integration_script,
+ args,
+ **kwargs)
+
+
+ def load_client(self, output_linux_dir, apk_path, **kwargs):
+ """Installs apk in client and runs blimp."""
+ args = [
+ '-l', output_linux_dir,
+ 'load',
+ '--apk-path', apk_path,
+ ]
+ self.m.python('[Blimp] Installing apk and running blimp',
+ self.c.client_engine_integration_script,
+ args,
+ **kwargs)
+
+ @contextlib.contextmanager
+ def engine_forwarder(self, output_linux_dir, **kwargs):
+ try:
+ self._start_engine_forwarder(output_linux_dir, **kwargs)
+ yield
+ finally:
+ self._stop_engine_forwarder(output_linux_dir)
+
« 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