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

Side by Side 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: Make AMPGTestTest more like swarming tests. Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « scripts/slave/recipe_modules/chromium/chromium_fyi.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 import string 6 import string
7 7
8 8
9 class Test(object): 9 class Test(object):
10 """ 10 """
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 kwargs['flakiness_dashboard'] = 'http://test-results.appspot.com' 277 kwargs['flakiness_dashboard'] = 'http://test-results.appspot.com'
278 else: 278 else:
279 kwargs['xvfb'] = True 279 kwargs['xvfb'] = True
280 kwargs['test_type'] = self.name 280 kwargs['test_type'] = self.name
281 kwargs['annotate'] = 'gtest' 281 kwargs['annotate'] = 'gtest'
282 kwargs['test_launcher_summary_output'] = gtest_results_file 282 kwargs['test_launcher_summary_output'] = gtest_results_file
283 kwargs.update(self._runtest_kwargs) 283 kwargs.update(self._runtest_kwargs)
284 284
285 try: 285 try:
286 if is_android: 286 if is_android:
287 api.chromium_android.run_test_suite(self.target_name, **kwargs) 287 api.chromium_android.run_test_suite(self.target_name, **kwargs)
jbudorick 2015/05/07 20:31:46 chromium.steps already uses chromium_android, whic
navabi 2015/05/18 15:51:48 Thanks. I'll take a look and see if I can figure i
288 elif self._use_isolate: 288 elif self._use_isolate:
289 api.isolate.runtest(self.target_name, self._revision, 289 api.isolate.runtest(self.target_name, self._revision,
290 self._webkit_revision, **kwargs) 290 self._webkit_revision, **kwargs)
291 else: 291 else:
292 api.chromium.runtest(self.target_name, revision=self._revision, 292 api.chromium.runtest(self.target_name, revision=self._revision,
293 webkit_revision=self._webkit_revision, **kwargs) 293 webkit_revision=self._webkit_revision, **kwargs)
294 finally: 294 finally:
295 step_result = api.step.active_result 295 step_result = api.step.active_result
296 self._test_runs[suffix] = step_result 296 self._test_runs[suffix] = step_result
297 297
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 if not gtest_results: 611 if not gtest_results:
612 return False, None # pragma: no cover 612 return False, None # pragma: no cover
613 613
614 global_tags = gtest_results.raw.get('global_tags', []) 614 global_tags = gtest_results.raw.get('global_tags', [])
615 if 'UNRELIABLE_RESULTS' in global_tags: 615 if 'UNRELIABLE_RESULTS' in global_tags:
616 return False, None # pragma: no cover 616 return False, None # pragma: no cover
617 617
618 return True, gtest_results.failures 618 return True, gtest_results.failures
619 619
620 620
621 class AMPGTestTest(Test):
622 AMP_INSTANCE_ADDRESS = '172.22.21.180'
623 AMP_INSTANCE_PORT = '80'
624 AMP_INSTANCE_PROTOCOL = 'http'
625 AMP_RESULTS_BUCKET = 'chrome-amp-results'
626 def __init__(self, name, args=None, target_name=None,
627 android_isolate_path=None, **runtest_kwargs):
628 self._name = name
629 self._args = args
630 self._target_name = target_name
631 self._android_isolate_path = android_isolate_path
632 # LocalGTestTest is used when AMP tests are not triggered successfully.
633 self._local_test = LocalGTestTest(name, args, target_name, **runtest_kwargs)
634
635 @property
636 def name(self):
637 return self._name
638
639 @property
640 def target_name(self):
641 return self._local_test.target_name
642
643 @property
644 def isolate_target(self):
645 return self._local_test.isolate_target
646
647 def compile_targets(self, api):
648 return self._local_test.compile_targets(api)
649
650 def run(self, api, suffix): # pylint: disable=R0201
651 """Not used. All logic in pre_run, post_run."""
652 return []
653
654 def pre_run(self, api, suffix):
655 """Triggers an AMP test."""
656 amp_arguments = api.amp.amp_arguments(
navabi 2015/05/07 20:16:49 this is one reason i need the amp module here.
657 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
658 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
659 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
660 device_minimum_os=builder.get('device_minimum_os'),
661 device_name=builder.get('device_name'),
662 device_os=builder.get('device_os'),
663 device_timeout=builder.get('device_timeout'))
664
665 isolate_file_path = (api.path['checkout'].join(self._android_isolate_path)
666 if self._android_isolate_path else None)
667 deferred_trigger_result = api.amp.trigger_test_suite(
668 self._name, 'gtest',
669 api.amp.gtest_arguments(self._name,
670 isolate_file_path=isolate_file_path),
671 amp_arguments)
672 self._trigger_successful = deferred_trigger_result.is_ok
673
674 def post_run(self, api, suffix):
675 # If we were unable to successfully trigger the AMP job, run locally.
Paweł Hajdan Jr. 2015/05/08 08:55:11 Why do we need this fallback logic? We don't do th
navabi 2015/05/18 15:51:49 It is needed. We need this fallback logic because
Paweł Hajdan Jr. 2015/06/08 09:33:21 I think it'd be helpful to include what you said a
navabi 2015/06/18 19:47:48 Done and done.
navabi 2015/06/18 21:20:58 Actually done and undone. We can't have the call t
Paweł Hajdan Jr. 2015/06/19 10:46:09 That's correct, the order of calls is like you sai
676 if not self._trigger_successful:
677 return self._local_test.run(api, suffix)
678 else:
679 amp_arguments = api.amp.amp_arguments(
680 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
681 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
682 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
683 device_minimum_os=builder.get('device_minimum_os'),
684 device_name=builder.get('device_name'),
685 device_os=builder.get('device_os'),
686 device_timeout=builder.get('device_timeout'))
687
688 deferred_step_result = api.amp.collect_test_suite(
689 self._name, 'gtest', api.amp.gtest_arguments(self._name),
690 amp_arguments)
691 self._test_runs[suffix] = deferred_step_result
692 return deferred_step_result
693
694 def has_valid_results(self, api, suffix):
695 return self._local_test.has_valid_results(api, suffix)
696
697 def failures(self, api, suffix):
698 return self._local_test.failures(api, suffix)
699
700
621 class GTestTest(Test): 701 class GTestTest(Test):
622 def __init__(self, name, args=None, target_name=None, enable_swarming=False, 702 def __init__(self, name, args=None, target_name=None, enable_swarming=False,
623 swarming_shards=1, swarming_dimensions=None, swarming_tags=None, 703 swarming_shards=1, swarming_dimensions=None, swarming_tags=None,
624 swarming_extra_suffix=None, **runtest_kwargs): 704 swarming_extra_suffix=None, amp_test=False, **runtest_kwargs):
625 super(GTestTest, self).__init__() 705 super(GTestTest, self).__init__()
626 if enable_swarming: 706 if enable_swarming:
627 self._test = SwarmingGTestTest( 707 self._test = SwarmingGTestTest(
628 name, args, target_name, swarming_shards, swarming_dimensions, 708 name, args, target_name, swarming_shards, swarming_dimensions,
629 swarming_tags, swarming_extra_suffix) 709 swarming_tags, swarming_extra_suffix)
710 elif amp_test:
Paweł Hajdan Jr. 2015/05/08 08:55:11 Do we need to modify GTestTest? Why wouldn't calle
navabi 2015/05/18 15:51:49 This was to make it like SwarmingGTestTest. Notice
navabi 2015/06/18 19:47:48 Done. Now the callers use AMPGTestTest directly.
711 self._test = AMPGTestTest(name, args, target_name, **runtest_kwargs)
630 else: 712 else:
631 self._test = LocalGTestTest(name, args, target_name, **runtest_kwargs) 713 self._test = LocalGTestTest(name, args, target_name, **runtest_kwargs)
632 714
633 @property 715 @property
634 def name(self): 716 def name(self):
635 return self._test.name 717 return self._test.name
636 718
637 @property 719 @property
638 def isolate_target(self): 720 def isolate_target(self):
639 return self._test.isolate_target 721 return self._test.isolate_target
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 GTestTest('ui_base_unittests'), 1330 GTestTest('ui_base_unittests'),
1249 GTestTest('ui_ios_unittests'), 1331 GTestTest('ui_ios_unittests'),
1250 GTestTest('sync_unit_tests'), 1332 GTestTest('sync_unit_tests'),
1251 GTestTest('sql_unittests'), 1333 GTestTest('sql_unittests'),
1252 ] 1334 ]
1253 1335
1254 GOMA_TESTS = [ 1336 GOMA_TESTS = [
1255 GTestTest('base_unittests'), 1337 GTestTest('base_unittests'),
1256 GTestTest('content_unittests'), 1338 GTestTest('content_unittests'),
1257 ] 1339 ]
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/chromium/chromium_fyi.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698