| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 import collections | 5 import collections |
| 6 import hashlib | 6 import hashlib |
| 7 import json | 7 import json |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 from recipe_engine import recipe_api | 10 from recipe_engine import recipe_api |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 Returns: | 172 Returns: |
| 173 Path to repo on disk. | 173 Path to repo on disk. |
| 174 """ | 174 """ |
| 175 checkout_path = root_dir.join(proj) | 175 checkout_path = root_dir.join(proj) |
| 176 repo_path = checkout_path.join(proj) | 176 repo_path = checkout_path.join(proj) |
| 177 self.m.file.makedirs('%s directory' % proj, repo_path) | 177 self.m.file.makedirs('%s directory' % proj, repo_path) |
| 178 | 178 |
| 179 # Not working yet, but maybe?? | 179 # Not working yet, but maybe?? |
| 180 #api.file.rmtree('clean old %s repo' % proj, checkout_path) | 180 #api.file.rmtree('clean old %s repo' % proj, checkout_path) |
| 181 | 181 |
| 182 config = self.m.gclient.make_config( | 182 config = self.m.gclient.make_config(CACHE_DIR=root_dir.join("__cache_dir")) |
| 183 GIT_MODE=True, CACHE_DIR=root_dir.join("__cache_dir")) | |
| 184 soln = config.solutions.add() | 183 soln = config.solutions.add() |
| 185 soln.name = proj | 184 soln.name = proj |
| 186 soln.url = proj_config['repo_url'] | 185 soln.url = proj_config['repo_url'] |
| 187 | 186 |
| 188 kwargs = { | 187 kwargs = { |
| 189 'suffix': proj, | 188 'suffix': proj, |
| 190 'gclient_config': config, | 189 'gclient_config': config, |
| 191 'force': True, | 190 'force': True, |
| 192 'cwd': checkout_path, | 191 'cwd': checkout_path, |
| 193 } | 192 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 '-u', script] + args, **kwargs) | 259 '-u', script] + args, **kwargs) |
| 261 | 260 |
| 262 def run_tryjob(self, patches_raw, rietveld, issue, patchset, patch_project): | 261 def run_tryjob(self, patches_raw, rietveld, issue, patchset, patch_project): |
| 263 patches = parse_patches( | 262 patches = parse_patches( |
| 264 self.m.python.failing_step, patches_raw, rietveld, issue, patchset, | 263 self.m.python.failing_step, patches_raw, rietveld, issue, patchset, |
| 265 patch_project) | 264 patch_project) |
| 266 | 265 |
| 267 root_dir = self.m.path['slave_build'] | 266 root_dir = self.m.path['slave_build'] |
| 268 | 267 |
| 269 # Needed to set up the infra checkout, for _python | 268 # Needed to set up the infra checkout, for _python |
| 270 self.m.gclient.set_config('infra', GIT_MODE=True) | 269 self.m.gclient.set_config('infra') |
| 271 self.m.gclient.c.solutions[0].revision = 'origin/master' | 270 self.m.gclient.c.solutions[0].revision = 'origin/master' |
| 272 self.m.gclient.checkout() | 271 self.m.gclient.checkout() |
| 273 self.m.gclient.runhooks() | 272 self.m.gclient.runhooks() |
| 274 | 273 |
| 275 url_mapping = self.m.luci_config.get_projects() | 274 url_mapping = self.m.luci_config.get_projects() |
| 276 | 275 |
| 277 # TODO(martiniss): use luci-config smarter; get recipes.cfg directly, rather | 276 # TODO(martiniss): use luci-config smarter; get recipes.cfg directly, rather |
| 278 # than in two steps. | 277 # than in two steps. |
| 279 # luci config project name to recipe config namedtuple | 278 # luci config project name to recipe config namedtuple |
| 280 recipe_configs = {} | 279 recipe_configs = {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 'no reference builder; file a bug to get one?'] = ( | 311 'no reference builder; file a bug to get one?'] = ( |
| 313 FILE_BUG_FOR_CONTINUOUS_LINK) | 312 FILE_BUG_FOR_CONTINUOUS_LINK) |
| 314 | 313 |
| 315 | 314 |
| 316 if bad_projects: | 315 if bad_projects: |
| 317 raise recipe_api.StepFailure( | 316 raise recipe_api.StepFailure( |
| 318 "One or more projects failed tests: %s" % ( | 317 "One or more projects failed tests: %s" % ( |
| 319 ','.join(bad_projects))) | 318 ','.join(bad_projects))) |
| 320 | 319 |
| 321 | 320 |
| OLD | NEW |