• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 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
5
6# Recipe for the Skia PerCommit Housekeeper.
7
8
9import calendar
10
11PYTHON_VERSION_COMPATIBILITY = "PY2+3"
12
13DEPS = [
14  'checkout',
15  'doxygen',
16  'recipe_engine/file',
17  'recipe_engine/path',
18  'recipe_engine/properties',
19  'run',
20  'vars',
21]
22
23
24def RunSteps(api):
25  # Checkout, compile, etc.
26  api.vars.setup()
27  checkout_root = api.checkout.default_checkout_root
28  api.checkout.bot_update(checkout_root=checkout_root)
29  api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir)
30
31  # TODO(borenet): Detect static initializers?
32
33  skia_dir = checkout_root.join('skia')
34  if not api.vars.is_trybot:
35    api.doxygen.generate_and_upload(skia_dir)
36
37
38def GenTests(api):
39  yield (
40      api.test('Housekeeper-PerCommit') +
41      api.properties(buildername='Housekeeper-PerCommit',
42                     repository='https://skia.googlesource.com/skia.git',
43                     revision='abc123',
44                     path_config='kitchen',
45                     swarm_out_dir='[SWARM_OUT_DIR]') +
46      api.path.exists(api.path['start_dir'])
47  )
48  yield (
49      api.test('Housekeeper-PerCommit-Trybot') +
50      api.properties(buildername='Housekeeper-PerCommit',
51                     repository='https://skia.googlesource.com/skia.git',
52                     revision='abc123',
53                     path_config='kitchen',
54                     patch_issue='456789',
55                     patch_set='11',
56                     patch_ref='refs/changes/89/456789/12',
57                     patch_repo='https://skia.googlesource.com/skia.git',
58                     patch_storage='gerrit',
59                     swarm_out_dir='[SWARM_OUT_DIR]') +
60      api.path.exists(api.path['start_dir'])
61  )
62