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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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 600 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, device_name=['Nexus 5'],
627 device_os=['4.4.2'], android_isolate_path=None,
628 **runtest_kwargs):
629 self._name = name
630 self._args = args
631 self._target_name = target_name
632 self._android_isolate_path = android_isolate_path
633 # LocalGTestTest is used when AMP tests are not triggered successfully.
634 self._local_test = LocalGTestTest(name, args, target_name, **runtest_kwargs)
635 self._device_name = device_name
636 self._device_os = device_os
637 self._trigger_successful = None
638
639 @property
640 def name(self):
641 return self._name
642
643 def run(self, api, suffix): # pylint: disable=R0201
644 """Not used. All logic in pre_run, post_run."""
645 return []
646
647 def pre_run(self, api, suffix):
648 """Triggers an AMP test."""
649 amp_arguments = api.amp.amp_arguments(
650 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
651 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
652 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
653 device_name=self._device_name,
654 device_os=self._device_os)
655
656 isolate_file_path = (api.path['checkout'].join(self._android_isolate_path)
657 if self._android_isolate_path else None)
658 try:
659 api.amp.trigger_test_suite(
660 self._name, 'gtest',
661 api.amp.gtest_arguments(self._name,
662 isolate_file_path=isolate_file_path),
663 amp_arguments)
664 self._trigger_successful = True
665 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
666 self._trigger_successful = False
667
668 def post_run(self, api, suffix):
669 # If we were unable to successfully trigger the AMP job, run locally.
670 if not self._trigger_successful:
671 return self._local_test.run(api, suffix)
672 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.
673 amp_arguments = api.amp.amp_arguments(
674 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
675 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
676 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
677 device_name=self._device_name,
678 device_os=self._device_os)
679
680 api.amp.collect_test_suite(
681 self._name, 'gtest', api.amp.gtest_arguments(self._name),
682 amp_arguments)
683
684
621 class GTestTest(Test): 685 class GTestTest(Test):
622 def __init__(self, name, args=None, target_name=None, enable_swarming=False, 686 def __init__(self, name, args=None, target_name=None, enable_swarming=False,
623 swarming_shards=1, swarming_dimensions=None, swarming_tags=None, 687 swarming_shards=1, swarming_dimensions=None, swarming_tags=None,
624 swarming_extra_suffix=None, **runtest_kwargs): 688 swarming_extra_suffix=None, **runtest_kwargs):
625 super(GTestTest, self).__init__() 689 super(GTestTest, self).__init__()
626 if enable_swarming: 690 if enable_swarming:
627 self._test = SwarmingGTestTest( 691 self._test = SwarmingGTestTest(
628 name, args, target_name, swarming_shards, swarming_dimensions, 692 name, args, target_name, swarming_shards, swarming_dimensions,
629 swarming_tags, swarming_extra_suffix) 693 swarming_tags, swarming_extra_suffix)
630 else: 694 else:
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 GTestTest('ui_base_unittests'), 1319 GTestTest('ui_base_unittests'),
1256 GTestTest('ui_ios_unittests'), 1320 GTestTest('ui_ios_unittests'),
1257 GTestTest('sync_unit_tests'), 1321 GTestTest('sync_unit_tests'),
1258 GTestTest('sql_unittests'), 1322 GTestTest('sql_unittests'),
1259 ] 1323 ]
1260 1324
1261 GOMA_TESTS = [ 1325 GOMA_TESTS = [
1262 GTestTest('base_unittests'), 1326 GTestTest('base_unittests'),
1263 GTestTest('content_unittests'), 1327 GTestTest('content_unittests'),
1264 ] 1328 ]
OLDNEW
« 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