OLD | NEW |
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 # Recipe for building Chromium and running WebRTC-specific tests with special | 5 # Recipe for building Chromium and running WebRTC-specific tests with special |
6 # requirements that doesn't allow them to run in the main Chromium waterfalls. | 6 # requirements that doesn't allow them to run in the main Chromium waterfalls. |
7 # Also provide a set of FYI bots that builds Chromium with WebRTC ToT to provide | 7 # Also provide a set of FYI bots that builds Chromium with WebRTC ToT to provide |
8 # pre-roll test results. | 8 # pre-roll test results. |
9 | 9 |
10 DEPS = [ | 10 DEPS = [ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 # The chromium.webrtc.fyi master is used as an early warning system to catch | 57 # The chromium.webrtc.fyi master is used as an early warning system to catch |
58 # WebRTC specific errors before they get rolled into Chromium's DEPS. | 58 # WebRTC specific errors before they get rolled into Chromium's DEPS. |
59 # Therefore this waterfall needs to build src/third_party/webrtc with WebRTC | 59 # Therefore this waterfall needs to build src/third_party/webrtc with WebRTC |
60 # ToT and use the Chromium HEAD. The revision poller is passing a WebRTC | 60 # ToT and use the Chromium HEAD. The revision poller is passing a WebRTC |
61 # revision for these recipes. | 61 # revision for these recipes. |
62 if mastername == 'chromium.webrtc.fyi': | 62 if mastername == 'chromium.webrtc.fyi': |
63 s = api.gclient.c.solutions | 63 s = api.gclient.c.solutions |
64 s[0].revision = 'HEAD' | 64 s[0].revision = 'HEAD' |
65 | 65 |
66 # Revision to be used for SVN-based checkouts and passing builds between | |
67 # builders/testers. | |
68 # For forced builds, revision is empty, in which case we sync HEAD. | |
69 webrtc_revision = api.properties.get('revision', 'HEAD') | |
70 if webrtc_revision is None: | |
71 webrtc_revision = 'HEAD' | |
72 | |
73 if bot_type == 'tester': | |
74 webrtc_revision = api.properties.get('parent_got_revision') | |
75 assert webrtc_revision, ( | |
76 'Testers cannot be forced without providing revision information. ' | |
77 'Please select a previous build and click [Rebuild] or force a build ' | |
78 'for a Builder instead (will trigger new runs for the testers).') | |
79 | |
80 # Since bot_update uses separate Git mirrors for the webrtc and libjingle | 66 # Since bot_update uses separate Git mirrors for the webrtc and libjingle |
81 # repos, they cannot use the revision we get from the poller, since it won't | 67 # repos, they cannot use the revision we get from the poller, since it won't |
82 # be present in both if there's a revision that only contains changes in one | 68 # be present in both if there's a revision that only contains changes in one |
83 # of them. For now, work around this by always syncing HEAD for both. | 69 # of them. For now, work around this by always syncing HEAD for both. |
84 api.gclient.c.revisions.update({ | 70 api.gclient.c.revisions.update({ |
85 'src/third_party/webrtc': 'HEAD', | 71 'src/third_party/webrtc': 'HEAD', |
86 'src/third_party/libjingle/source/talk': 'HEAD', | 72 'src/third_party/libjingle/source/talk': 'HEAD', |
87 }) | 73 }) |
88 | 74 |
89 # Bot Update re-uses the gclient configs. | 75 # Bot Update re-uses the gclient configs. |
90 step_result = api.bot_update.ensure_checkout(force=True) | 76 step_result = api.bot_update.ensure_checkout(force=True) |
91 got_revision = step_result.presentation.properties['got_revision'] | 77 got_revision = step_result.presentation.properties['got_revision'] |
92 | 78 |
93 if not bot_config.get('disable_runhooks'): | 79 if not bot_config.get('disable_runhooks'): |
94 api.chromium.runhooks() | 80 api.chromium.runhooks() |
95 | 81 |
96 if bot_type in ('builder', 'builder_tester'): | 82 if bot_type in ('builder', 'builder_tester'): |
97 run_gn = api.chromium.c.project_generator.tool == 'gn' | 83 run_gn = api.chromium.c.project_generator.tool == 'gn' |
98 if run_gn: | 84 if run_gn: |
99 api.chromium.run_gn() | 85 api.chromium.run_gn() |
100 | 86 |
101 compile_targets = recipe_config.get('compile_targets', []) | 87 compile_targets = recipe_config.get('compile_targets', []) |
102 api.chromium.compile(targets=compile_targets) | 88 api.chromium.compile(targets=compile_targets) |
103 if mastername == 'chromium.webrtc.fyi' and not run_gn: | 89 if mastername == 'chromium.webrtc.fyi' and not run_gn: |
104 api.webrtc.sizes(got_revision) | 90 api.webrtc.sizes(got_revision) |
105 | 91 |
| 92 archive_revision = api.properties.get('parent_got_revision', got_revision) |
106 if bot_type == 'builder' and bot_config.get('build_gs_archive'): | 93 if bot_type == 'builder' and bot_config.get('build_gs_archive'): |
107 api.webrtc.package_build( | 94 api.webrtc.package_build( |
108 api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], got_revision) | 95 api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], |
| 96 archive_revision) |
109 | 97 |
110 if bot_type == 'tester': | 98 if bot_type == 'tester': |
111 # Ensure old build directory is not used is by removing it. | |
112 api.path.rmtree( | |
113 'build directory', | |
114 api.chromium.c.build_dir.join(api.chromium.c.build_config_fs)) | |
115 | |
116 api.webrtc.extract_build( | 99 api.webrtc.extract_build( |
117 api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], got_revision) | 100 api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], |
| 101 archive_revision) |
118 | 102 |
119 if bot_type in ('builder_tester', 'tester'): | 103 if bot_type in ('builder_tester', 'tester'): |
120 api.webrtc.cleanup() | 104 api.webrtc.cleanup() |
121 if api.chromium.c.TARGET_PLATFORM == 'android': | 105 if api.chromium.c.TARGET_PLATFORM == 'android': |
122 api.chromium_android.common_tests_setup_steps() | 106 api.chromium_android.common_tests_setup_steps() |
123 api.chromium_android.run_test_suite( | 107 api.chromium_android.run_test_suite( |
124 'content_browsertests', | 108 'content_browsertests', |
125 gtest_filter='WebRtc*') | 109 gtest_filter='WebRtc*') |
126 api.chromium_android.common_tests_final_steps() | 110 api.chromium_android.common_tests_final_steps() |
127 else: | 111 else: |
128 test_runner = lambda: api.webrtc.runtests(recipe_config.get('test_suite'), | 112 test_runner = lambda: api.webrtc.runtests(recipe_config.get('test_suite'), |
129 revision=got_revision) | 113 revision=got_revision) |
130 api.chromium_tests.setup_chromium_tests(test_runner) | 114 api.chromium_tests.setup_chromium_tests(test_runner) |
131 | 115 |
132 | 116 |
133 def _sanitize_nonalpha(text): | 117 def _sanitize_nonalpha(text): |
134 return ''.join(c if c.isalnum() else '_' for c in text) | 118 return ''.join(c if c.isalnum() else '_' for c in text) |
135 | 119 |
136 | 120 |
137 def GenTests(api): | 121 def GenTests(api): |
138 def generate_builder(mastername, buildername, bot_config, revision=None, | 122 builders = api.webrtc.BUILDERS |
| 123 |
| 124 def generate_builder(mastername, buildername, revision=None, |
139 parent_got_revision=None, suffix=None): | 125 parent_got_revision=None, suffix=None): |
140 suffix = suffix or '' | 126 suffix = suffix or '' |
| 127 bot_config = builders[mastername]['builders'][buildername] |
141 bot_type = bot_config.get('bot_type', 'builder_tester') | 128 bot_type = bot_config.get('bot_type', 'builder_tester') |
| 129 |
142 if bot_type in ('builder', 'builder_tester'): | 130 if bot_type in ('builder', 'builder_tester'): |
143 assert bot_config.get('parent_buildername') is None, ( | 131 assert bot_config.get('parent_buildername') is None, ( |
144 'Unexpected parent_buildername for builder %r on master %r.' % | 132 'Unexpected parent_buildername for builder %r on master %r.' % |
145 (buildername, mastername)) | 133 (buildername, mastername)) |
146 test = ( | 134 test = ( |
147 api.test('%s_%s%s' % (_sanitize_nonalpha(mastername), | 135 api.test('%s_%s%s' % (_sanitize_nonalpha(mastername), |
148 _sanitize_nonalpha(buildername), suffix)) + | 136 _sanitize_nonalpha(buildername), suffix)) + |
149 api.properties.generic(mastername=mastername, | 137 api.properties.generic(mastername=mastername, |
150 buildername=buildername, | 138 buildername=buildername, |
151 revision=revision, | 139 revision=revision, |
152 parent_buildername=bot_config.get( | 140 parent_buildername=bot_config.get( |
153 'parent_buildername')) + | 141 'parent_buildername')) + |
154 api.platform(bot_config['testing']['platform'], | 142 api.platform(bot_config['testing']['platform'], |
155 bot_config.get( | 143 bot_config.get( |
156 'chromium_config_kwargs', {}).get('TARGET_BITS', 64)) | 144 'chromium_config_kwargs', {}).get('TARGET_BITS', 64)) |
157 ) | 145 ) |
158 if bot_type == 'tester': | 146 if bot_type == 'tester': |
159 parent_rev = parent_got_revision or revision | 147 parent_rev = parent_got_revision or revision |
160 test += api.properties(parent_got_revision=parent_rev) | 148 test += api.properties(parent_got_revision=parent_rev) |
161 return test | 149 return test |
162 | 150 |
163 for mastername in ('chromium.webrtc', 'chromium.webrtc.fyi'): | 151 for mastername in ('chromium.webrtc', 'chromium.webrtc.fyi'): |
164 master_config = api.webrtc.BUILDERS[mastername] | 152 master_config = builders[mastername] |
165 for buildername, bot_config in master_config['builders'].iteritems(): | 153 for buildername in master_config['builders'].keys(): |
166 revision = '12345' if mastername == 'chromium.webrtc.fyi' else '321321' | 154 revision = '12345' if mastername == 'chromium.webrtc.fyi' else '321321' |
167 yield generate_builder(mastername, buildername, bot_config, revision) | 155 yield generate_builder(mastername, buildername, revision) |
168 | 156 |
169 # Forced build (not specifying any revision). | 157 # Forced build (not specifying any revision). |
170 mastername = 'chromium.webrtc' | 158 mastername = 'chromium.webrtc' |
171 buildername = 'Linux Builder' | 159 buildername = 'Linux Builder' |
172 bot_config = api.webrtc.BUILDERS[mastername]['builders'][buildername] | 160 yield generate_builder(mastername, buildername, revision=None, |
173 yield generate_builder(mastername, buildername, bot_config, revision=None, | |
174 suffix='_forced') | 161 suffix='_forced') |
175 | 162 |
| 163 buildername = 'Linux Tester' |
| 164 yield generate_builder(mastername, buildername, revision=None, |
| 165 suffix='_forced_invalid') |
| 166 |
176 # Periodic scheduler triggered builds also don't contain revision. | 167 # Periodic scheduler triggered builds also don't contain revision. |
177 mastername = 'chromium.webrtc.fyi' | 168 mastername = 'chromium.webrtc.fyi' |
178 buildername = 'Win Builder' | 169 buildername = 'Win Builder' |
179 bot_config = api.webrtc.BUILDERS[mastername]['builders'][buildername] | 170 yield generate_builder(mastername, buildername, revision=None, |
180 yield generate_builder(mastername, buildername, bot_config, revision=None, | |
181 suffix='_periodic_triggered') | 171 suffix='_periodic_triggered') |
182 | 172 |
183 # Testers gets got_revision value from builder passed as parent_got_revision. | 173 # Testers gets got_revision value from builder passed as parent_got_revision. |
184 buildername = 'Win7 Tester' | 174 buildername = 'Win7 Tester' |
185 bot_config = api.webrtc.BUILDERS[mastername]['builders'][buildername] | 175 yield generate_builder(mastername, buildername, revision=None, |
186 yield generate_builder(mastername, buildername, bot_config, revision=None, | |
187 parent_got_revision='12345', | 176 parent_got_revision='12345', |
188 suffix='_periodic_triggered') | 177 suffix='_periodic_triggered') |
OLD | NEW |