Chromium Code Reviews| Index: scripts/slave/recipe_modules/chromedriver/example.py |
| diff --git a/scripts/slave/recipe_modules/chromedriver/example.py b/scripts/slave/recipe_modules/chromedriver/example.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7ad1985f23600a1bc0faa81a18ec63e40de4dbe5 |
| --- /dev/null |
| +++ b/scripts/slave/recipe_modules/chromedriver/example.py |
| @@ -0,0 +1,290 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from infra.libs.infra_types import freeze |
| +from recipe_engine import recipe_api |
| + |
| +DEPS = [ |
| + 'archive', |
| + 'bot_update', |
| + 'chromedriver', |
| + 'chromium', |
| + 'chromium_android', |
| + 'commit_position', |
| + 'gclient', |
| + 'platform', |
| + 'properties', |
| + 'raw_io', |
| +] |
| + |
| +BUILDERS = freeze({ |
| + 'chromium.fyi': { |
| + 'Android ChromeDriver Tests (dbg)': { |
|
luqui
2015/08/06 20:52:58
This looks like a real recipe that you're planning
mikecase (-- gone --)
2016/04/04 21:46:42
Changed this example to look less like an actual r
|
| + # Whether or not to update the test results log (Android only). |
| + 'update_log': True, |
| + 'android_packages': [ |
| + 'chrome_shell', |
| + 'chrome_stable', |
| + 'chrome_beta', |
| + 'chromedriver_webview_shell', |
| + ], |
| + }, |
| + 'Linux ChromeDriver Tests (dbg)': {}, |
| + 'Mac ChromeDriver Tests (dbg)': {}, |
| + 'Windows ChromeDriver Tests (dbg)': {}, |
| + }, |
| +}) |
| + |
| +REPO_URL = 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src' |
|
luqui
2015/08/06 20:52:58
Aren't we on git now?
mikecase (-- gone --)
2016/04/04 21:46:42
Yes, seems like I had copied the url from
build/s
|
| + |
| +def RunSteps(api): |
| + mastername = api.properties['mastername'] |
| + buildername = api.properties['buildername'] |
| + builder = BUILDERS[mastername][buildername] |
| + android_packages = builder.get('android_packages') |
| + update_log = builder.get('update_log') |
| + |
| + api.chromium.set_config('chromium') |
| + api.gclient.set_config('chromium') |
| + api.bot_update.ensure_checkout(force=True) |
| + platform = api.chromedriver.get_chromedriver_platform(bool(android_packages)) |
| + |
| + commit_position = api.commit_position.parse_revision( |
| + api.properties['got_revision_cp']) |
| + |
| + if platform == 'android': |
| + api.chromedriver.download_prebuilts() |
| + else: |
| + if platform == 'linux64': |
| + api.chromedriver.archive_prebuilts(commit_position) |
| + api.chromedriver.wait_for_latest_snapshot(commit_position) |
| + |
| + passed = api.chromedriver.run_all_tests(android_packages=android_packages) |
| + api.chromedriver.archive_server_logs() |
| + |
| + if platform == 'android': |
| + if update_log: |
| + api.chromedriver.update_test_results_log( |
| + platform, commit_position, passed) |
| + elif passed: |
| + api.chromedriver.archive_good_build(platform, commit_position) |
| + api.chromedriver.maybe_release(platform) |
| + |
| +def GenTests(api): |
| + |
| + sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) |
| + |
| + yield ( |
| + api.test('%s_basic' % sanitize('Android ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Android ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision_cp='refs/heads/master@{#333333}')) |
| + |
| + yield ( |
| + api.test('%s_basic' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64)) |
| + |
| + yield ( |
| + api.test('%s_basic' % sanitize('Linux32 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 32)) |
| + |
| + yield ( |
| + api.test('%s_basic' % sanitize('Windows ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Windows ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('win', 32)) |
| + |
| + yield ( |
| + api.test('%s_basic' % sanitize('Mac ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Mac ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('mac', 32)) |
| + |
| + yield ( |
| + api.test('%s_download_log_failure' % sanitize('Android ChromeDriver')) + |
| + api.properties.generic( |
| + buildername='Android ChromeDriver Tests (dbg)', |
| + slavename='slavename', |
| + mastername='chromium.fyi') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.step_data('gsutil download results log', retcode=1)) |
| + |
| + yield ( |
| + api.test('%s_release_chromedriver' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1)) |
| + |
| + release_candidate_list = '\n'.join([ |
| + 'test/dir/chromedriver_linux64_1.11.000000.zip', |
| + 'test/dir/chromedriver_linux64_9.99.111111.zip', |
| + 'test/dir/chromedriver_linux64_9.99.222222.zip', |
| + 'test/dir/chromedriver_linux64_9.99.333333.zip', |
| + 'test/dir/chromedriver_linux64_9.99.444444.zip', |
| + 'test/dir/chromedriver_linux64_9.99.555555.zip']) |
| + test_results = '{"222222": false, "444444": false}' |
| + yield ( |
| + api.test('%s_release_with_failures' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1) + |
| + api.override_step_data( |
| + 'gsutil list release candidates', |
| + api.raw_io.stream_output(release_candidate_list)) + |
| + api.override_step_data( |
| + 'read results log file', |
| + api.raw_io.output(test_results))) |
| + |
| + yield ( |
| + api.test('%s_write_test_notes' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1) + |
| + api.step_data('gsutil list version notes', retcode=1) + |
| + api.step_data('gsutil download prev notes', retcode=1)) |
| + |
| + yield ( |
| + api.test('%s_update_test_notes' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1) + |
| + api.step_data('gsutil list version notes', retcode=1)) |
| + |
| + yield ( |
| + api.test('%s_download_chrome_failure' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil download chrome', retcode=1)) |
| + |
| + |
| + yield ( |
| + api.test('%s_is_latest_chromedriver' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1) + |
| + api.override_step_data( |
| + 'gsutil check latest release', api.raw_io.stream_output('9.99')) + |
| + api.override_step_data( |
| + 'read version file', api.raw_io.output('9.99'))) |
| + |
| + yield ( |
| + api.test('%s_infer_test_passing' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('gsutil list chromedriver versions', retcode=1) + |
| + api.override_step_data( |
| + 'gsutil list release candidates', |
| + api.raw_io.stream_output( |
| + 'test/dir/chromedriver_linux64_9.99.333333.zip')) + |
| + api.override_step_data( |
| + 'read results log file', |
| + api.raw_io.output('{"222222": true, "444444": true}'))) |
| + |
| + yield ( |
| + api.test('%s_test_failures' % sanitize('Linux64 ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Linux ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.platform('linux', 64) + |
| + api.step_data('java_tests(v444444)', retcode=1) + |
| + api.step_data('chromedriver_tests', retcode=1)) |
| + |
| + yield ( |
| + api.test('%s_test_failures' % sanitize('Android ChromeDriver')) + |
| + api.properties.generic( |
| + mastername='chromium.fyi', |
| + buildername='Android ChromeDriver Tests (dbg)', |
| + slavename='slavename') + |
| + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip', |
| + got_revision_cp='refs/heads/master@{#333333}') + |
| + api.step_data('java_tests(chrome_shell)', retcode=1)) |