• 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
8DEPS = [
9  'recipe_engine/path',
10  'recipe_engine/properties',
11  'recipe_engine/python',
12  'recipe_engine/step',
13  'core',
14  'run',
15  'vars',
16]
17
18
19TEST_BUILDERS = {
20  'client.skia.fyi': {
21    'skiabot-linux-housekeeper-000': [
22      'Housekeeper-PerCommit',
23      'Housekeeper-PerCommit-Trybot',
24    ],
25  },
26}
27
28
29def RunSteps(api):
30  # Checkout, compile, etc.
31  api.core.setup()
32
33  cwd = api.path['checkout']
34
35  # TODO(borenet): Detect static initializers?
36
37  with api.step.context({'cwd': cwd}):
38    gsutil_path = api.path['depot_tools'].join('gsutil.py')
39    if not api.vars.is_trybot:
40      api.run(
41        api.step,
42        'generate and upload doxygen',
43        cmd=['python', api.core.resource('generate_and_upload_doxygen.py')],
44        abort_on_failure=False)
45
46    cmd = ['python', api.core.resource('run_binary_size_analysis.py'),
47           '--library', api.vars.skia_out.join(
48               'Release', 'lib', 'libskia.so'),
49           '--githash', api.properties['revision'],
50           '--gsutil_path', gsutil_path]
51    if api.vars.is_trybot:
52      cmd.extend(['--issue_number', str(api.properties['patch_issue'])])
53    api.run(
54      api.step,
55      'generate and upload binary size data',
56      cmd=cmd,
57      abort_on_failure=False)
58
59
60def GenTests(api):
61  yield (
62      api.test('Housekeeper-PerCommit') +
63      api.properties(buildername='Housekeeper-PerCommit',
64                     mastername='client.skia.fyi',
65                     slavename='skiabot-linux-housekeeper-000',
66                     buildnumber=5,
67                     repository='https://skia.googlesource.com/skia.git',
68                     revision='abc123',
69                     path_config='kitchen',
70                     swarm_out_dir='[SWARM_OUT_DIR]') +
71      api.path.exists(api.path['start_dir'])
72  )
73  yield (
74      api.test('Housekeeper-PerCommit-Trybot') +
75      api.properties(buildername='Housekeeper-PerCommit',
76                     mastername='client.skia.fyi',
77                     slavename='skiabot-linux-housekeeper-000',
78                     buildnumber=5,
79                     repository='https://skia.googlesource.com/skia.git',
80                     revision='abc123',
81                     path_config='kitchen',
82                     patch_storage='gerrit',
83                     nobuildbot='True',
84                     swarm_out_dir='[SWARM_OUT_DIR]') +
85      api.properties.tryserver(
86          buildername='Housekeeper-PerCommit',
87          gerrit_project='skia',
88          gerrit_url='https://skia-review.googlesource.com/',
89      ) +
90      api.path.exists(api.path['start_dir'])
91  )
92