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

Unified Diff: scripts/slave/recipe_modules/chromium/steps.py

Issue 1104533002: Add recipe for split AMP/local CQ. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 8 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
Index: scripts/slave/recipe_modules/chromium/steps.py
diff --git a/scripts/slave/recipe_modules/chromium/steps.py b/scripts/slave/recipe_modules/chromium/steps.py
index 27af1864ef003a82f533780e6a800ebf042c08bb..56635af466aa83db144e5c280f73e31dc32c3008 100644
--- a/scripts/slave/recipe_modules/chromium/steps.py
+++ b/scripts/slave/recipe_modules/chromium/steps.py
@@ -604,6 +604,78 @@ class SwarmingGTestTest(SwarmingTest):
return True, gtest_results.failures
+class AMPGTestTest(Test):
+ def __init__(self, name, args=None, target_name=None, **runtest_kwargs):
+ super(AMPGTestTest, self).__init__()
+ self._name = name
+ self._args = args
+ self._target_name = target_name
+ self._local_test = LocalGTestTest(name, args, target_name, **runtest_kwargs)
+
+ @property
+ def name(self):
+ return self._name
+
+ @property
+ def target_name(self):
+ return self._target_name or self._name
+
+ @property
+ def isolate_target(self):
+ return self.target_name # pragma: no cover
+
+ def compile_targets(self, api):
+ return self._local_test.compile_targets(api)
+
+ def trigger(self, api, suffix):
+ isolate_file_path = (
+ api.path['checkout'].join(*isolate_file) if isolate_file else None)
+ deferred_trigger_result = api.amp.trigger_test_suite(
+ self._name, 'gtest',
+ api.amp.gtest_arguments(self._name,
+ isolate_file_path=isolate_file_path),
+ api.amp.amp_arguments(
+ api_address=AMP_INSTANCE_ADDRESS,
+ api_port=AMP_INSTANCE_PORT,
+ api_protocol=AMP_INSTANCE_PROTOCOL,
+ device_minimum_os=builder.get('device_minimum_os'),
+ device_name=builder.get('device_name'),
+ device_os=builder.get('device_os'),
+ device_timeout=builder.get('device_timeout')))
+ self._trigger_successful = deferred_trigger_result.is_ok
+
+ def collect(self, api, suffix):
+ # If the AMP test was not successfully triggered, run locally.
+ if not self._trigger_successful:
+ return self._local_test.run(api, suffix)
+ else:
+ deffered_step_result = api.amp.collect_test_suite(
jbudorick 2015/04/22 16:35:40 deferred_step_result I'm somewhat surprised that
navabi 2015/05/07 19:21:59 Done.
+ suite, 'gtest',
+ api.amp.gtest_arguments(suite),
+ api.amp.amp_arguments(
+ api_address=AMP_INSTANCE_ADDRESS,
+ api_port=AMP_INSTANCE_PORT,
+ api_protocol=AMP_INSTANCE_PROTOCOL,
+ device_minimum_os=builder.get('device_minimum_os'),
+ device_name=builder.get('device_name'),
+ device_os=builder.get('device_os'),
+ device_timeout=builder.get('device_timeout')))
+ self._collect_successful = deferred_step_result.is_ok
+ # Need to return step_result here
navabi 2015/04/22 16:16:48 need to figure out how to return the step result h
+
+ def run(self, api, suffix):
+ self._trigger(api, suffix)
navabi 2015/04/22 16:16:48 I will change this to return self._local_tests.run
Paweł Hajdan Jr. 2015/04/22 16:25:09 Please take a look at how swarming tests run. Ther
navabi 2015/05/07 19:21:59 Done.
+ result = self._collect(api, suffix)
+ return result
+
+ def has_valid_results(self, api, suffix):
+ # TODO(navabi): implement this.
+ return True
+
+ def failures(self, api, suffix):
+ # TODO(navabi): implement this.
+ return []
+
class GTestTest(Test):
def __init__(self, name, args=None, target_name=None, enable_swarming=False,

Powered by Google App Engine
This is Rietveld 408576698