| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from recipe_engine import recipe_api |
| 6 from recipe_engine.types import freeze |
| 7 |
| 8 DEPS = [ |
| 9 'archive', |
| 10 'chromedriver', |
| 11 'chromium', |
| 12 'chromium_android', |
| 13 'commit_position', |
| 14 'depot_tools/bot_update', |
| 15 'depot_tools/gclient', |
| 16 'recipe_engine/platform', |
| 17 'recipe_engine/properties', |
| 18 'recipe_engine/raw_io', |
| 19 ] |
| 20 |
| 21 BUILDERS = freeze({ |
| 22 'Android ChromeDriver Tests Example': { |
| 23 # Whether or not to update the test results log (Android only). |
| 24 'update_log': True, |
| 25 'android_packages': [ |
| 26 'chrome_shell', |
| 27 'chrome_stable', |
| 28 'chrome_beta', |
| 29 'chromedriver_webview_shell', |
| 30 ], |
| 31 }, |
| 32 'Linux ChromeDriver Tests Example': {}, |
| 33 'Mac ChromeDriver Tests Example': {}, |
| 34 'Windows ChromeDriver Tests Example': {}, |
| 35 }) |
| 36 |
| 37 def RunSteps(api): |
| 38 buildername = api.properties['buildername'] |
| 39 builder = BUILDERS[buildername] |
| 40 android_packages = builder.get('android_packages') |
| 41 update_log = builder.get('update_log') |
| 42 |
| 43 api.chromium.set_config('chromium') |
| 44 api.gclient.set_config('chromium') |
| 45 api.bot_update.ensure_checkout(force=True) |
| 46 platform = api.chromedriver.get_chromedriver_platform(bool(android_packages)) |
| 47 |
| 48 commit_position = api.commit_position.parse_revision( |
| 49 api.properties['got_revision_cp']) |
| 50 |
| 51 if platform == 'android': |
| 52 api.chromedriver.download_prebuilts() |
| 53 else: |
| 54 if platform == 'linux64': |
| 55 api.chromedriver.archive_prebuilts(commit_position) |
| 56 |
| 57 passed = api.chromedriver.run_all_tests(android_packages=android_packages) |
| 58 api.chromedriver.archive_server_logs() |
| 59 |
| 60 if platform == 'android': |
| 61 if update_log: |
| 62 api.chromedriver.update_test_results_log( |
| 63 platform, commit_position, passed) |
| 64 elif passed: |
| 65 api.chromedriver.archive_good_build(platform, commit_position) |
| 66 api.chromedriver.maybe_release(platform) |
| 67 |
| 68 def GenTests(api): |
| 69 |
| 70 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) |
| 71 |
| 72 yield ( |
| 73 api.test('%s_basic' % sanitize('Android ChromeDriver')) + |
| 74 api.properties.generic( |
| 75 buildername='Android ChromeDriver Tests Example', |
| 76 slavename='slavename') + |
| 77 api.properties( |
| 78 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 79 got_revision_cp='refs/heads/master@{#3333333333}')) |
| 80 |
| 81 yield ( |
| 82 api.test('%s_basic' % sanitize('Linux64 ChromeDriver')) + |
| 83 api.properties.generic( |
| 84 buildername='Linux ChromeDriver Tests Example', |
| 85 slavename='slavename') + |
| 86 api.properties( |
| 87 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 88 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 89 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 90 api.platform('linux', 64) + |
| 91 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 92 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 93 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 94 '9.98', stream='stdout')) + |
| 95 api.step_data('read results log file', api.raw_io.output( |
| 96 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 97 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 98 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 99 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 100 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 101 stream='stdout'))) |
| 102 |
| 103 yield ( |
| 104 api.test('%s_basic' % sanitize('Linux32 ChromeDriver')) + |
| 105 api.properties.generic( |
| 106 buildername='Linux ChromeDriver Tests Example', |
| 107 slavename='slavename') + |
| 108 api.properties( |
| 109 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 110 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 111 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 112 api.platform('linux', 32) + |
| 113 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 114 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 115 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 116 '9.98', stream='stdout')) + |
| 117 api.step_data('read results log file', api.raw_io.output( |
| 118 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 119 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 120 'test/dir/chromedriver_linux32_9.99.2222222222.zip\n' # Passed tests. |
| 121 'test/dir/chromedriver_linux32_9.99.3333333333.zip\n' # No test data. |
| 122 'test/dir/chromedriver_linux32_9.99.4444444444.zip\n', # Failed tests. |
| 123 stream='stdout'))) |
| 124 |
| 125 yield ( |
| 126 api.test('%s_basic' % sanitize('Windows ChromeDriver')) + |
| 127 api.properties.generic( |
| 128 buildername='Windows ChromeDriver Tests Example', |
| 129 slavename='slavename') + |
| 130 api.properties( |
| 131 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 132 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 133 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 134 api.platform('win', 32) + |
| 135 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 136 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 137 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 138 '9.98', stream='stdout')) + |
| 139 api.step_data('read results log file', api.raw_io.output( |
| 140 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 141 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 142 'test/dir/chromedriver_win32_9.99.2222222222.zip\n' # Passed tests. |
| 143 'test/dir/chromedriver_win32_9.99.3333333333.zip\n' # No test data. |
| 144 'test/dir/chromedriver_win32_9.99.4444444444.zip\n', # Failed tests. |
| 145 stream='stdout'))) |
| 146 |
| 147 yield ( |
| 148 api.test('%s_basic' % sanitize('Mac ChromeDriver')) + |
| 149 api.properties.generic( |
| 150 buildername='Mac ChromeDriver Tests Example', |
| 151 slavename='slavename') + |
| 152 api.properties( |
| 153 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 154 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 155 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 156 api.platform('mac', 32) + |
| 157 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 158 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 159 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 160 '9.98', stream='stdout')) + |
| 161 api.step_data('read results log file', api.raw_io.output( |
| 162 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 163 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 164 'test/dir/chromedriver_mac32_9.99.2222222222.zip\n' # Passed tests. |
| 165 'test/dir/chromedriver_mac32_9.99.3333333333.zip\n' # No test data. |
| 166 'test/dir/chromedriver_mac32_9.99.4444444444.zip\n', # Failed tests. |
| 167 stream='stdout'))) |
| 168 |
| 169 yield ( |
| 170 api.test('%s_commit_revision_exists' % sanitize('Linux64 ChromeDriver')) + |
| 171 api.properties.generic( |
| 172 buildername='Linux ChromeDriver Tests Example', |
| 173 slavename='slavename') + |
| 174 api.properties( |
| 175 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 176 got_revision_cp='refs/heads/master@{#4444444444}') + |
| 177 api.platform('linux', 64) + |
| 178 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 179 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 180 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 181 '9.98', stream='stdout')) + |
| 182 api.step_data('read results log file', api.raw_io.output( |
| 183 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 184 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 185 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 186 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 187 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 188 stream='stdout'))) |
| 189 |
| 190 yield ( |
| 191 api.test('%s_is_latest_release' % sanitize('Linux64 ChromeDriver')) + |
| 192 api.properties.generic( |
| 193 buildername='Linux ChromeDriver Tests Example', |
| 194 slavename='slavename') + |
| 195 api.properties( |
| 196 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 197 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 198 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 199 api.platform('linux', 64) + |
| 200 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 201 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 202 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 203 '9.99', stream='stdout')) + |
| 204 api.step_data('read results log file', api.raw_io.output( |
| 205 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 206 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 207 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 208 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 209 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 210 stream='stdout'))) |
| 211 |
| 212 yield ( |
| 213 api.test('%s_was_already_released' % sanitize('Linux64 ChromeDriver')) + |
| 214 api.properties.generic( |
| 215 buildername='Linux ChromeDriver Tests Example', |
| 216 slavename='slavename') + |
| 217 api.properties( |
| 218 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 219 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 220 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 221 api.platform('linux', 64) + |
| 222 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 223 api.step_data('gsutil list chromedriver versions', retcode=0)) |
| 224 |
| 225 yield ( |
| 226 api.test('%s_test_failures' % sanitize('Linux64 ChromeDriver')) + |
| 227 api.properties.generic( |
| 228 buildername='Linux ChromeDriver Tests Example', |
| 229 slavename='slavename') + |
| 230 api.properties( |
| 231 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 232 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 233 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 234 api.platform('linux', 64) + |
| 235 api.step_data('gsutil get latest revision', api.raw_io.stream_output( |
| 236 '123456', stream='stdout')) + |
| 237 api.step_data('java_tests(v123456)', retcode=1) + |
| 238 api.step_data('chromedriver_tests', retcode=1)) |
| 239 |
| 240 yield ( |
| 241 api.test('%s_test_failures' % sanitize('Android ChromeDriver')) + |
| 242 api.properties.generic( |
| 243 buildername='Android ChromeDriver Tests Example', |
| 244 slavename='slavename') + |
| 245 api.properties( |
| 246 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 247 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 248 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 249 api.platform('linux', 64) + |
| 250 api.step_data('read results log file', api.raw_io.output( |
| 251 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 252 api.step_data('java_tests(chrome_shell)', retcode=1)) |
| 253 |
| 254 yield ( |
| 255 api.test('%s_download_chrome_failure' % sanitize('Linux64 ChromeDriver'))
+ |
| 256 api.properties.generic( |
| 257 buildername='Linux ChromeDriver Tests Example', |
| 258 slavename='slavename') + |
| 259 api.properties( |
| 260 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 261 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 262 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 263 api.platform('linux', 64) + |
| 264 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 265 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 266 api.step_data('read results log file', api.raw_io.output( |
| 267 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 268 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 269 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 270 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 271 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 272 stream='stdout')) + |
| 273 api.step_data('gsutil download chrome', retcode=1)) |
| 274 |
| 275 yield ( |
| 276 api.test('%s_update_test_notes' % sanitize('Linux64 ChromeDriver')) + |
| 277 api.properties.generic( |
| 278 buildername='Linux ChromeDriver Tests Example', |
| 279 slavename='slavename') + |
| 280 api.properties( |
| 281 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 282 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 283 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 284 api.platform('linux', 64) + |
| 285 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 286 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 287 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 288 '9.98', stream='stdout')) + |
| 289 api.step_data('read results log file', api.raw_io.output( |
| 290 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 291 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 292 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 293 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 294 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 295 stream='stdout')) + |
| 296 api.step_data('gsutil list version notes', retcode=1)) |
| 297 |
| 298 yield ( |
| 299 api.test('%s_write_test_notes' % sanitize('Linux64 ChromeDriver')) + |
| 300 api.properties.generic( |
| 301 buildername='Linux ChromeDriver Tests Example', |
| 302 slavename='slavename') + |
| 303 api.properties( |
| 304 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 305 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 306 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 307 api.platform('linux', 64) + |
| 308 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 309 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 310 api.step_data('gsutil check latest release', api.raw_io.stream_output( |
| 311 '9.98', stream='stdout')) + |
| 312 api.step_data('read results log file', api.raw_io.output( |
| 313 '{"2222222222": true, "4444444444": false, "6666666666": true}')) + |
| 314 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 315 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 316 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 317 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 318 stream='stdout')) + |
| 319 api.step_data('gsutil list version notes', retcode=1) + |
| 320 api.step_data('gsutil download prev notes', retcode=1)) |
| 321 |
| 322 yield ( |
| 323 api.test('%s_download_log_failure' % sanitize('Linux64 ChromeDriver')) + |
| 324 api.properties.generic( |
| 325 buildername='Linux ChromeDriver Tests Example', |
| 326 slavename='slavename') + |
| 327 api.properties( |
| 328 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 329 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 330 got_revision_cp='refs/heads/master@{#3333333333}') + |
| 331 api.platform('linux', 64) + |
| 332 api.step_data('read version file', api.raw_io.output('9.99')) + |
| 333 api.step_data('gsutil list chromedriver versions', retcode=1) + |
| 334 api.step_data('gsutil list release candidates', api.raw_io.stream_output( |
| 335 'test/dir/chromedriver_linux64_9.99.2222222222.zip\n' # Passed tests. |
| 336 'test/dir/chromedriver_linux64_9.99.3333333333.zip\n' # No test data. |
| 337 'test/dir/chromedriver_linux64_9.99.4444444444.zip\n', # Failed tests. |
| 338 stream='stdout')) + |
| 339 api.step_data('gsutil download results log', retcode=1)) |
| 340 |
| 341 yield ( |
| 342 api.test('%s_commit_already_logged' % sanitize('Android ChromeDriver')) + |
| 343 api.properties.generic( |
| 344 buildername='Android ChromeDriver Tests Example', |
| 345 slavename='slavename') + |
| 346 api.properties( |
| 347 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 348 got_revision_cp='refs/heads/master@{#2222222222}') + |
| 349 api.step_data('read results log file', api.raw_io.output( |
| 350 '{"2222222222": true}'))) |
| OLD | NEW |