| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 """Rolls recipes.cfg dependencies.""" | 5 """Rolls recipes.cfg dependencies.""" |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'recipe_tryjob', | 8 'recipe_tryjob', |
| 9 'luci_config', | 9 'luci_config', |
| 10 'recipe_engine/json', |
| 10 'recipe_engine/properties', | 11 'recipe_engine/properties', |
| 11 'recipe_engine/raw_io', | 12 'recipe_engine/raw_io', |
| 12 'recipe_engine/step', | 13 'recipe_engine/step', |
| 13 ] | 14 ] |
| 14 | 15 |
| 15 from recipe_engine.recipe_api import Property | 16 from recipe_engine.recipe_api import Property |
| 16 | 17 |
| 17 | 18 |
| 18 def get_auth_token(api, service_account=None): | 19 def get_auth_token(api, service_account=None): |
| 19 """ | 20 """ |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 yield ( | 105 yield ( |
| 105 api.test('one_patch') + | 106 api.test('one_patch') + |
| 106 api.luci_config.get_projects(('recipe_engine', 'build')) + | 107 api.luci_config.get_projects(('recipe_engine', 'build')) + |
| 107 api.luci_config.get_project_config( | 108 api.luci_config.get_project_config( |
| 108 'build', 'recipes.cfg', | 109 'build', 'recipes.cfg', |
| 109 api.recipe_tryjob.make_recipe_config('build')) + | 110 api.recipe_tryjob.make_recipe_config('build')) + |
| 110 api.luci_config.get_project_config( | 111 api.luci_config.get_project_config( |
| 111 'recipe_engine', 'recipes.cfg', | 112 'recipe_engine', 'recipes.cfg', |
| 112 api.recipe_tryjob.make_recipe_config('recipe_engine')) + | 113 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 113 api.properties(patches="build:https://fake.code.review/123456#ps1") | 114 api.properties(patches="build:https://fake.code.review/123456#ps1") + |
| 115 api.override_step_data( |
| 116 'git_cl description (build)', stdout=api.raw_io.output( |
| 117 "")) + |
| 118 api.override_step_data( |
| 119 'parse description', api.json.output( |
| 120 {})) |
| 114 ) | 121 ) |
| 115 | 122 |
| 116 yield ( | 123 yield ( |
| 124 api.test('three_patches') + |
| 125 api.luci_config.get_projects(('recipe_engine', 'build', 'depot_tools')) + |
| 126 api.luci_config.get_project_config( |
| 127 'build', 'recipes.cfg', |
| 128 api.recipe_tryjob.make_recipe_config( |
| 129 'build', ['depot_tools', 'recipe_engine'])) + |
| 130 api.luci_config.get_project_config( |
| 131 'recipe_engine', 'recipes.cfg', |
| 132 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 133 api.luci_config.get_project_config( |
| 134 'depot_tools', 'recipes.cfg', |
| 135 api.recipe_tryjob.make_recipe_config( |
| 136 'depot_tools', ['recipe_engine'])) + |
| 137 api.properties( |
| 138 patches="depot_tools:https://fake.code.review/123456#ps1," |
| 139 "build:https://fake.code.review/789999#ps2") + |
| 140 api.override_step_data( |
| 141 'git_cl description (build)', stdout=api.raw_io.output( |
| 142 "")) + |
| 143 api.override_step_data( |
| 144 'git_cl description (depot_tools)', stdout=api.raw_io.output( |
| 145 "")) + |
| 146 api.override_step_data( |
| 147 'parse description', api.json.output( |
| 148 {})) + |
| 149 api.override_step_data( |
| 150 'parse description (2)', api.json.output( |
| 151 {})) |
| 152 ) |
| 153 |
| 154 yield ( |
| 155 api.test('three_patches_fail_not_ok') + |
| 156 api.luci_config.get_projects(('recipe_engine', 'build', 'depot_tools')) + |
| 157 api.luci_config.get_project_config( |
| 158 'build', 'recipes.cfg', |
| 159 api.recipe_tryjob.make_recipe_config( |
| 160 'build', ['depot_tools', 'recipe_engine'])) + |
| 161 api.luci_config.get_project_config( |
| 162 'recipe_engine', 'recipes.cfg', |
| 163 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 164 api.luci_config.get_project_config( |
| 165 'depot_tools', 'recipes.cfg', |
| 166 api.recipe_tryjob.make_recipe_config( |
| 167 'depot_tools', ['recipe_engine'])) + |
| 168 api.properties( |
| 169 patches="depot_tools:https://fake.code.review/123456#ps1," |
| 170 "build:https://fake.code.review/789999#ps2") + |
| 171 api.override_step_data( |
| 172 'git_cl description (build)', stdout=api.raw_io.output( |
| 173 "")) + |
| 174 api.override_step_data( |
| 175 'git_cl description (depot_tools)', stdout=api.raw_io.output( |
| 176 "")) + |
| 177 api.override_step_data( |
| 178 'parse description', api.json.output( |
| 179 {})) + |
| 180 api.override_step_data( |
| 181 'parse description (2)', api.json.output( |
| 182 {})) + |
| 183 api.override_step_data("build tests", retcode=1) |
| 184 ) |
| 185 |
| 186 yield ( |
| 187 api.test('three_patches_fail_ok') + |
| 188 api.luci_config.get_projects(('recipe_engine', 'build', 'depot_tools')) + |
| 189 api.luci_config.get_project_config( |
| 190 'build', 'recipes.cfg', |
| 191 api.recipe_tryjob.make_recipe_config( |
| 192 'build', ['depot_tools', 'recipe_engine'])) + |
| 193 api.luci_config.get_project_config( |
| 194 'recipe_engine', 'recipes.cfg', |
| 195 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 196 api.luci_config.get_project_config( |
| 197 'depot_tools', 'recipes.cfg', |
| 198 api.recipe_tryjob.make_recipe_config( |
| 199 'depot_tools', ['recipe_engine'])) + |
| 200 api.properties( |
| 201 patches="depot_tools:https://fake.code.review/123456#ps1," |
| 202 "build:https://fake.code.review/789999#ps2") + |
| 203 api.override_step_data( |
| 204 'git_cl description (build)', stdout=api.raw_io.output( |
| 205 "foo")) + |
| 206 api.override_step_data( |
| 207 'git_cl description (depot_tools)', stdout=api.raw_io.output( |
| 208 "Recipe-Tryjob-Bypass-Reason: best reason")) + |
| 209 api.override_step_data( |
| 210 'parse description', api.json.output( |
| 211 {'Recipe-Tryjob-Bypass-Reason': ['Best Reason']})) + |
| 212 api.override_step_data( |
| 213 'parse description (2)', api.json.output( |
| 214 {'Recipe-Tryjob-Bypass-Reason': []})) + |
| 215 api.override_step_data("build tests", retcode=1) |
| 216 ) |
| 217 |
| 218 yield ( |
| 117 api.test('bad_patches') + | 219 api.test('bad_patches') + |
| 118 api.properties( | 220 api.properties( |
| 119 patches="build:https://f.e.w/1#ps1,build:https://f.e.w/1#ps1") | 221 patches="build:https://f.e.w/1#ps1,build:https://f.e.w/1#ps1") |
| 120 ) | 222 ) |
| 121 | 223 |
| 122 yield ( | 224 yield ( |
| 123 api.test('deps') + | 225 api.test('deps') + |
| 124 api.luci_config.get_projects(('recipe_engine', 'build')) + | 226 api.luci_config.get_projects(('recipe_engine', 'build')) + |
| 125 api.luci_config.get_project_config( | 227 api.luci_config.get_project_config( |
| 126 'build', 'recipes.cfg', | 228 'build', 'recipes.cfg', |
| 127 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + | 229 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + |
| 128 api.luci_config.get_project_config( | 230 api.luci_config.get_project_config( |
| 129 'recipe_engine', 'recipes.cfg', | 231 'recipe_engine', 'recipes.cfg', |
| 130 api.recipe_tryjob.make_recipe_config('recipe_engine')) + | 232 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 131 api.properties( | 233 api.properties( |
| 132 patches="recipe_engine:https://fake.code.review/123456#ps1") | 234 patches="recipe_engine:https://fake.code.review/123456#ps1") + |
| 235 api.override_step_data( |
| 236 'parse description', api.json.output({})) + |
| 237 api.override_step_data( |
| 238 'git_cl description (recipe_engine)', stdout=api.raw_io.output( |
| 239 "foo")) |
| 133 ) | 240 ) |
| 134 | 241 |
| 135 yield ( | 242 yield ( |
| 136 api.test('tryjob') + | 243 api.test('tryjob') + |
| 137 api.properties( | 244 api.properties( |
| 138 rietveld="https://fake.code.review", | 245 rietveld="https://fake.code.review", |
| 139 issue='12345678', | 246 issue='12345678', |
| 140 patchset='1', | 247 patchset='1', |
| 141 patch_project="build", | 248 patch_project="build", |
| 142 ) + | 249 ) + |
| 143 api.luci_config.get_projects(('recipe_engine', 'build')) + | 250 api.luci_config.get_projects(('recipe_engine', 'build')) + |
| 144 api.luci_config.get_project_config( | 251 api.luci_config.get_project_config( |
| 145 'build', 'recipes.cfg', | 252 'build', 'recipes.cfg', |
| 146 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + | 253 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + |
| 147 api.luci_config.get_project_config( | 254 api.luci_config.get_project_config( |
| 148 'recipe_engine', 'recipes.cfg', | 255 'recipe_engine', 'recipes.cfg', |
| 149 api.recipe_tryjob.make_recipe_config('recipe_engine')) | 256 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 257 api.override_step_data( |
| 258 'git_cl description (build)', stdout=api.raw_io.output( |
| 259 "")) + |
| 260 api.override_step_data( |
| 261 'parse description', api.json.output( |
| 262 {})) |
| 150 ) | 263 ) |
| 151 | 264 |
| 152 yield ( | 265 yield ( |
| 153 api.test('tryjob_dont_test_untouched_code') + | 266 api.test('tryjob_dont_test_untouched_code') + |
| 154 api.properties( | 267 api.properties( |
| 155 rietveld="https://fake.code.review", | 268 rietveld="https://fake.code.review", |
| 156 issue='12345678', | 269 issue='12345678', |
| 157 patchset='1', | 270 patchset='1', |
| 158 patch_project="build", | 271 patch_project="build", |
| 159 ) + | 272 ) + |
| 160 api.luci_config.get_projects(('recipe_engine', 'build', 'foobar')) + | 273 api.luci_config.get_projects(('recipe_engine', 'build', 'foobar')) + |
| 161 api.luci_config.get_project_config( | 274 api.luci_config.get_project_config( |
| 162 'build', 'recipes.cfg', | 275 'build', 'recipes.cfg', |
| 163 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + | 276 api.recipe_tryjob.make_recipe_config('build', ['recipe_engine'])) + |
| 164 api.luci_config.get_project_config( | 277 api.luci_config.get_project_config( |
| 165 'recipe_engine', 'recipes.cfg', | 278 'recipe_engine', 'recipes.cfg', |
| 166 api.recipe_tryjob.make_recipe_config('recipe_engine')) | 279 api.recipe_tryjob.make_recipe_config('recipe_engine')) + |
| 280 api.override_step_data( |
| 281 'git_cl description (build)', stdout=api.raw_io.output( |
| 282 "")) + |
| 283 api.override_step_data( |
| 284 'parse description', api.json.output( |
| 285 {})) |
| 167 ) | 286 ) |
| 168 | 287 |
| OLD | NEW |