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

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

Issue 1104533002: Add recipe for split AMP/local CQ. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Address phajdan.jr comments. Created 5 years, 6 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/chromium_tests/chromium_fyi.py ('k') | scripts/slave/recipes/chromium.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/chromium_tests/steps.py
diff --git a/scripts/slave/recipe_modules/chromium_tests/steps.py b/scripts/slave/recipe_modules/chromium_tests/steps.py
index 69ad60239a02000ca71e64b80b98291e69877816..0b397c4ad09291751f11d19d25c9cce9b41c2f47 100644
--- a/scripts/slave/recipe_modules/chromium_tests/steps.py
+++ b/scripts/slave/recipe_modules/chromium_tests/steps.py
@@ -618,6 +618,70 @@ class SwarmingGTestTest(SwarmingTest):
return True, gtest_results.failures
+class AMPGTestTest(Test):
+ AMP_INSTANCE_ADDRESS = '172.22.21.180'
+ AMP_INSTANCE_PORT = '80'
+ AMP_INSTANCE_PROTOCOL = 'http'
+ AMP_RESULTS_BUCKET = 'chrome-amp-results'
+ def __init__(self, name, args=None, target_name=None, device_name=['Nexus 5'],
+ device_os=['4.4.2'], android_isolate_path=None,
+ **runtest_kwargs):
+ self._name = name
+ self._args = args
+ self._target_name = target_name
+ self._android_isolate_path = android_isolate_path
+ # LocalGTestTest is used when AMP tests are not triggered successfully.
+ self._local_test = LocalGTestTest(name, args, target_name, **runtest_kwargs)
+ self._device_name = device_name
+ self._device_os = device_os
+ self._trigger_successful = None
+
+ @property
+ def name(self):
+ return self._name
+
+ def run(self, api, suffix): # pylint: disable=R0201
+ """Not used. All logic in pre_run, post_run."""
+ return []
+
+ def pre_run(self, api, suffix):
+ """Triggers an AMP test."""
+ amp_arguments = api.amp.amp_arguments(
+ api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
+ api_port=AMPGTestTest.AMP_INSTANCE_PORT,
+ api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
+ device_name=self._device_name,
+ device_os=self._device_os)
+
+ isolate_file_path = (api.path['checkout'].join(self._android_isolate_path)
+ if self._android_isolate_path else None)
+ try:
+ api.amp.trigger_test_suite(
+ self._name, 'gtest',
+ api.amp.gtest_arguments(self._name,
+ isolate_file_path=isolate_file_path),
+ amp_arguments)
+ self._trigger_successful = True
+ except api.step.StepFailure:
Paweł Hajdan Jr. 2015/06/19 10:46:09 Did you intend not to re-raise the failure? If it'
navabi 2015/06/19 19:49:28 No, I did not mean to. I have comments for it on l
+ self._trigger_successful = False
+
+ def post_run(self, api, suffix):
+ # If we were unable to successfully trigger the AMP job, run locally.
+ if not self._trigger_successful:
+ return self._local_test.run(api, suffix)
+ else:
Paweł Hajdan Jr. 2015/06/19 10:46:09 nit: No need for an "else" after early return.
navabi 2015/06/23 07:44:10 Done.
+ amp_arguments = api.amp.amp_arguments(
+ api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
+ api_port=AMPGTestTest.AMP_INSTANCE_PORT,
+ api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
+ device_name=self._device_name,
+ device_os=self._device_os)
+
+ api.amp.collect_test_suite(
+ self._name, 'gtest', api.amp.gtest_arguments(self._name),
+ amp_arguments)
+
+
class GTestTest(Test):
def __init__(self, name, args=None, target_name=None, enable_swarming=False,
swarming_shards=1, swarming_dimensions=None, swarming_tags=None,
« no previous file with comments | « scripts/slave/recipe_modules/chromium_tests/chromium_fyi.py ('k') | scripts/slave/recipes/chromium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698