1# Copyright 2017 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 5PYTHON_VERSION_COMPATIBILITY = "PY2+3" 6 7DEPS = [ 8 'checkout', 9 'recipe_engine/file', 10 'recipe_engine/path', 11 'recipe_engine/platform', 12 'recipe_engine/properties', 13 'run', 14 'vars', 15] 16 17 18def RunSteps(api): 19 api.vars.setup() 20 21 bot_update = True 22 if 'NoDEPS' in api.properties['buildername']: 23 bot_update = False 24 25 checkout_root = api.checkout.default_checkout_root 26 checkout_chromium = False 27 checkout_flutter = False 28 extra_gclient_env = {} 29 flutter_android = False 30 if 'CommandBuffer' in api.vars.builder_name: 31 checkout_chromium = True 32 if 'RecreateSKPs' in api.vars.builder_name: 33 checkout_chromium = True 34 extra_gclient_env['CPPFLAGS'] = ( 35 '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1') 36 if 'Flutter' in api.vars.builder_name: 37 checkout_root = checkout_root.join('flutter') 38 checkout_flutter = True 39 if 'Android' in api.vars.builder_name: 40 flutter_android = True 41 42 if bot_update: 43 api.checkout.bot_update( 44 checkout_root=checkout_root, 45 checkout_chromium=checkout_chromium, 46 checkout_flutter=checkout_flutter, 47 extra_gclient_env=extra_gclient_env, 48 flutter_android=flutter_android) 49 else: 50 api.checkout.git(checkout_root=api.path['start_dir']) 51 api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir) 52 53 54TEST_BUILDERS = [ 55 'Build-Mac-Clang-x86_64-Debug-CommandBuffer', 56 'Housekeeper-Weekly-RecreateSKPs', 57] 58 59 60def GenTests(api): 61 for buildername in TEST_BUILDERS: 62 test = ( 63 api.test(buildername) + 64 api.properties(buildername=buildername, 65 repository='https://skia.googlesource.com/skia.git', 66 revision='abc123', 67 path_config='kitchen', 68 swarm_out_dir='[SWARM_OUT_DIR]') 69 ) 70 yield test 71 72 buildername = 'Build-Debian10-Clang-arm-Release-Flutter_Android' 73 yield ( 74 api.test('flutter_trybot') + 75 api.properties( 76 repository='https://skia.googlesource.com/skia.git', 77 buildername=buildername, 78 path_config='kitchen', 79 swarm_out_dir='[SWARM_OUT_DIR]', 80 revision='abc123', 81 patch_issue=456789, 82 patch_set=12, 83 patch_ref='refs/changes/89/456789/12', 84 patch_repo='https://skia.googlesource.com/skia.git', 85 patch_storage='gerrit') + 86 api.path.exists( 87 api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') 88 ) 89 ) 90 91 builder = 'Build-Debian10-Clang-x86_64-Release-NoDEPS' 92 yield ( 93 api.test(builder) + 94 api.properties(buildername=builder, 95 repository='https://skia.googlesource.com/skia.git', 96 revision='abc123', 97 path_config='kitchen', 98 swarm_out_dir='[SWARM_OUT_DIR]', 99 patch_issue=456789, 100 patch_set=12, 101 patch_ref='refs/changes/89/456789/12', 102 patch_repo='https://skia.googlesource.com/skia.git', 103 patch_storage='gerrit') + 104 api.path.exists(api.path['start_dir'].join('skp_output')) 105 ) 106 107 buildername = 'Build-Debian10-Clang-x86_64-Release' 108 yield ( 109 api.test('cross_repo_trybot') + 110 api.properties( 111 repository='https://skia.googlesource.com/parent_repo.git', 112 buildername=buildername, 113 path_config='kitchen', 114 swarm_out_dir='[SWARM_OUT_DIR]', 115 revision='abc123', 116 patch_issue=456789, 117 patch_set=12, 118 patch_ref='refs/changes/89/456789/12', 119 patch_repo='https://skia.googlesource.com/skia.git', 120 patch_storage='gerrit') + 121 api.path.exists( 122 api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') 123 ) 124 ) 125 yield ( 126 api.test('trybot') + 127 api.properties(buildername=buildername, 128 repository='https://skia.googlesource.com/skia.git', 129 revision='abc123', 130 path_config='kitchen', 131 patch_issue=456789, 132 patch_set=12, 133 patch_ref='refs/changes/89/456789/12', 134 patch_repo='https://skia.googlesource.com/skia.git', 135 patch_storage='gerrit', 136 swarm_out_dir='[SWARM_OUT_DIR]') 137 ) 138