• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3# found in the LICENSE file.
4
5
6# Recipe module for Skia Swarming compile.
7
8
9DEPS = [
10  'build',
11  'checkout',
12  'recipe_engine/context',
13  'recipe_engine/file',
14  'recipe_engine/json',
15  'recipe_engine/path',
16  'recipe_engine/platform',
17  'recipe_engine/properties',
18  'recipe_engine/python',
19  'recipe_engine/step',
20  'run',
21  'vars',
22]
23
24
25def RunSteps(api):
26  api.vars.setup()
27
28  checkout_root = api.path['start_dir']
29  out_dir = api.vars.cache_dir.join(
30      'work', 'skia', 'out', api.vars.builder_name, api.vars.configuration)
31
32  try:
33    api.build(checkout_root=checkout_root, out_dir=out_dir)
34
35    # TODO(borenet): Move this out of the try/finally.
36    dst = api.vars.swarming_out_dir
37    api.build.copy_build_products(out_dir=out_dir, dst=dst)
38  finally:
39    if 'Win' in api.vars.builder_cfg.get('os', ''):
40      api.python.inline(
41          name='cleanup',
42          program='''import psutil
43for p in psutil.process_iter():
44  try:
45    if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'):
46      p.kill()
47  except psutil._error.AccessDenied:
48    pass
49''',
50          infra_step=True)
51
52  api.run.check_failure()
53
54
55TEST_BUILDERS = [
56  'Build-Win-Clang-x86-Debug',
57]
58
59
60def GenTests(api):
61  for builder in TEST_BUILDERS:
62    test = (
63      api.test(builder) +
64      api.properties(buildername=builder,
65                     repository='https://skia.googlesource.com/skia.git',
66                     revision='abc123',
67                     path_config='kitchen',
68                     swarm_out_dir='[SWARM_OUT_DIR]') +
69      api.path.exists(
70          api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
71      )
72    )
73    if 'Win' in builder:
74      test += api.platform('win', 64)
75    yield test
76