• 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# Example recipe w/ coverage.
7
8
9DEPS = [
10  'recipe_engine/path',
11  'recipe_engine/platform',
12  'recipe_engine/properties',
13  'recipe_engine/raw_io',
14  'sktest',
15]
16
17
18TEST_BUILDERS = {
19  'client.skia': {
20    'skiabot-linux-swarm-000': [
21      'Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android',
22      'Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-GN_Android',
23      'Test-Android-Clang-GalaxyJ5-GPU-Adreno306-arm-Release-Android',
24      'Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-Android',
25      'Test-Android-Clang-GalaxyS7_G930A-GPU-Adreno530-arm64-Debug-Android',
26      'Test-Android-Clang-GalaxyTab3-GPU-Vivante-arm-Debug-Android',
27      'Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-GN_Android',
28      'Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-GN_Android',
29      'Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-Android',
30      'Test-Android-Clang-Nexus6-GPU-Adreno420-arm-Debug-GN_Android',
31      'Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-GN_Android_Vulkan',
32      'Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-GN_Android',
33      'Test-Android-Clang-NexusPlayer-CPU-SSE4-x86-Release-GN_Android',
34      ('Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-'
35       'GN_Android_Vulkan'),
36      'Test-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android',
37      'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug',
38      'Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug',
39      'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer',
40      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug',
41      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug',
42      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN',
43      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
44      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared',
45      'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
46      'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
47      ('Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind' +
48       '_AbandonGpuContext'),
49      ('Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind' +
50       '_PreAbandonGpuContext'),
51      'Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan',
52      'Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Release',
53      'Test-Ubuntu16-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug',
54      'Test-Ubuntu16-Clang-NUCDE3815TYKHE-GPU-IntelBayTrail-x86_64-Debug',
55      'Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan',
56      'Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-ANGLE',
57      'Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan',
58      'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan',
59      'Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-Vulkan',
60      'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot',
61      'Test-Win8-MSVC-ShuttleB-GPU-GTX960-x86_64-Debug-ANGLE',
62      'Test-iOS-Clang-iPadMini4-GPU-GX6450-arm-Release',
63      ('Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_' +
64        'SCALEDIMAGECACHE'),
65    ],
66  },
67}
68
69
70def RunSteps(api):
71  api.sktest.run()
72
73
74def GenTests(api):
75  for mastername, slaves in TEST_BUILDERS.iteritems():
76    for slavename, builders_by_slave in slaves.iteritems():
77      for builder in builders_by_slave:
78        test = (
79          api.test(builder) +
80          api.properties(buildername=builder,
81                         mastername=mastername,
82                         slavename=slavename,
83                         buildnumber=5,
84                         revision='abc123',
85                         path_config='kitchen',
86                         swarm_out_dir='[SWARM_OUT_DIR]') +
87          api.path.exists(
88              api.path['start_dir'].join('skia'),
89              api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
90                                           'skimage', 'VERSION'),
91              api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
92                                           'skp', 'VERSION'),
93              api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
94                                           'svg', 'VERSION'),
95              api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
96          )
97        )
98        if 'Trybot' in builder:
99          test += api.properties(issue=500,
100                                 patchset=1,
101                                 rietveld='https://codereview.chromium.org')
102        if 'Win' in builder:
103          test += api.platform('win', 64)
104
105
106        yield test
107
108  builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
109  yield (
110    api.test('failed_dm') +
111    api.properties(buildername=builder,
112                   mastername='client.skia',
113                   slavename='skiabot-linux-swarm-000',
114                   buildnumber=6,
115                   revision='abc123',
116                   path_config='kitchen',
117                   swarm_out_dir='[SWARM_OUT_DIR]') +
118    api.path.exists(
119        api.path['start_dir'].join('skia'),
120        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
121                                     'skimage', 'VERSION'),
122        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
123                                     'skp', 'VERSION'),
124        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
125                                     'svg', 'VERSION'),
126        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
127    ) +
128    api.step_data('symbolized dm', retcode=1)
129  )
130
131  builder = 'Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-GN_Android'
132  yield (
133    api.test('failed_get_hashes') +
134    api.properties(buildername=builder,
135                   mastername='client.skia',
136                   slavename='skiabot-linux-swarm-000',
137                   buildnumber=6,
138                   revision='abc123',
139                   path_config='kitchen',
140                   swarm_out_dir='[SWARM_OUT_DIR]') +
141    api.path.exists(
142        api.path['start_dir'].join('skia'),
143        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
144                                     'skimage', 'VERSION'),
145        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
146                                     'skp', 'VERSION'),
147        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
148                                     'svg', 'VERSION'),
149        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
150    ) +
151    api.step_data('get uninteresting hashes', retcode=1)
152  )
153
154  builder = 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot'
155  yield (
156    api.test('big_issue_number') +
157    api.properties(buildername=builder,
158                     mastername='client.skia.compile',
159                     slavename='skiabot-linux-swarm-000',
160                     buildnumber=5,
161                     revision='abc123',
162                     path_config='kitchen',
163                     swarm_out_dir='[SWARM_OUT_DIR]',
164                     rietveld='https://codereview.chromium.org',
165                     patchset=1,
166                     issue=2147533002L) +
167    api.path.exists(
168        api.path['start_dir'].join('skia'),
169        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
170                                     'skimage', 'VERSION'),
171        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
172                                     'skp', 'VERSION'),
173        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
174                                     'svg', 'VERSION'),
175        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
176    ) +
177    api.platform('win', 64)
178  )
179
180  builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot'
181  yield (
182      api.test('recipe_with_gerrit_patch') +
183      api.properties(
184          buildername=builder,
185          mastername='client.skia',
186          slavename='skiabot-linux-swarm-000',
187          buildnumber=5,
188          path_config='kitchen',
189          swarm_out_dir='[SWARM_OUT_DIR]',
190          revision='abc123',
191          patch_storage='gerrit') +
192      api.properties.tryserver(
193          buildername=builder,
194          gerrit_project='skia',
195          gerrit_url='https://skia-review.googlesource.com/',
196      )
197  )
198
199  yield (
200      api.test('nobuildbot') +
201      api.properties(
202          buildername=builder,
203          mastername='client.skia',
204          slavename='skiabot-linux-swarm-000',
205          buildnumber=5,
206          path_config='kitchen',
207          swarm_out_dir='[SWARM_OUT_DIR]',
208          revision='abc123',
209          nobuildbot='True',
210          patch_storage='gerrit') +
211      api.properties.tryserver(
212          buildername=builder,
213          gerrit_project='skia',
214          gerrit_url='https://skia-review.googlesource.com/',
215      ) +
216      api.step_data('get swarming bot id',
217          stdout=api.raw_io.output('skia-bot-123')) +
218      api.step_data('get swarming task id', stdout=api.raw_io.output('123456'))
219  )
220
221  builder = 'Test-Android-Clang-NexusPlayer-CPU-SSE4-x86-Debug-GN_Android'
222  yield (
223    api.test('failed_push') +
224    api.properties(buildername=builder,
225                   mastername='client.skia',
226                   slavename='skiabot-linux-swarm-000',
227                   buildnumber=6,
228                   revision='abc123',
229                   path_config='kitchen',
230                   swarm_out_dir='[SWARM_OUT_DIR]') +
231    api.path.exists(
232        api.path['start_dir'].join('skia'),
233        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
234                                     'skimage', 'VERSION'),
235        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
236                                     'skp', 'VERSION'),
237        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
238                                     'svg', 'VERSION'),
239        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
240    ) +
241    api.step_data('push [START_DIR]/skia/resources/* '+
242                  '/sdcard/revenge_of_the_skiabot/resources', retcode=1)
243  )
244
245  builder = 'Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Debug-Android'
246  yield (
247    api.test('failed_pull') +
248    api.properties(buildername=builder,
249                   mastername='client.skia',
250                   slavename='skiabot-linux-swarm-000',
251                   buildnumber=6,
252                   revision='abc123',
253                   path_config='kitchen',
254                   swarm_out_dir='[SWARM_OUT_DIR]') +
255    api.path.exists(
256        api.path['start_dir'].join('skia'),
257        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
258                                     'skimage', 'VERSION'),
259        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
260                                     'skp', 'VERSION'),
261        api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
262                                     'svg', 'VERSION'),
263        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
264    ) +
265    api.step_data('dm', retcode=1) +
266    api.step_data('pull /sdcard/revenge_of_the_skiabot/dm_out '+
267                  '[CUSTOM_[SWARM_OUT_DIR]]/dm', retcode=1)
268  )
269