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

Side by Side Diff: scripts/slave/recipes/chromium.py

Issue 303513002: Initial work towards public Android recipes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 6 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 DEPS = [ 5 DEPS = [
6 'archive', 6 'archive',
7 'bot_update', 7 'bot_update',
8 'chromium', 8 'chromium',
9 'chromium_android',
9 'gclient', 10 'gclient',
10 'isolate', 11 'isolate',
11 'json', 12 'json',
12 'path', 13 'path',
13 'platform', 14 'platform',
14 'properties', 15 'properties',
15 'python', 16 'python',
16 'step_history', 17 'step_history',
17 ] 18 ]
18 19
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return [] 61 return []
61 62
62 63
63 class GTestTest(object): 64 class GTestTest(object):
64 def __init__(self, name, args=None, flakiness_dash=False): 65 def __init__(self, name, args=None, flakiness_dash=False):
65 self.name = name 66 self.name = name
66 self.args = args or [] 67 self.args = args or []
67 self.flakiness_dash = flakiness_dash 68 self.flakiness_dash = flakiness_dash
68 69
69 def run(self, api): 70 def run(self, api):
71 if api.chromium.c.TARGET_PLATFORM == 'android':
72 return api.chromium_android.run_test_suite(self.name, self.args)
73
70 return api.chromium.runtest(self.name, 74 return api.chromium.runtest(self.name,
71 test_type=self.name, 75 test_type=self.name,
72 args=self.args, 76 args=self.args,
73 annotate='gtest', 77 annotate='gtest',
74 xvfb=True, 78 xvfb=True,
75 parallel=True, 79 parallel=True,
76 flakiness_dash=self.flakiness_dash) 80 flakiness_dash=self.flakiness_dash)
77 81
78 def compile_targets(self, _): 82 def compile_targets(self, api):
83 if api.chromium.c.TARGET_PLATFORM == 'android':
84 return [self.name + '_apk']
85
79 return [self.name] 86 return [self.name]
80 87
81 88
82 class DynamicGTestTests(object): 89 class DynamicGTestTests(object):
83 def __init__(self, buildername, flakiness_dash=True): 90 def __init__(self, buildername, flakiness_dash=True):
84 self.buildername = buildername 91 self.buildername = buildername
85 self.flakiness_dash = flakiness_dash 92 self.flakiness_dash = flakiness_dash
86 93
87 @staticmethod 94 @staticmethod
88 def _canonicalize_test(test): 95 def _canonicalize_test(test):
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 'compile_targets': [ 720 'compile_targets': [
714 'all', 721 'all',
715 ], 722 ],
716 'tests': [ 723 'tests': [
717 DynamicGTestTests('Linux Clang (dbg)'), 724 DynamicGTestTests('Linux Clang (dbg)'),
718 ], 725 ],
719 'testing': { 726 'testing': {
720 'platform': 'linux', 727 'platform': 'linux',
721 }, 728 },
722 }, 729 },
730
731 'Android Builder (dbg)': {
732 'recipe_config': 'chromium_android',
733 'chromium_config_kwargs': {
734 'BUILD_CONFIG': 'Debug',
735 'TARGET_BITS': 32,
736 'TARGET_PLATFORM': 'android',
737 },
738 'android_config': 'main_builder',
739 'bot_type': 'builder',
740 'testing': {
741 'platform': 'linux',
742 },
743 },
744 'Android Tests (dbg)': {
745 'recipe_config': 'chromium_android',
746 'chromium_config_kwargs': {
747 'BUILD_CONFIG': 'Debug',
748 'TARGET_BITS': 32,
749 'TARGET_PLATFORM': 'android',
750 },
751 'bot_type': 'tester',
752 'parent_buildername': 'Android Builder (dbg)',
753 'android_config': 'tests_base',
754 'tests': [
755 GTestTest('base_unittests'),
756 ],
757 'testing': {
758 'platform': 'linux',
759 },
760 },
761
762 'Android Builder': {
763 'recipe_config': 'chromium_android',
764 'chromium_config_kwargs': {
765 'BUILD_CONFIG': 'Release',
766 'TARGET_BITS': 32,
767 'TARGET_PLATFORM': 'android',
768 },
769 'android_config': 'main_builder',
770 'bot_type': 'builder',
771 'testing': {
772 'platform': 'linux',
773 },
774 },
775 'Android Tests': {
776 'recipe_config': 'chromium_android',
777 'chromium_config_kwargs': {
778 'BUILD_CONFIG': 'Release',
779 'TARGET_BITS': 32,
780 'TARGET_PLATFORM': 'android',
781 },
782 'bot_type': 'tester',
783 'parent_buildername': 'Android Builder',
784 'android_config': 'tests_base',
785 'tests': [
786 GTestTest('base_unittests'),
787 ],
788 'testing': {
789 'platform': 'linux',
790 },
791 },
723 }, 792 },
724 }, 793 },
725 'chromium.mac': { 794 'chromium.mac': {
726 'settings': { 795 'settings': {
727 'build_gs_bucket': 'chromium-mac-archive', 796 'build_gs_bucket': 'chromium-mac-archive',
728 }, 797 },
729 'builders': { 798 'builders': {
730 'Mac Builder': { 799 'Mac Builder': {
731 'recipe_config': 'chromium', 800 'recipe_config': 'chromium',
732 'chromium_config_kwargs': { 801 'chromium_config_kwargs': {
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 'chromeos_official': { 1533 'chromeos_official': {
1465 'chromium_config': 'chromium_official', 1534 'chromium_config': 'chromium_official',
1466 'chromium_apply_config': ['chromeos'], 1535 'chromium_apply_config': ['chromeos'],
1467 'gclient_config': 'chromium', 1536 'gclient_config': 'chromium',
1468 'gclient_apply_config': ['chrome_internal'], 1537 'gclient_apply_config': ['chrome_internal'],
1469 }, 1538 },
1470 'chromium': { 1539 'chromium': {
1471 'chromium_config': 'chromium', 1540 'chromium_config': 'chromium',
1472 'gclient_config': 'chromium', 1541 'gclient_config': 'chromium',
1473 }, 1542 },
1543 'chromium_android': {
1544 'chromium_config': 'android',
1545 'gclient_config': 'chromium',
1546 'gclient_apply_config': ['android'],
1547 },
1474 'chromium_clang': { 1548 'chromium_clang': {
1475 'chromium_config': 'chromium_clang', 1549 'chromium_config': 'chromium_clang',
1476 'gclient_config': 'chromium', 1550 'gclient_config': 'chromium',
1477 }, 1551 },
1478 'chromium_chromeos': { 1552 'chromium_chromeos': {
1479 'chromium_config': 'chromium', 1553 'chromium_config': 'chromium',
1480 'chromium_apply_config': ['chromeos'], 1554 'chromium_apply_config': ['chromeos'],
1481 'gclient_config': 'chromium', 1555 'gclient_config': 'chromium',
1482 }, 1556 },
1483 'chromium_chromeos_clang': { 1557 'chromium_chromeos_clang': {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 if bot_config.get('use_isolate'): 1591 if bot_config.get('use_isolate'):
1518 api.isolate.set_isolate_environment(api.chromium.c) 1592 api.isolate.set_isolate_environment(api.chromium.c)
1519 for c in recipe_config.get('chromium_apply_config', []): 1593 for c in recipe_config.get('chromium_apply_config', []):
1520 api.chromium.apply_config(c) 1594 api.chromium.apply_config(c)
1521 for c in bot_config.get('chromium_apply_config', []): 1595 for c in bot_config.get('chromium_apply_config', []):
1522 api.chromium.apply_config(c) 1596 api.chromium.apply_config(c)
1523 api.gclient.set_config(recipe_config['gclient_config']) 1597 api.gclient.set_config(recipe_config['gclient_config'])
1524 for c in recipe_config.get('gclient_apply_config', []): 1598 for c in recipe_config.get('gclient_apply_config', []):
1525 api.gclient.apply_config(c) 1599 api.gclient.apply_config(c)
1526 1600
1601 if 'android_config' in bot_config:
1602 api.chromium_android.set_config(
1603 bot_config['android_config'],
1604 **bot_config.get('chromium_config_kwargs', {}))
Michael Achenbach 2014/05/28 14:23:27 Not totally sure how much sense it makes to add th
Paweł Hajdan Jr. 2014/05/30 09:49:00 Yes, android build is quite messy. It seems to me
1605
1527 if api.platform.is_win: 1606 if api.platform.is_win:
1528 yield api.chromium.taskkill() 1607 yield api.chromium.taskkill()
1529 1608
1530 # Bot Update re-uses the gclient configs. 1609 # Bot Update re-uses the gclient configs.
1531 yield api.bot_update.ensure_checkout(), 1610 yield api.bot_update.ensure_checkout(),
1532 if not api.step_history.last_step().json.output['did_run']: 1611 if not api.step_history.last_step().json.output['did_run']:
1533 yield api.gclient.checkout(), 1612 yield api.gclient.checkout(),
1534 # Whatever step is run right before this line needs to emit got_revision. 1613 # Whatever step is run right before this line needs to emit got_revision.
1535 update_step = api.step_history.last_step() 1614 update_step = api.step_history.last_step()
1536 got_revision = update_step.presentation.properties['got_revision'] 1615 got_revision = update_step.presentation.properties['got_revision']
(...skipping 27 matching lines...) Expand all
1564 compile_targets.update(test.compile_targets(api)) 1643 compile_targets.update(test.compile_targets(api))
1565 for builder_dict in master_dict.get('builders', {}).itervalues(): 1644 for builder_dict in master_dict.get('builders', {}).itervalues():
1566 if builder_dict.get('parent_buildername') == buildername: 1645 if builder_dict.get('parent_buildername') == buildername:
1567 for test in builder_dict.get('tests', []): 1646 for test in builder_dict.get('tests', []):
1568 compile_targets.update(test.compile_targets(api)) 1647 compile_targets.update(test.compile_targets(api))
1569 steps.extend([ 1648 steps.extend([
1570 api.chromium.compile(targets=sorted(compile_targets)), 1649 api.chromium.compile(targets=sorted(compile_targets)),
1571 api.chromium.checkdeps(), 1650 api.chromium.checkdeps(),
1572 ]) 1651 ])
1573 1652
1653 if api.chromium.c.TARGET_PLATFORM == 'android':
1654 steps.extend([
1655 api.chromium_android.checklicenses(),
1656 api.chromium_android.findbugs(),
1657 ])
1658
1574 if bot_type == 'builder': 1659 if bot_type == 'builder':
1575 steps.append(api.archive.zip_and_upload_build( 1660 steps.append(api.archive.zip_and_upload_build(
1576 'package build', 1661 'package build',
1577 api.chromium.c.build_config_fs, 1662 api.chromium.c.build_config_fs,
1578 api.archive.legacy_upload_url( 1663 api.archive.legacy_upload_url(
1579 master_config.get('build_gs_bucket'), 1664 master_config.get('build_gs_bucket'),
1580 extra_url_components=api.properties['mastername']), 1665 extra_url_components=api.properties['mastername']),
1581 build_revision=got_revision)) 1666 build_revision=got_revision))
1582 1667
1583 if bot_type == 'tester': 1668 if bot_type == 'tester':
(...skipping 12 matching lines...) Expand all
1596 steps.append(api.archive.download_and_unzip_build( 1681 steps.append(api.archive.download_and_unzip_build(
1597 'extract build', 1682 'extract build',
1598 api.chromium.c.build_config_fs, 1683 api.chromium.c.build_config_fs,
1599 api.archive.legacy_download_url( 1684 api.archive.legacy_download_url(
1600 master_config.get('build_gs_bucket'), 1685 master_config.get('build_gs_bucket'),
1601 extra_url_components=api.properties['mastername'],), 1686 extra_url_components=api.properties['mastername'],),
1602 build_revision=got_revision, 1687 build_revision=got_revision,
1603 # TODO(phajdan.jr): Move abort_on_failure to archive recipe module. 1688 # TODO(phajdan.jr): Move abort_on_failure to archive recipe module.
1604 abort_on_failure=True)) 1689 abort_on_failure=True))
1605 1690
1691 if (api.chromium.c.TARGET_PLATFORM == 'android' and
1692 bot_type in ['tester', 'builder_tester']):
1693 steps.extend([
1694 api.chromium_android.device_status_check(abort_on_failure=True),
1695 api.chromium_android.provision_devices(abort_on_failure=True),
1696 ])
1697
1606 test_steps = [t.run(api) for t in bot_config.get('tests', [])] 1698 test_steps = [t.run(api) for t in bot_config.get('tests', [])]
1607 steps.extend(api.chromium.setup_tests(bot_type, test_steps)) 1699 steps.extend(api.chromium.setup_tests(bot_type, test_steps))
1608 1700
1609 # For non-trybot recipes we should know (seed) all steps in advance, 1701 # For non-trybot recipes we should know (seed) all steps in advance,
1610 # at the beginning of each build. Instead of yielding single steps 1702 # at the beginning of each build. Instead of yielding single steps
1611 # or groups of steps, yield all of them at the end. 1703 # or groups of steps, yield all of them at the end.
1612 yield steps 1704 yield steps
1613 1705
1614 1706
1615 def _sanitize_nonalpha(text): 1707 def _sanitize_nonalpha(text):
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 api.platform('linux', 64) + 1743 api.platform('linux', 64) +
1652 api.override_step_data('read test spec', api.json.output({ 1744 api.override_step_data('read test spec', api.json.output({
1653 'Linux Tests': { 1745 'Linux Tests': {
1654 'gtest_tests': [ 1746 'gtest_tests': [
1655 'base_unittests', 1747 'base_unittests',
1656 {'test': 'browser_tests', 'shard_index': 0, 'total_shards': 2}, 1748 {'test': 'browser_tests', 'shard_index': 0, 'total_shards': 2},
1657 ], 1749 ],
1658 }, 1750 },
1659 })) 1751 }))
1660 ) 1752 )
1753
1754 yield (
1755 api.test('findbugs_failure') +
1756 api.properties.generic(mastername='chromium.linux',
1757 buildername='Android Builder (dbg)') +
1758 api.platform('linux', 32) +
1759 api.step_data('findbugs', retcode=1)
1760 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698