| OLD | NEW |
| 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 Loading... |
| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 'compile_targets': [ | 727 'compile_targets': [ |
| 721 'all', | 728 'all', |
| 722 ], | 729 ], |
| 723 'tests': [ | 730 'tests': [ |
| 724 DynamicGTestTests('Linux Clang (dbg)'), | 731 DynamicGTestTests('Linux Clang (dbg)'), |
| 725 ], | 732 ], |
| 726 'testing': { | 733 'testing': { |
| 727 'platform': 'linux', | 734 'platform': 'linux', |
| 728 }, | 735 }, |
| 729 }, | 736 }, |
| 737 |
| 738 'Android Builder (dbg)': { |
| 739 'recipe_config': 'chromium_android', |
| 740 'chromium_config_kwargs': { |
| 741 'BUILD_CONFIG': 'Debug', |
| 742 'TARGET_BITS': 32, |
| 743 'TARGET_PLATFORM': 'android', |
| 744 }, |
| 745 'android_config': 'main_builder', |
| 746 'bot_type': 'builder', |
| 747 'testing': { |
| 748 'platform': 'linux', |
| 749 }, |
| 750 }, |
| 751 'Android Tests (dbg)': { |
| 752 'recipe_config': 'chromium_android', |
| 753 'chromium_config_kwargs': { |
| 754 'BUILD_CONFIG': 'Debug', |
| 755 'TARGET_BITS': 32, |
| 756 'TARGET_PLATFORM': 'android', |
| 757 }, |
| 758 'bot_type': 'tester', |
| 759 'parent_buildername': 'Android Builder (dbg)', |
| 760 'android_config': 'tests_base', |
| 761 'tests': [ |
| 762 GTestTest('base_unittests'), |
| 763 ], |
| 764 'testing': { |
| 765 'platform': 'linux', |
| 766 }, |
| 767 }, |
| 768 |
| 769 'Android Builder': { |
| 770 'recipe_config': 'chromium_android', |
| 771 'chromium_config_kwargs': { |
| 772 'BUILD_CONFIG': 'Release', |
| 773 'TARGET_BITS': 32, |
| 774 'TARGET_PLATFORM': 'android', |
| 775 }, |
| 776 'android_config': 'main_builder', |
| 777 'bot_type': 'builder', |
| 778 'testing': { |
| 779 'platform': 'linux', |
| 780 }, |
| 781 }, |
| 782 'Android Tests': { |
| 783 'recipe_config': 'chromium_android', |
| 784 'chromium_config_kwargs': { |
| 785 'BUILD_CONFIG': 'Release', |
| 786 'TARGET_BITS': 32, |
| 787 'TARGET_PLATFORM': 'android', |
| 788 }, |
| 789 'bot_type': 'tester', |
| 790 'parent_buildername': 'Android Builder', |
| 791 'android_config': 'tests_base', |
| 792 'tests': [ |
| 793 GTestTest('base_unittests'), |
| 794 ], |
| 795 'testing': { |
| 796 'platform': 'linux', |
| 797 }, |
| 798 }, |
| 730 }, | 799 }, |
| 731 }, | 800 }, |
| 732 'chromium.mac': { | 801 'chromium.mac': { |
| 733 'settings': { | 802 'settings': { |
| 734 'build_gs_bucket': 'chromium-mac-archive', | 803 'build_gs_bucket': 'chromium-mac-archive', |
| 735 }, | 804 }, |
| 736 'builders': { | 805 'builders': { |
| 737 'Mac Builder': { | 806 'Mac Builder': { |
| 738 'recipe_config': 'chromium', | 807 'recipe_config': 'chromium', |
| 739 'chromium_config_kwargs': { | 808 'chromium_config_kwargs': { |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 'chromeos_official': { | 1540 'chromeos_official': { |
| 1472 'chromium_config': 'chromium_official', | 1541 'chromium_config': 'chromium_official', |
| 1473 'chromium_apply_config': ['chromeos'], | 1542 'chromium_apply_config': ['chromeos'], |
| 1474 'gclient_config': 'chromium', | 1543 'gclient_config': 'chromium', |
| 1475 'gclient_apply_config': ['chrome_internal'], | 1544 'gclient_apply_config': ['chrome_internal'], |
| 1476 }, | 1545 }, |
| 1477 'chromium': { | 1546 'chromium': { |
| 1478 'chromium_config': 'chromium', | 1547 'chromium_config': 'chromium', |
| 1479 'gclient_config': 'chromium', | 1548 'gclient_config': 'chromium', |
| 1480 }, | 1549 }, |
| 1550 'chromium_android': { |
| 1551 'chromium_config': 'android', |
| 1552 'gclient_config': 'chromium', |
| 1553 'gclient_apply_config': ['android'], |
| 1554 }, |
| 1481 'chromium_clang': { | 1555 'chromium_clang': { |
| 1482 'chromium_config': 'chromium_clang', | 1556 'chromium_config': 'chromium_clang', |
| 1483 'gclient_config': 'chromium', | 1557 'gclient_config': 'chromium', |
| 1484 }, | 1558 }, |
| 1485 'chromium_chromeos': { | 1559 'chromium_chromeos': { |
| 1486 'chromium_config': 'chromium', | 1560 'chromium_config': 'chromium', |
| 1487 'chromium_apply_config': ['chromeos'], | 1561 'chromium_apply_config': ['chromeos'], |
| 1488 'gclient_config': 'chromium', | 1562 'gclient_config': 'chromium', |
| 1489 }, | 1563 }, |
| 1490 'chromium_chromeos_clang': { | 1564 'chromium_chromeos_clang': { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 if bot_config.get('use_isolate'): | 1598 if bot_config.get('use_isolate'): |
| 1525 api.isolate.set_isolate_environment(api.chromium.c) | 1599 api.isolate.set_isolate_environment(api.chromium.c) |
| 1526 for c in recipe_config.get('chromium_apply_config', []): | 1600 for c in recipe_config.get('chromium_apply_config', []): |
| 1527 api.chromium.apply_config(c) | 1601 api.chromium.apply_config(c) |
| 1528 for c in bot_config.get('chromium_apply_config', []): | 1602 for c in bot_config.get('chromium_apply_config', []): |
| 1529 api.chromium.apply_config(c) | 1603 api.chromium.apply_config(c) |
| 1530 api.gclient.set_config(recipe_config['gclient_config']) | 1604 api.gclient.set_config(recipe_config['gclient_config']) |
| 1531 for c in recipe_config.get('gclient_apply_config', []): | 1605 for c in recipe_config.get('gclient_apply_config', []): |
| 1532 api.gclient.apply_config(c) | 1606 api.gclient.apply_config(c) |
| 1533 | 1607 |
| 1608 if 'android_config' in bot_config: |
| 1609 api.chromium_android.set_config( |
| 1610 bot_config['android_config'], |
| 1611 **bot_config.get('chromium_config_kwargs', {})) |
| 1612 |
| 1534 if api.platform.is_win: | 1613 if api.platform.is_win: |
| 1535 yield api.chromium.taskkill() | 1614 yield api.chromium.taskkill() |
| 1536 | 1615 |
| 1537 # Bot Update re-uses the gclient configs. | 1616 # Bot Update re-uses the gclient configs. |
| 1538 yield api.bot_update.ensure_checkout(), | 1617 yield api.bot_update.ensure_checkout(), |
| 1539 if not api.step_history.last_step().json.output['did_run']: | 1618 if not api.step_history.last_step().json.output['did_run']: |
| 1540 yield api.gclient.checkout(), | 1619 yield api.gclient.checkout(), |
| 1541 # Whatever step is run right before this line needs to emit got_revision. | 1620 # Whatever step is run right before this line needs to emit got_revision. |
| 1542 update_step = api.step_history.last_step() | 1621 update_step = api.step_history.last_step() |
| 1543 got_revision = update_step.presentation.properties['got_revision'] | 1622 got_revision = update_step.presentation.properties['got_revision'] |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1571 compile_targets.update(test.compile_targets(api)) | 1650 compile_targets.update(test.compile_targets(api)) |
| 1572 for builder_dict in master_dict.get('builders', {}).itervalues(): | 1651 for builder_dict in master_dict.get('builders', {}).itervalues(): |
| 1573 if builder_dict.get('parent_buildername') == buildername: | 1652 if builder_dict.get('parent_buildername') == buildername: |
| 1574 for test in builder_dict.get('tests', []): | 1653 for test in builder_dict.get('tests', []): |
| 1575 compile_targets.update(test.compile_targets(api)) | 1654 compile_targets.update(test.compile_targets(api)) |
| 1576 steps.extend([ | 1655 steps.extend([ |
| 1577 api.chromium.compile(targets=sorted(compile_targets)), | 1656 api.chromium.compile(targets=sorted(compile_targets)), |
| 1578 api.chromium.checkdeps(), | 1657 api.chromium.checkdeps(), |
| 1579 ]) | 1658 ]) |
| 1580 | 1659 |
| 1660 if api.chromium.c.TARGET_PLATFORM == 'android': |
| 1661 steps.extend([ |
| 1662 api.chromium_android.checklicenses(), |
| 1663 api.chromium_android.findbugs(), |
| 1664 ]) |
| 1665 |
| 1581 if bot_config.get('use_isolate'): | 1666 if bot_config.get('use_isolate'): |
| 1582 test_args_map = {} | 1667 test_args_map = {} |
| 1583 test_spec = api.step_history['read test spec'].json.output | 1668 test_spec = api.step_history['read test spec'].json.output |
| 1584 gtests_tests = test_spec.get(buildername, {}).get('gtest_tests', []) | 1669 gtests_tests = test_spec.get(buildername, {}).get('gtest_tests', []) |
| 1585 for test in gtests_tests: | 1670 for test in gtests_tests: |
| 1586 if isinstance(test, dict): | 1671 if isinstance(test, dict): |
| 1587 test_args = test.get('args') | 1672 test_args = test.get('args') |
| 1588 test_name = test.get('test') | 1673 test_name = test.get('test') |
| 1589 if test_name and test_args: | 1674 if test_name and test_args: |
| 1590 test_args_map[test_name] = test_args | 1675 test_args_map[test_name] = test_args |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1615 steps.append(api.archive.download_and_unzip_build( | 1700 steps.append(api.archive.download_and_unzip_build( |
| 1616 'extract build', | 1701 'extract build', |
| 1617 api.chromium.c.build_config_fs, | 1702 api.chromium.c.build_config_fs, |
| 1618 api.archive.legacy_download_url( | 1703 api.archive.legacy_download_url( |
| 1619 master_config.get('build_gs_bucket'), | 1704 master_config.get('build_gs_bucket'), |
| 1620 extra_url_components=api.properties['mastername'],), | 1705 extra_url_components=api.properties['mastername'],), |
| 1621 build_revision=got_revision, | 1706 build_revision=got_revision, |
| 1622 # TODO(phajdan.jr): Move abort_on_failure to archive recipe module. | 1707 # TODO(phajdan.jr): Move abort_on_failure to archive recipe module. |
| 1623 abort_on_failure=True)) | 1708 abort_on_failure=True)) |
| 1624 | 1709 |
| 1710 if (api.chromium.c.TARGET_PLATFORM == 'android' and |
| 1711 bot_type in ['tester', 'builder_tester']): |
| 1712 steps.extend([ |
| 1713 api.chromium_android.device_status_check(abort_on_failure=True), |
| 1714 api.chromium_android.provision_devices(abort_on_failure=True), |
| 1715 ]) |
| 1716 |
| 1625 if not bot_config.get('do_not_run_tests'): | 1717 if not bot_config.get('do_not_run_tests'): |
| 1626 test_steps = [t.run(api) for t in bot_config.get('tests', [])] | 1718 test_steps = [t.run(api) for t in bot_config.get('tests', [])] |
| 1627 steps.extend(api.chromium.setup_tests(bot_type, test_steps)) | 1719 steps.extend(api.chromium.setup_tests(bot_type, test_steps)) |
| 1628 | 1720 |
| 1629 # For non-trybot recipes we should know (seed) all steps in advance, | 1721 # For non-trybot recipes we should know (seed) all steps in advance, |
| 1630 # at the beginning of each build. Instead of yielding single steps | 1722 # at the beginning of each build. Instead of yielding single steps |
| 1631 # or groups of steps, yield all of them at the end. | 1723 # or groups of steps, yield all of them at the end. |
| 1632 yield steps | 1724 yield steps |
| 1633 | 1725 |
| 1634 | 1726 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 'compile_targets': ['browser_tests_run'], | 1783 'compile_targets': ['browser_tests_run'], |
| 1692 'gtest_tests': [{ | 1784 'gtest_tests': [{ |
| 1693 'test': 'browser_tests', | 1785 'test': 'browser_tests', |
| 1694 'args': ['--gtest-filter', '*NaCl*'], | 1786 'args': ['--gtest-filter', '*NaCl*'], |
| 1695 'shard_index': 0, | 1787 'shard_index': 0, |
| 1696 'total_shards': 1, | 1788 'total_shards': 1, |
| 1697 }], | 1789 }], |
| 1698 }, | 1790 }, |
| 1699 })) | 1791 })) |
| 1700 ) | 1792 ) |
| 1793 |
| 1794 yield ( |
| 1795 api.test('findbugs_failure') + |
| 1796 api.properties.generic(mastername='chromium.linux', |
| 1797 buildername='Android Builder (dbg)') + |
| 1798 api.platform('linux', 32) + |
| 1799 api.step_data('findbugs', retcode=1) |
| 1800 ) |
| OLD | NEW |