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

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: Pass the correct arguments to AMPGTestTest 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', '4.4.3'], device_minimum_os='4.0',
628 device_timeout=60, android_isolate_path=None, **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._device_minimum_os = device_minimum_os
638 self._device_timeout = device_timeout
639 self._trigger_successful = None
640
641 @property
642 def name(self):
643 return self._name
644
645 def run(self, api, suffix): # pylint: disable=R0201
646 """Not used. All logic in pre_run, post_run."""
647 return []
648
649 def pre_run(self, api, suffix):
650 """Triggers an AMP test."""
651 amp_arguments = api.amp.amp_arguments(
652 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
653 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
654 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
655 device_minimum_os=self._device_minimum_os,
656 device_name=self._device_name,
657 device_os=self._device_os,
658 device_timeout=self._device_timeout)
659
660 isolate_file_path = (api.path['checkout'].join(self._android_isolate_path)
661 if self._android_isolate_path else None)
662 deferred_trigger_result = api.amp.trigger_test_suite(
663 self._name, 'gtest',
664 api.amp.gtest_arguments(self._name,
665 isolate_file_path=isolate_file_path),
666 amp_arguments)
667 self._trigger_successful = deferred_trigger_result.is_ok
668
669 def post_run(self, api, suffix):
670 # If we were unable to successfully trigger the AMP job, run locally.
671 if not self._trigger_successful:
672 return self._local_test.run(api, suffix)
673 else:
674 amp_arguments = api.amp.amp_arguments(
675 api_address=AMPGTestTest.AMP_INSTANCE_ADDRESS,
676 api_port=AMPGTestTest.AMP_INSTANCE_PORT,
677 api_protocol=AMPGTestTest.AMP_INSTANCE_PROTOCOL,
678 device_minimum_os=self._device_minimum_os,
679 device_name=self._device_name,
680 device_os=self._device_os,
681 device_timeout=self._device_timeout)
682
683 deferred_step_result = api.amp.collect_test_suite(
684 self._name, 'gtest', api.amp.gtest_arguments(self._name),
685 amp_arguments)
686 self._test_runs[suffix] = deferred_step_result
687 return deferred_step_result
688
689
621 class GTestTest(Test): 690 class GTestTest(Test):
622 def __init__(self, name, args=None, target_name=None, enable_swarming=False, 691 def __init__(self, name, args=None, target_name=None, enable_swarming=False,
623 swarming_shards=1, swarming_dimensions=None, swarming_tags=None, 692 swarming_shards=1, swarming_dimensions=None, swarming_tags=None,
624 swarming_extra_suffix=None, **runtest_kwargs): 693 swarming_extra_suffix=None, **runtest_kwargs):
625 super(GTestTest, self).__init__() 694 super(GTestTest, self).__init__()
626 if enable_swarming: 695 if enable_swarming:
627 self._test = SwarmingGTestTest( 696 self._test = SwarmingGTestTest(
628 name, args, target_name, swarming_shards, swarming_dimensions, 697 name, args, target_name, swarming_shards, swarming_dimensions,
629 swarming_tags, swarming_extra_suffix) 698 swarming_tags, swarming_extra_suffix)
630 else: 699 else:
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 GTestTest('ui_base_unittests'), 1311 GTestTest('ui_base_unittests'),
1243 GTestTest('ui_ios_unittests'), 1312 GTestTest('ui_ios_unittests'),
1244 GTestTest('sync_unit_tests'), 1313 GTestTest('sync_unit_tests'),
1245 GTestTest('sql_unittests'), 1314 GTestTest('sql_unittests'),
1246 ] 1315 ]
1247 1316
1248 GOMA_TESTS = [ 1317 GOMA_TESTS = [
1249 GTestTest('base_unittests'), 1318 GTestTest('base_unittests'),
1250 GTestTest('content_unittests'), 1319 GTestTest('content_unittests'),
1251 ] 1320 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698