blob: 5809988d2e5c48b06425ca2758df4ef8d90da947 [file] [log] [blame]
borenet1ed2ae42016-07-26 11:52:17 -07001# 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 test.
7
8
9DEPS = [
borenetbc20a702016-08-03 10:38:44 -070010 'build/file',
borenet1436a092016-08-03 08:23:10 -070011 'core',
borenet1ed2ae42016-07-26 11:52:17 -070012 'recipe_engine/json',
13 'recipe_engine/path',
14 'recipe_engine/platform',
15 'recipe_engine/properties',
borenetbc20a702016-08-03 10:38:44 -070016 'recipe_engine/python',
borenet1ed2ae42016-07-26 11:52:17 -070017 'recipe_engine/raw_io',
borenetbc20a702016-08-03 10:38:44 -070018 'flavor',
borenet1436a092016-08-03 08:23:10 -070019 'run',
borenetbc20a702016-08-03 10:38:44 -070020 'vars',
borenet1ed2ae42016-07-26 11:52:17 -070021]
22
23
24TEST_BUILDERS = {
25 'client.skia': {
26 'skiabot-linux-swarm-000': [
borenet2c3112d2016-08-05 06:30:10 -070027 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release',
borenet1ed2ae42016-07-26 11:52:17 -070028 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug',
borenet2c3112d2016-08-05 06:30:10 -070029 'Test-Android-GCC-Nexus10-GPU-MaliT604-Arm7-Release',
30 'Test-Android-GCC-Nexus6-GPU-Adreno420-Arm7-Debug',
borenet1ed2ae42016-07-26 11:52:17 -070031 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Debug',
borenet2c3112d2016-08-05 06:30:10 -070032 'Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug',
33 'Test-Android-GCC-NexusPlayer-CPU-SSE4-x86-Release',
34 'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Debug',
borenet1ed2ae42016-07-26 11:52:17 -070035 'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug',
borenet2c3112d2016-08-05 06:30:10 -070036 'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug',
37 'Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug',
38 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer',
borenet1ed2ae42016-07-26 11:52:17 -070039 'Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Coverage-Trybot',
borenet2c3112d2016-08-05 06:30:10 -070040 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug',
borenet1ed2ae42016-07-26 11:52:17 -070041 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug',
42 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
rmistrybcba19d2016-08-11 12:36:58 -070043 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared',
borenet2c3112d2016-08-05 06:30:10 -070044 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
borenet1ed2ae42016-07-26 11:52:17 -070045 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
borenet2c3112d2016-08-05 06:30:10 -070046 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan',
borenet1ed2ae42016-07-26 11:52:17 -070047 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot',
borenet2c3112d2016-08-05 06:30:10 -070048 'Test-Win8-MSVC-ShuttleB-GPU-GTX960-x86_64-Debug-ANGLE',
borenet1ed2ae42016-07-26 11:52:17 -070049 ],
50 },
51}
52
53
borenete2251ac2016-08-05 05:40:59 -070054def dm_flags(bot):
55 args = []
56
57 # 32-bit desktop bots tend to run out of memory, because they have relatively
58 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit.
59 if '-x86-' in bot and not 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -070060 args.extend('--threads 4'.split(' '))
borenete2251ac2016-08-05 05:40:59 -070061
62 # These are the canonical configs that we would ideally run on all bots. We
63 # may opt out or substitute some below for specific bots
64 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf']
65 # Add in either msaa4 or msaa16 to the canonical set of configs to run
66 if 'Android' in bot or 'iOS' in bot:
67 configs.append('msaa4')
68 else:
69 configs.append('msaa16')
70
71 # With msaa, the S4 crashes and the NP produces a long error stream when we
72 # run with MSAA. The Tegra2 and Tegra3 just don't support it. No record of
73 # why we're not running msaa on iOS, probably started with gpu config and just
74 # haven't tried.
75 if ('GalaxyS4' in bot or
76 'NexusPlayer' in bot or
77 'Tegra3' in bot or
78 'iOS' in bot):
79 configs = [x for x in configs if 'msaa' not in x]
80
81 # Runs out of memory on Android bots and Daisy. Everyone else seems fine.
82 if 'Android' in bot or 'Daisy' in bot:
83 configs.remove('pdf')
84
85 if '-GCE-' in bot:
86 configs.extend(['f16', 'srgb']) # Gamma-correct formats.
87 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
mtklein03591a72016-08-07 13:35:46 -070088 configs.extend(['lite-8888']) # Experimental display list.
borenete2251ac2016-08-05 05:40:59 -070089
90 if '-TSAN' not in bot:
91 if ('TegraK1' in bot or
92 'TegraX1' in bot or
93 'GTX550Ti' in bot or
94 'GTX660' in bot or
95 'GT610' in bot):
96 if 'Android' in bot:
borenet2c3112d2016-08-05 06:30:10 -070097 configs.append('nvprdit4')
borenete2251ac2016-08-05 05:40:59 -070098 else:
99 configs.append('nvprdit16')
100
101 # We want to test the OpenGL config not the GLES config on the X1
borenet2c3112d2016-08-05 06:30:10 -0700102 if 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700103 configs = [x.replace('gpu', 'gl') for x in configs]
104 configs = [x.replace('msaa', 'glmsaa') for x in configs]
105 configs = [x.replace('nvpr', 'glnvpr') for x in configs]
106
107 # NP is running out of RAM when we run all these modes. skia:3255
108 if 'NexusPlayer' not in bot:
109 configs.extend(mode + '-8888' for mode in
110 ['serialize', 'tiles_rt', 'pic'])
111
112 if 'ANGLE' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700113 configs.append('angle')
borenete2251ac2016-08-05 05:40:59 -0700114
115 # We want to run gpudft on atleast the mali 400
116 if 'GalaxyS3' in bot:
117 configs.append('gpudft')
118
119 # Test instanced rendering on a limited number of platforms
borenet2c3112d2016-08-05 06:30:10 -0700120 if 'Nexus6' in bot:
borenete2251ac2016-08-05 05:40:59 -0700121 configs.append('esinst') # esinst4 isn't working yet on Adreno.
borenet2c3112d2016-08-05 06:30:10 -0700122 elif 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700123 # Multisampled instanced configs use nvpr.
124 configs = [x.replace('glnvpr', 'glinst') for x in configs]
125 configs.append('glinst')
126 elif 'MacMini6.2' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700127 configs.extend(['glinst', 'glinst16'])
borenete2251ac2016-08-05 05:40:59 -0700128
129 # CommandBuffer bot *only* runs the command_buffer config.
130 if 'CommandBuffer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700131 configs = ['commandbuffer']
borenete2251ac2016-08-05 05:40:59 -0700132
133 # Vulkan bot *only* runs the vk config.
134 if 'Vulkan' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700135 configs = ['vk']
borenete2251ac2016-08-05 05:40:59 -0700136
137 args.append('--config')
138 args.extend(configs)
139
140 # Run tests, gms, and image decoding tests everywhere.
rmistry70c43ef2016-08-12 07:25:53 -0700141 args.extend('--src tests gm image colorImage svg'.split(' '))
borenete2251ac2016-08-05 05:40:59 -0700142
143 if 'GalaxyS' in bot:
144 args.extend(('--threads', '0'))
145
146 blacklist = []
147
148 # TODO: ???
149 blacklist.extend('f16 _ _ dstreadshuffle'.split(' '))
150 blacklist.extend('f16 image _ _'.split(' '))
151 blacklist.extend('srgb image _ _'.split(' '))
152 blacklist.extend('gpusrgb image _ _'.split(' '))
153
154 if 'Valgrind' in bot:
155 # These take 18+ hours to run.
156 blacklist.extend('pdf gm _ fontmgr_iter'.split(' '))
157 blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' '))
158 blacklist.extend('pdf skp _ worldjournal'.split(' '))
159 blacklist.extend('pdf skp _ desk_baidu.skp'.split(' '))
160 blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' '))
161
162 if 'iOS' in bot:
163 blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' '))
164 blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' '))
165
166 if 'Mac' in bot or 'iOS' in bot:
167 # CG fails on questionable bmps
168 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
169 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
170 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
171 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
172 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
173 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
174 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
175
176 # CG has unpredictable behavior on this questionable gif
177 # It's probably using uninitialized memory
178 blacklist.extend('_ image gen_platf frame_larger_than_image.gif'.split(' '))
179
180 # WIC fails on questionable bmps
181 if 'Win' in bot:
182 blacklist.extend('_ image gen_platf rle8-height-negative.bmp'.split(' '))
183 blacklist.extend('_ image gen_platf rle4-height-negative.bmp'.split(' '))
184 blacklist.extend('_ image gen_platf pal8os2v2.bmp'.split(' '))
185 blacklist.extend('_ image gen_platf pal8os2v2-16.bmp'.split(' '))
186 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
187 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
188 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
189 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
190 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
191 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
192 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
193 if 'x86_64' in bot and 'CPU' in bot:
194 # This GM triggers a SkSmallAllocator assert.
195 blacklist.extend('_ gm _ composeshader_bitmap'.split(' '))
196
197 if 'Android' in bot or 'iOS' in bot:
198 # This test crashes the N9 (perhaps because of large malloc/frees). It also
199 # is fairly slow and not platform-specific. So we just disable it on all of
200 # Android and iOS. skia:5438
201 blacklist.extend('_ test _ GrShape'.split(' '))
202
203 if 'Win8' in bot:
204 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with
205 # 'Unexpected error' from DirectWrite"
206 blacklist.extend('_ gm _ fontscalerdistortable'.split(' '))
fmalitab5b6de92016-08-16 07:08:48 -0700207 # skia:5636
208 blacklist.extend('_ svg _ Nebraska-StateSeal.svg'.split(' '))
borenete2251ac2016-08-05 05:40:59 -0700209
210 # skia:4095
211 bad_serialize_gms = ['bleed_image',
212 'c_gms',
213 'colortype',
214 'colortype_xfermodes',
215 'drawfilter',
216 'fontmgr_bounds_0.75_0',
217 'fontmgr_bounds_1_-0.25',
218 'fontmgr_bounds',
219 'fontmgr_match',
fmalitace2fc6a2016-08-26 10:13:39 -0700220 'fontmgr_iter',
221 'imagemasksubset']
borenete2251ac2016-08-05 05:40:59 -0700222
223 # skia:5589
224 bad_serialize_gms.extend(['bitmapfilters',
225 'bitmapshaders',
226 'bleed',
227 'bleed_alpha_bmp',
228 'bleed_alpha_bmp_shader',
229 'convex_poly_clip',
230 'extractalpha',
231 'filterbitmap_checkerboard_32_32_g8',
232 'filterbitmap_image_mandrill_64',
233 'shadows',
234 'simpleaaclip_aaclip'])
235 # skia:5595
236 bad_serialize_gms.extend(['composeshader_bitmap',
237 'scaled_tilemodes_npot',
238 'scaled_tilemodes'])
239 for test in bad_serialize_gms:
240 blacklist.extend(['serialize-8888', 'gm', '_', test])
241
242 if 'Mac' not in bot:
243 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
244 blacklist.extend(['serialize-8888', 'gm', '_', test])
245 # It looks like we skip these only for out-of-memory concerns.
246 if 'Win' in bot or 'Android' in bot:
247 for test in ['verylargebitmap', 'verylarge_picture_image']:
248 blacklist.extend(['serialize-8888', 'gm', '_', test])
249
250 # skia:4769
251 for test in ['drawfilter']:
252 blacklist.extend([ 'sp-8888', 'gm', '_', test])
253 blacklist.extend([ 'pic-8888', 'gm', '_', test])
254 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein03591a72016-08-07 13:35:46 -0700255 blacklist.extend([ 'lite-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700256 # skia:4703
257 for test in ['image-cacherator-from-picture',
258 'image-cacherator-from-raster',
259 'image-cacherator-from-ctable']:
260 blacklist.extend([ 'sp-8888', 'gm', '_', test])
261 blacklist.extend([ 'pic-8888', 'gm', '_', test])
262 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
263 blacklist.extend(['serialize-8888', 'gm', '_', test])
264
brianosman2c4b64e2016-09-07 07:04:44 -0700265 # GM that requires raster-backed canvas
266 for test in ['gamut']:
267 blacklist.extend([ 'sp-8888', 'gm', '_', test])
268 blacklist.extend([ 'pic-8888', 'gm', '_', test])
269 blacklist.extend([ 'lite-8888', 'gm', '_', test])
270 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
271 blacklist.extend(['serialize-8888', 'gm', '_', test])
272
borenete2251ac2016-08-05 05:40:59 -0700273 # Extensions for RAW images
274 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
275 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
276
277 # skbug.com/4888
278 # Blacklist RAW images (and a few large PNGs) on GPU bots
279 # until we can resolve failures
280 if 'GPU' in bot:
281 blacklist.extend('_ image _ interlaced1.png'.split(' '))
282 blacklist.extend('_ image _ interlaced2.png'.split(' '))
283 blacklist.extend('_ image _ interlaced3.png'.split(' '))
284 for raw_ext in r:
285 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
286
borenet2c3112d2016-08-05 06:30:10 -0700287 if 'Nexus9' in bot:
borenete2251ac2016-08-05 05:40:59 -0700288 for raw_ext in r:
289 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
290
291 # Large image that overwhelms older Mac bots
borenet2c3112d2016-08-05 06:30:10 -0700292 if 'MacMini4.1-GPU' in bot:
borenete2251ac2016-08-05 05:40:59 -0700293 blacklist.extend('_ image _ abnormal.wbmp'.split(' '))
294 blacklist.extend(['msaa16', 'gm', '_', 'blurcircles'])
295
296 match = []
297 if 'Valgrind' in bot: # skia:3021
298 match.append('~Threaded')
299
300 if 'GalaxyS3' in bot: # skia:1699
301 match.append('~WritePixels')
302
303 if 'AndroidOne' in bot: # skia:4711
borenet2c3112d2016-08-05 06:30:10 -0700304 match.append('~WritePixels')
borenete2251ac2016-08-05 05:40:59 -0700305
306 if 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700307 match.append('~ResourceCache')
borenete2251ac2016-08-05 05:40:59 -0700308
309 if 'Nexus10' in bot: # skia:5509
borenet2c3112d2016-08-05 06:30:10 -0700310 match.append('~CopySurface')
borenete2251ac2016-08-05 05:40:59 -0700311
borenet2c3112d2016-08-05 06:30:10 -0700312 if 'ANGLE' in bot and 'Debug' in bot:
borenete2251ac2016-08-05 05:40:59 -0700313 match.append('~GLPrograms') # skia:4717
314
315 if 'MSAN' in bot:
316 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
317
borenet2c3112d2016-08-05 06:30:10 -0700318 if 'TSAN' in bot:
borenete2251ac2016-08-05 05:40:59 -0700319 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
320
321 if blacklist:
322 args.append('--blacklist')
323 args.extend(blacklist)
324
325 if match:
326 args.append('--match')
327 args.extend(match)
328
329 # These bots run out of memory running RAW codec tests. Do not run them in
330 # parallel
331 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
332 or 'Win8-MSVC-ShuttleB' in bot):
333 args.append('--noRAW_threading')
334
335 return args
336
337
borenetbc20a702016-08-03 10:38:44 -0700338def key_params(api):
339 """Build a unique key from the builder name (as a list).
340
341 E.g. arch x86 gpu GeForce320M mode MacMini4.1 os Mac10.6
342 """
343 # Don't bother to include role, which is always Test.
344 # TryBots are uploaded elsewhere so they can use the same key.
345 blacklist = ['role', 'is_trybot']
346
347 flat = []
348 for k in sorted(api.vars.builder_cfg.keys()):
349 if k not in blacklist:
350 flat.append(k)
351 flat.append(api.vars.builder_cfg[k])
352 return flat
353
354
355def test_steps(api):
356 """Run the DM test."""
357 use_hash_file = False
358 if api.vars.upload_dm_results:
359 # This must run before we write anything into
360 # api.flavor.device_dirs.dm_dir or we may end up deleting our
361 # output on machines where they're the same.
362 api.flavor.create_clean_host_dir(api.vars.dm_dir)
363 host_dm_dir = str(api.vars.dm_dir)
364 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
365 if host_dm_dir != device_dm_dir:
366 api.flavor.create_clean_device_dir(device_dm_dir)
367
368 # Obtain the list of already-generated hashes.
369 hash_filename = 'uninteresting_hashes.txt'
370
371 # Ensure that the tmp_dir exists.
372 api.run.run_once(api.file.makedirs,
373 'tmp_dir',
374 api.vars.tmp_dir,
375 infra_step=True)
376
377 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
378 hashes_file = api.flavor.device_path_join(
379 api.flavor.device_dirs.tmp_dir, hash_filename)
380 api.run(
381 api.python.inline,
382 'get uninteresting hashes',
383 program="""
384 import contextlib
385 import math
386 import socket
387 import sys
388 import time
389 import urllib2
390
391 HASHES_URL = 'https://gold.skia.org/_/hashes'
392 RETRIES = 5
393 TIMEOUT = 60
394 WAIT_BASE = 15
395
396 socket.setdefaulttimeout(TIMEOUT)
397 for retry in range(RETRIES):
398 try:
399 with contextlib.closing(
400 urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:
401 hashes = w.read()
402 with open(sys.argv[1], 'w') as f:
403 f.write(hashes)
404 break
405 except Exception as e:
406 print 'Failed to get uninteresting hashes from %s:' % HASHES_URL
407 print e
408 if retry == RETRIES:
409 raise
410 waittime = WAIT_BASE * math.pow(2, retry)
411 print 'Retry in %d seconds.' % waittime
412 time.sleep(waittime)
413 """,
414 args=[host_hashes_file],
415 cwd=api.vars.skia_dir,
416 abort_on_failure=False,
417 fail_build_on_failure=False,
418 infra_step=True)
419
420 if api.path.exists(host_hashes_file):
421 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
422 use_hash_file = True
423
424 # Run DM.
425 properties = [
426 'gitHash', api.vars.got_revision,
427 'master', api.vars.master_name,
428 'builder', api.vars.builder_name,
429 'build_number', api.vars.build_number,
430 ]
431 if api.vars.is_trybot:
432 properties.extend([
rmistry3f1c9c02016-08-24 05:07:06 -0700433 'issue', api.vars.issue,
434 'patchset', api.vars.patchset,
435 'patch_storage', api.vars.patch_storage,
borenetbc20a702016-08-03 10:38:44 -0700436 ])
437
438 args = [
439 'dm',
440 '--undefok', # This helps branches that may not know new flags.
441 '--resourcePath', api.flavor.device_dirs.resource_dir,
442 '--skps', api.flavor.device_dirs.skp_dir,
443 '--images', api.flavor.device_path_join(
444 api.flavor.device_dirs.images_dir, 'dm'),
445 '--colorImages', api.flavor.device_path_join(
446 api.flavor.device_dirs.images_dir, 'colorspace'),
447 '--nameByHash',
448 '--properties'
449 ] + properties
450
rmistry70c43ef2016-08-12 07:25:53 -0700451 args.extend(['--svgs', api.flavor.device_dirs.svg_dir])
rmistrybcba19d2016-08-11 12:36:58 -0700452
borenetbc20a702016-08-03 10:38:44 -0700453 args.append('--key')
454 args.extend(key_params(api))
455 if use_hash_file:
456 args.extend(['--uninterestingHashesFile', hashes_file])
457 if api.vars.upload_dm_results:
458 args.extend(['--writePath', api.flavor.device_dirs.dm_dir])
459
460 skip_flag = None
461 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
462 skip_flag = '--nogpu'
463 elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
464 skip_flag = '--nocpu'
465 if skip_flag:
466 args.append(skip_flag)
borenete2251ac2016-08-05 05:40:59 -0700467 args.extend(dm_flags(api.vars.builder_name))
borenetbc20a702016-08-03 10:38:44 -0700468
469 api.run(api.flavor.step, 'dm', cmd=args,
borenetd460a3c2016-08-05 05:18:05 -0700470 abort_on_failure=False,
471 env=api.vars.default_env)
borenetbc20a702016-08-03 10:38:44 -0700472
473 if api.vars.upload_dm_results:
474 # Copy images and JSON to host machine if needed.
475 api.flavor.copy_directory_contents_to_host(
476 api.flavor.device_dirs.dm_dir, api.vars.dm_dir)
477
478 # See skia:2789.
479 if ('Valgrind' in api.vars.builder_name and
480 api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU'):
481 abandonGpuContext = list(args)
482 abandonGpuContext.append('--abandonGpuContext')
483 api.run(api.flavor.step, 'dm --abandonGpuContext',
484 cmd=abandonGpuContext, abort_on_failure=False)
485 preAbandonGpuContext = list(args)
486 preAbandonGpuContext.append('--preAbandonGpuContext')
487 api.run(api.flavor.step, 'dm --preAbandonGpuContext',
488 cmd=preAbandonGpuContext, abort_on_failure=False,
489 env=api.vars.default_env)
490
491
borenet1ed2ae42016-07-26 11:52:17 -0700492def RunSteps(api):
borenet1436a092016-08-03 08:23:10 -0700493 api.core.setup()
borenetbc20a702016-08-03 10:38:44 -0700494 api.flavor.install()
495 test_steps(api)
496 api.flavor.cleanup_steps()
borenet1436a092016-08-03 08:23:10 -0700497 api.run.check_failure()
borenet1ed2ae42016-07-26 11:52:17 -0700498
499
500def GenTests(api):
501 def AndroidTestData(builder, adb=None):
502 test_data = (
503 api.step_data(
504 'get EXTERNAL_STORAGE dir',
505 stdout=api.raw_io.output('/storage/emulated/legacy')) +
506 api.step_data(
507 'read SKP_VERSION',
508 stdout=api.raw_io.output('42')) +
509 api.step_data(
510 'read SK_IMAGE_VERSION',
511 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700512 api.step_data(
513 'read SVG_VERSION',
514 stdout=api.raw_io.output('42')) +
515 api.step_data(
borenet1ed2ae42016-07-26 11:52:17 -0700516 'exists skia_dm',
517 stdout=api.raw_io.output(''))
518 )
519 if 'GalaxyS3' not in builder:
520 test_data += api.step_data(
521 'adb root',
522 stdout=api.raw_io.output('restarting adbd as root'))
523 if adb:
524 test_data += api.step_data(
525 'which adb',
526 stdout=api.raw_io.output(adb))
527 else:
528 test_data += api.step_data(
529 'which adb',
530 retcode=1)
531
532 return test_data
533
534 for mastername, slaves in TEST_BUILDERS.iteritems():
535 for slavename, builders_by_slave in slaves.iteritems():
536 for builder in builders_by_slave:
537 test = (
538 api.test(builder) +
539 api.properties(buildername=builder,
540 mastername=mastername,
541 slavename=slavename,
542 buildnumber=5,
543 revision='abc123',
544 path_config='kitchen',
545 swarm_out_dir='[SWARM_OUT_DIR]') +
546 api.path.exists(
547 api.path['slave_build'].join('skia'),
548 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
549 'skimage', 'VERSION'),
550 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
551 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700552 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
553 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700554 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
555 )
556 )
557 if ('Android' in builder and
558 ('Test' in builder or 'Perf' in builder) and
559 not 'Appurify' in builder):
560 test += AndroidTestData(builder)
561 if 'Trybot' in builder:
562 test += api.properties(issue=500,
563 patchset=1,
564 rietveld='https://codereview.chromium.org')
565 if 'Win' in builder:
566 test += api.platform('win', 64)
567
568
569 yield test
570
571 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
572 yield (
573 api.test('failed_dm') +
574 api.properties(buildername=builder,
575 mastername='client.skia',
576 slavename='skiabot-linux-swarm-000',
577 buildnumber=6,
578 revision='abc123',
579 path_config='kitchen',
580 swarm_out_dir='[SWARM_OUT_DIR]') +
581 api.path.exists(
582 api.path['slave_build'].join('skia'),
583 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
584 'skimage', 'VERSION'),
585 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
586 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700587 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
588 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700589 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
590 ) +
591 api.step_data('dm', retcode=1)
592 )
593
594 builder = 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Debug'
595 yield (
596 api.test('failed_get_hashes') +
597 api.properties(buildername=builder,
598 mastername='client.skia',
599 slavename='skiabot-linux-swarm-000',
600 buildnumber=6,
601 revision='abc123',
602 path_config='kitchen',
603 swarm_out_dir='[SWARM_OUT_DIR]') +
604 api.path.exists(
605 api.path['slave_build'].join('skia'),
606 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
607 'skimage', 'VERSION'),
608 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
609 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700610 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
611 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700612 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
613 ) +
614 AndroidTestData(builder) +
615 api.step_data('read SKP_VERSION',
616 stdout=api.raw_io.output('42')) +
617 api.step_data('read SK_IMAGE_VERSION',
618 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700619 api.step_data('read SVG_VERSION',
620 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700621 api.step_data('get uninteresting hashes', retcode=1)
622 )
623
624 yield (
625 api.test('download_and_push_skps') +
626 api.properties(buildername=builder,
627 mastername='client.skia',
628 slavename='skiabot-linux-swarm-000',
629 buildnumber=6,
630 revision='abc123',
631 path_config='kitchen',
632 swarm_out_dir='[SWARM_OUT_DIR]') +
633 api.path.exists(
634 api.path['slave_build'].join('skia'),
635 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
636 'skimage', 'VERSION'),
637 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
638 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700639 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
640 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700641 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
642 ) +
643 AndroidTestData(builder) +
644 api.step_data('read SKP_VERSION',
645 stdout=api.raw_io.output('2')) +
646 api.step_data('read SK_IMAGE_VERSION',
647 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700648 api.step_data('read SVG_VERSION',
649 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700650 api.step_data(
651 'exists skps',
652 stdout=api.raw_io.output(''))
653 )
654
655 yield (
656 api.test('missing_SKP_VERSION_device') +
657 api.properties(buildername=builder,
658 mastername='client.skia',
659 slavename='skiabot-linux-swarm-000',
660 buildnumber=6,
661 revision='abc123',
662 path_config='kitchen',
663 swarm_out_dir='[SWARM_OUT_DIR]') +
664 api.path.exists(
665 api.path['slave_build'].join('skia'),
666 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
667 'skimage', 'VERSION'),
668 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
669 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700670 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
671 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700672 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
673 ) +
674 AndroidTestData(builder) +
675 api.step_data('read SKP_VERSION',
676 retcode=1) +
677 api.step_data('read SK_IMAGE_VERSION',
678 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700679 api.step_data('read SVG_VERSION',
680 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700681 api.step_data(
682 'exists skps',
683 stdout=api.raw_io.output(''))
684 )
685
686 yield (
687 api.test('download_and_push_skimage') +
688 api.properties(buildername=builder,
689 mastername='client.skia',
690 slavename='skiabot-linux-swarm-000',
691 buildnumber=6,
692 revision='abc123',
693 path_config='kitchen',
694 swarm_out_dir='[SWARM_OUT_DIR]') +
695 api.path.exists(
696 api.path['slave_build'].join('skia'),
697 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
698 'skimage', 'VERSION'),
699 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
700 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700701 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
702 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700703 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
704 ) +
705 AndroidTestData(builder) +
706 api.step_data('read SKP_VERSION',
707 stdout=api.raw_io.output('42')) +
708 api.step_data('read SK_IMAGE_VERSION',
709 stdout=api.raw_io.output('2')) +
rmistrybcba19d2016-08-11 12:36:58 -0700710 api.step_data('read SVG_VERSION',
711 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700712 api.step_data(
713 'exists skia_images',
714 stdout=api.raw_io.output(''))
715 )
716
717 yield (
718 api.test('missing_SK_IMAGE_VERSION_device') +
719 api.properties(buildername=builder,
720 mastername='client.skia',
721 slavename='skiabot-linux-swarm-000',
722 buildnumber=6,
723 revision='abc123',
724 path_config='kitchen',
725 swarm_out_dir='[SWARM_OUT_DIR]') +
726 api.path.exists(
727 api.path['slave_build'].join('skia'),
728 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
729 'skimage', 'VERSION'),
730 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
731 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700732 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
733 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700734 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
735 ) +
736 AndroidTestData(builder) +
737 api.step_data('read SKP_VERSION',
738 stdout=api.raw_io.output('42')) +
739 api.step_data('read SK_IMAGE_VERSION',
740 retcode=1) +
rmistrybcba19d2016-08-11 12:36:58 -0700741 api.step_data('read SVG_VERSION',
742 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700743 api.step_data(
744 'exists skia_images',
745 stdout=api.raw_io.output(''))
746 )
747
748 yield (
rmistrybcba19d2016-08-11 12:36:58 -0700749 api.test('download_and_push_svgs') +
750 api.properties(buildername=builder,
751 mastername='client.skia',
752 slavename='skiabot-linux-swarm-000',
753 buildnumber=6,
754 revision='abc123',
755 path_config='kitchen',
756 swarm_out_dir='[SWARM_OUT_DIR]') +
757 api.path.exists(
758 api.path['slave_build'].join('skia'),
759 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
760 'skimage', 'VERSION'),
761 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
762 'skp', 'VERSION'),
763 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
764 'svg', 'VERSION'),
765 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
766 ) +
767 AndroidTestData(builder) +
768 api.step_data('read SKP_VERSION',
769 stdout=api.raw_io.output('42')) +
770 api.step_data('read SK_IMAGE_VERSION',
771 stdout=api.raw_io.output('42')) +
772 api.step_data('read SVG_VERSION',
773 stdout=api.raw_io.output('2')) +
774 api.step_data(
775 'exists svgs',
776 stdout=api.raw_io.output(''))
777 )
778
779 yield (
780 api.test('missing_SVG_VERSION_device') +
781 api.properties(buildername=builder,
782 mastername='client.skia',
783 slavename='skiabot-linux-swarm-000',
784 buildnumber=6,
785 revision='abc123',
786 path_config='kitchen',
787 swarm_out_dir='[SWARM_OUT_DIR]') +
788 api.path.exists(
789 api.path['slave_build'].join('skia'),
790 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
791 'skimage', 'VERSION'),
792 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
793 'skp', 'VERSION'),
794 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
795 'svg', 'VERSION'),
796 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
797 ) +
798 AndroidTestData(builder) +
799 api.step_data('read SKP_VERSION',
800 stdout=api.raw_io.output('42')) +
801 api.step_data('read SK_IMAGE_VERSION',
802 stdout=api.raw_io.output('42')) +
803 api.step_data('read SVG_VERSION',
804 retcode=1) +
805 api.step_data(
806 'exists svgs',
807 stdout=api.raw_io.output(''))
808 )
809
810 yield (
borenet1ed2ae42016-07-26 11:52:17 -0700811 api.test('adb_in_path') +
812 api.properties(buildername=builder,
813 mastername='client.skia',
814 slavename='skiabot-linux-swarm-000',
815 buildnumber=6,
816 revision='abc123',
817 path_config='kitchen',
818 swarm_out_dir='[SWARM_OUT_DIR]') +
819 api.path.exists(
820 api.path['slave_build'].join('skia'),
821 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
822 'skimage', 'VERSION'),
823 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
824 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700825 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
826 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700827 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
828 ) +
829 AndroidTestData(builder, adb='/usr/bin/adb') +
830 api.step_data('read SKP_VERSION',
831 stdout=api.raw_io.output('42')) +
832 api.step_data('read SK_IMAGE_VERSION',
rmistrybcba19d2016-08-11 12:36:58 -0700833 stdout=api.raw_io.output('42')) +
834 api.step_data('read SVG_VERSION',
borenet1ed2ae42016-07-26 11:52:17 -0700835 stdout=api.raw_io.output('42'))
836 )
837
838 builder = 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot'
839 yield (
840 api.test('big_issue_number') +
841 api.properties(buildername=builder,
842 mastername='client.skia.compile',
843 slavename='skiabot-linux-swarm-000',
844 buildnumber=5,
845 revision='abc123',
846 path_config='kitchen',
847 swarm_out_dir='[SWARM_OUT_DIR]',
848 rietveld='https://codereview.chromium.org',
849 patchset=1,
850 issue=2147533002L) +
851 api.path.exists(
852 api.path['slave_build'].join('skia'),
853 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
854 'skimage', 'VERSION'),
855 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
856 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700857 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
858 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700859 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
860 ) +
861 api.platform('win', 64)
862 )
rmistry3f1c9c02016-08-24 05:07:06 -0700863
864 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot'
865 gerrit_kwargs = {
866 'patch_storage': 'gerrit',
867 'repository': 'skia',
868 'event.patchSet.ref': 'refs/changes/00/2100/2',
869 'event.change.number': '2100',
870 }
871 yield (
872 api.test('recipe_with_gerrit_patch') +
873 api.properties(
874 buildername=builder,
875 mastername='client.skia',
876 slavename='skiabot-linux-swarm-000',
877 buildnumber=5,
878 path_config='kitchen',
879 swarm_out_dir='[SWARM_OUT_DIR]',
880 revision='abc123',
881 **gerrit_kwargs)
882 )