1# Copyright 2019 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
5from recipe_engine import post_process
6from recipe_engine import recipe_api
7
8
9DEPS = [
10  'gclient',
11  'presubmit',
12  'recipe_engine/buildbucket',
13  'recipe_engine/context',
14  'recipe_engine/path',
15  'recipe_engine/properties',
16  'recipe_engine/runtime',
17]
18
19
20PROPERTIES = {
21  'patch_project': recipe_api.Property(None),
22  'patch_repository_url': recipe_api.Property(None),
23}
24
25
26def RunSteps(api, patch_project, patch_repository_url):
27  api.gclient.set_config('infra')
28  with api.context(cwd=api.path['cache'].join('builder')):
29    bot_update_step = api.presubmit.prepare()
30
31
32def GenTests(api):
33  yield (api.test('basic') + api.runtime(is_experimental=False) +
34         api.buildbucket.try_build(project='infra') +
35         api.post_process(post_process.StatusSuccess) +
36         api.post_process(post_process.DropExpectation))
37
38  yield (api.test('runhooks') + api.runtime(is_experimental=False) +
39         api.buildbucket.try_build(project='infra') +
40         api.presubmit(runhooks=True) +
41         api.post_process(post_process.MustRun, 'gclient runhooks') +
42         api.post_process(post_process.StatusSuccess) +
43         api.post_process(post_process.DropExpectation))
44