blob: 74a6e5e19ae70033590a45893776760bc9fcb326 [file] [log] [blame]
Eric Boren7e97dc02017-02-02 09:02:37 -05001# 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
9from recipe_engine import recipe_api
10
11
12def dm_flags(bot):
13 args = []
14
Brian Osmanc35a2d42017-03-17 10:58:53 -040015 # This enables non-deterministic random seeding of the GPU FP optimization
Brian Osman0dbf0422017-03-20 10:21:26 -040016 # test. Limit testing until we're sure it's not going to cause an
Brian Osmanc35a2d42017-03-17 10:58:53 -040017 # avalanche of problems.
Brian Osmanbf826af2017-04-05 16:35:53 -040018 if 'Ubuntu' in bot or 'Win' in bot or 'Mac' in bot or 'iOS' in bot:
Brian Osmanc35a2d42017-03-17 10:58:53 -040019 args.append('--randomProcessorTest')
20
Eric Boren7e97dc02017-02-02 09:02:37 -050021 # 32-bit desktop bots tend to run out of memory, because they have relatively
22 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit.
23 if '-x86-' in bot and not 'NexusPlayer' in bot:
24 args.extend('--threads 4'.split(' '))
25
Matt Sarett3adf1c32017-03-21 13:13:22 -040026 # Avoid issues with dynamically exceeding resource cache limits.
27 if 'Test' in bot and 'DISCARDABLE' in bot:
28 args.extend('--threads 0'.split(' '))
29
Eric Boren7e97dc02017-02-02 09:02:37 -050030 # These are the canonical configs that we would ideally run on all bots. We
31 # may opt out or substitute some below for specific bots
Brian Salomon50f66d82017-03-17 14:32:05 -040032 configs = ['8888', 'srgb', 'pdf']
33 # Add in either gles or gl configs to the canonical set based on OS
Brian Salomondcf0ab02017-03-20 11:10:21 -040034 sample_count = '8'
35 gl_prefix = 'gl'
Eric Boren7e97dc02017-02-02 09:02:37 -050036 if 'Android' in bot or 'iOS' in bot:
Brian Salomondcf0ab02017-03-20 11:10:21 -040037 sample_count = '4'
38 # We want to test the OpenGL config not the GLES config on the Shield
39 if 'NVIDIA_Shield' not in bot:
40 gl_prefix = 'gles'
Brian Salomon4b33ef62017-03-22 16:51:30 -040041 elif 'Intel' in bot:
42 sample_count = ''
Brian Salomondcf0ab02017-03-20 11:10:21 -040043
Brian Salomon4b33ef62017-03-22 16:51:30 -040044 configs.extend([gl_prefix, gl_prefix + 'dft', gl_prefix + 'srgb'])
45 if sample_count is not '':
46 configs.append(gl_prefix + 'msaa' + sample_count)
Eric Boren7e97dc02017-02-02 09:02:37 -050047
48 # The NP produces a long error stream when we run with MSAA. The Tegra3 just
49 # doesn't support it.
50 if ('NexusPlayer' in bot or
51 'Tegra3' in bot or
52 # We aren't interested in fixing msaa bugs on iPad4.
53 'iPad4' in bot or
54 # skia:5792
55 'iHD530' in bot or
56 'IntelIris540' in bot):
57 configs = [x for x in configs if 'msaa' not in x]
58
59 # The NP produces different images for dft on every run.
60 if 'NexusPlayer' in bot:
Brian Salomon50f66d82017-03-17 14:32:05 -040061 configs = [x for x in configs if 'dft' not in x]
Eric Boren7e97dc02017-02-02 09:02:37 -050062
63 # Runs out of memory on Android bots. Everyone else seems fine.
64 if 'Android' in bot:
65 configs.remove('pdf')
66
67 if '-GCE-' in bot:
68 configs.extend(['565'])
69 configs.extend(['f16'])
70 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
71 configs.extend(['lite-8888']) # Experimental display list.
Mike Klein919cc452017-03-18 15:36:52 +000072 configs.extend(['gbr-8888'])
Eric Boren7e97dc02017-02-02 09:02:37 -050073
Brian Salomon4b33ef62017-03-22 16:51:30 -040074 if '-TSAN' not in bot and sample_count is not '':
Eric Boren7e97dc02017-02-02 09:02:37 -050075 if ('TegraK1' in bot or
76 'TegraX1' in bot or
77 'GTX550Ti' in bot or
78 'GTX660' in bot or
79 'GT610' in bot):
Brian Salomondcf0ab02017-03-20 11:10:21 -040080 configs.append(gl_prefix + 'nvprdit' + sample_count)
Eric Boren7e97dc02017-02-02 09:02:37 -050081
Ben Wagnerbb91bd32017-03-20 22:56:19 -040082 # We want to test both the OpenGL config and the GLES config on Linux Intel:
83 # GL is used by Chrome, GLES is used by ChromeOS.
84 if 'Intel' in bot and 'Ubuntu' in bot:
Brian Salomon4b33ef62017-03-22 16:51:30 -040085 configs.extend(['gles', 'glesdft', 'glessrgb'])
Ben Wagnerbb91bd32017-03-20 22:56:19 -040086
Eric Boren7e97dc02017-02-02 09:02:37 -050087 # NP is running out of RAM when we run all these modes. skia:3255
88 if 'NexusPlayer' not in bot:
89 configs.extend(mode + '-8888' for mode in
90 ['serialize', 'tiles_rt', 'pic'])
91
92 # Test instanced rendering on a limited number of platforms
93 if 'Nexus6' in bot:
Brian Salomondcf0ab02017-03-20 11:10:21 -040094 configs.append(gl_prefix + 'inst') # inst msaa isn't working yet on Adreno.
95 elif 'NVIDIA_Shield' in bot or 'PixelC' in bot:
96 # Multisampled instanced configs use nvpr so we substitute inst msaa
97 # configs for nvpr msaa configs.
98 old = gl_prefix + 'nvpr'
99 new = gl_prefix + 'inst'
100 configs = [x.replace(old, new) for x in configs]
101 # We also test non-msaa instanced.
102 configs.append(new)
Brian Salomon4b33ef62017-03-22 16:51:30 -0400103 elif 'MacMini6.2' in bot and sample_count is not '':
Brian Salomondcf0ab02017-03-20 11:10:21 -0400104 configs.extend([gl_prefix + 'inst', gl_prefix + 'inst' + sample_count])
Eric Boren7e97dc02017-02-02 09:02:37 -0500105
106 # CommandBuffer bot *only* runs the command_buffer config.
107 if 'CommandBuffer' in bot:
108 configs = ['commandbuffer']
109
110 # ANGLE bot *only* runs the angle configs
111 if 'ANGLE' in bot:
112 configs = ['angle_d3d11_es2',
113 'angle_d3d9_es2',
Eric Boren7e97dc02017-02-02 09:02:37 -0500114 'angle_gl_es2']
Brian Salomon4b33ef62017-03-22 16:51:30 -0400115 if sample_count is not '':
Brian Salomon528ca9b2017-03-24 11:15:09 -0400116 configs.append('angle_d3d11_es2_msaa' + sample_count)
Eric Boren7e97dc02017-02-02 09:02:37 -0500117
118 # Vulkan bot *only* runs the vk config.
119 if 'Vulkan' in bot:
120 configs = ['vk']
121
122 args.append('--config')
123 args.extend(configs)
124
125 # Run tests, gms, and image decoding tests everywhere.
Greg Danielb8e9b522017-03-09 10:30:31 -0500126 args.extend('--src tests gm image colorImage svg'.split(' '))
127 if 'Vulkan' in bot and 'NexusPlayer' in bot:
128 args.remove('svg')
129 args.remove('image')
Eric Boren7e97dc02017-02-02 09:02:37 -0500130
Eric Boren7e97dc02017-02-02 09:02:37 -0500131 blacklisted = []
132 def blacklist(quad):
133 config, src, options, name = quad.split(' ') if type(quad) is str else quad
134 if config == '_' or config in configs:
135 blacklisted.extend([config, src, options, name])
136
137 # TODO: ???
138 blacklist('f16 _ _ dstreadshuffle')
Ben Wagnerbb91bd32017-03-20 22:56:19 -0400139 blacklist('glsrgb image _ _')
140 blacklist('glessrgb image _ _')
Eric Boren7e97dc02017-02-02 09:02:37 -0500141
142 # Decoder tests are now performing gamma correct decodes. This means
143 # that, when viewing the results, we need to perform a gamma correct
144 # encode to PNG. Therefore, we run the image tests in srgb mode instead
145 # of 8888.
146 blacklist('8888 image _ _')
147
Mike Klein919cc452017-03-18 15:36:52 +0000148 # Not any point to running these.
149 blacklist('gbr-8888 image _ _')
150 blacklist('gbr-8888 colorImage _ _')
151
Eric Boren7e97dc02017-02-02 09:02:37 -0500152 if 'Valgrind' in bot:
153 # These take 18+ hours to run.
154 blacklist('pdf gm _ fontmgr_iter')
155 blacklist('pdf _ _ PANO_20121023_214540.jpg')
156 blacklist('pdf skp _ worldjournal')
157 blacklist('pdf skp _ desk_baidu.skp')
158 blacklist('pdf skp _ desk_wikipedia.skp')
159 blacklist('_ svg _ _')
160
161 if 'iOS' in bot:
Brian Salomondcf0ab02017-03-20 11:10:21 -0400162 blacklist(gl_prefix + ' skp _ _')
Eric Boren7e97dc02017-02-02 09:02:37 -0500163
164 if 'Mac' in bot or 'iOS' in bot:
165 # CG fails on questionable bmps
166 blacklist('_ image gen_platf rgba32abf.bmp')
167 blacklist('_ image gen_platf rgb24prof.bmp')
168 blacklist('_ image gen_platf rgb24lprof.bmp')
169 blacklist('_ image gen_platf 8bpp-pixeldata-cropped.bmp')
170 blacklist('_ image gen_platf 4bpp-pixeldata-cropped.bmp')
171 blacklist('_ image gen_platf 32bpp-pixeldata-cropped.bmp')
172 blacklist('_ image gen_platf 24bpp-pixeldata-cropped.bmp')
173
174 # CG has unpredictable behavior on this questionable gif
175 # It's probably using uninitialized memory
176 blacklist('_ image gen_platf frame_larger_than_image.gif')
177
178 # CG has unpredictable behavior on incomplete pngs
179 # skbug.com/5774
180 blacklist('_ image gen_platf inc0.png')
181 blacklist('_ image gen_platf inc1.png')
182 blacklist('_ image gen_platf inc2.png')
183 blacklist('_ image gen_platf inc3.png')
184 blacklist('_ image gen_platf inc4.png')
185 blacklist('_ image gen_platf inc5.png')
186 blacklist('_ image gen_platf inc6.png')
187 blacklist('_ image gen_platf inc7.png')
188 blacklist('_ image gen_platf inc8.png')
189 blacklist('_ image gen_platf inc9.png')
190 blacklist('_ image gen_platf inc10.png')
191 blacklist('_ image gen_platf inc11.png')
192 blacklist('_ image gen_platf inc12.png')
193 blacklist('_ image gen_platf inc13.png')
194 blacklist('_ image gen_platf inc14.png')
195
Matt Sarettfbd6cfb2017-02-13 12:04:20 -0500196 # WIC fails on questionable bmps and arithmetic jpegs
Eric Boren7e97dc02017-02-02 09:02:37 -0500197 if 'Win' in bot:
198 blacklist('_ image gen_platf rle8-height-negative.bmp')
199 blacklist('_ image gen_platf rle4-height-negative.bmp')
200 blacklist('_ image gen_platf pal8os2v2.bmp')
201 blacklist('_ image gen_platf pal8os2v2-16.bmp')
202 blacklist('_ image gen_platf rgba32abf.bmp')
203 blacklist('_ image gen_platf rgb24prof.bmp')
204 blacklist('_ image gen_platf rgb24lprof.bmp')
205 blacklist('_ image gen_platf 8bpp-pixeldata-cropped.bmp')
206 blacklist('_ image gen_platf 4bpp-pixeldata-cropped.bmp')
207 blacklist('_ image gen_platf 32bpp-pixeldata-cropped.bmp')
208 blacklist('_ image gen_platf 24bpp-pixeldata-cropped.bmp')
Matt Sarettfbd6cfb2017-02-13 12:04:20 -0500209 blacklist('_ image gen_platf testimgari.jpg')
Eric Boren7e97dc02017-02-02 09:02:37 -0500210 if 'x86_64' in bot and 'CPU' in bot:
211 # This GM triggers a SkSmallAllocator assert.
212 blacklist('_ gm _ composeshader_bitmap')
213
214 if 'Android' in bot or 'iOS' in bot:
215 # This test crashes the N9 (perhaps because of large malloc/frees). It also
216 # is fairly slow and not platform-specific. So we just disable it on all of
217 # Android and iOS. skia:5438
218 blacklist('_ test _ GrShape')
219
220 if 'Win8' in bot:
221 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with
222 # 'Unexpected error' from DirectWrite"
223 blacklist('_ gm _ fontscalerdistortable')
224 # skia:5636
225 blacklist('_ svg _ Nebraska-StateSeal.svg')
226
227 # skia:4095
228 bad_serialize_gms = ['bleed_image',
229 'c_gms',
230 'colortype',
231 'colortype_xfermodes',
232 'drawfilter',
233 'fontmgr_bounds_0.75_0',
234 'fontmgr_bounds_1_-0.25',
235 'fontmgr_bounds',
236 'fontmgr_match',
237 'fontmgr_iter',
238 'imagemasksubset']
239
240 # skia:5589
241 bad_serialize_gms.extend(['bitmapfilters',
242 'bitmapshaders',
243 'bleed',
244 'bleed_alpha_bmp',
245 'bleed_alpha_bmp_shader',
246 'convex_poly_clip',
247 'extractalpha',
248 'filterbitmap_checkerboard_32_32_g8',
249 'filterbitmap_image_mandrill_64',
250 'shadows',
251 'simpleaaclip_aaclip'])
252 # skia:5595
253 bad_serialize_gms.extend(['composeshader_bitmap',
254 'scaled_tilemodes_npot',
255 'scaled_tilemodes'])
256
257 # skia:5778
258 bad_serialize_gms.append('typefacerendering_pfaMac')
259 # skia:5942
260 bad_serialize_gms.append('parsedpaths')
261
262 # these use a custom image generator which doesn't serialize
263 bad_serialize_gms.append('ImageGeneratorExternal_rect')
264 bad_serialize_gms.append('ImageGeneratorExternal_shader')
265
266 # skia:6189
267 bad_serialize_gms.append('shadow_utils')
268
269 for test in bad_serialize_gms:
270 blacklist(['serialize-8888', 'gm', '_', test])
271
272 if 'Mac' not in bot:
273 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
274 blacklist(['serialize-8888', 'gm', '_', test])
275 # It looks like we skip these only for out-of-memory concerns.
276 if 'Win' in bot or 'Android' in bot:
277 for test in ['verylargebitmap', 'verylarge_picture_image']:
278 blacklist(['serialize-8888', 'gm', '_', test])
279
280 # skia:4769
281 for test in ['drawfilter']:
282 blacklist([ 'sp-8888', 'gm', '_', test])
283 blacklist([ 'pic-8888', 'gm', '_', test])
284 blacklist(['2ndpic-8888', 'gm', '_', test])
285 blacklist([ 'lite-8888', 'gm', '_', test])
286 # skia:4703
287 for test in ['image-cacherator-from-picture',
288 'image-cacherator-from-raster',
289 'image-cacherator-from-ctable']:
290 blacklist([ 'sp-8888', 'gm', '_', test])
291 blacklist([ 'pic-8888', 'gm', '_', test])
292 blacklist([ '2ndpic-8888', 'gm', '_', test])
293 blacklist(['serialize-8888', 'gm', '_', test])
294
295 # GM that requires raster-backed canvas
296 for test in ['gamut', 'complexclip4_bw', 'complexclip4_aa']:
297 blacklist([ 'sp-8888', 'gm', '_', test])
298 blacklist([ 'pic-8888', 'gm', '_', test])
299 blacklist([ 'lite-8888', 'gm', '_', test])
300 blacklist([ '2ndpic-8888', 'gm', '_', test])
301 blacklist(['serialize-8888', 'gm', '_', test])
302
303 # GM that not support tiles_rt
304 for test in ['complexclip4_bw', 'complexclip4_aa']:
305 blacklist([ 'tiles_rt-8888', 'gm', '_', test])
306
307 # Extensions for RAW images
308 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
309 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
310
311 # skbug.com/4888
312 # Blacklist RAW images (and a few large PNGs) on GPU bots
Matt Sarett14454752017-02-02 09:40:54 -0800313 # until we can resolve failures.
314 # Also blacklisted on 32-bit Win2k8 for F16 OOM errors.
315 if 'GPU' in bot or ('Win2k8' in bot and 'x86-' in bot):
Eric Boren7e97dc02017-02-02 09:02:37 -0500316 blacklist('_ image _ interlaced1.png')
317 blacklist('_ image _ interlaced2.png')
318 blacklist('_ image _ interlaced3.png')
319 for raw_ext in r:
320 blacklist('_ image _ .%s' % raw_ext)
321
322 # Large image that overwhelms older Mac bots
323 if 'MacMini4.1-GPU' in bot:
324 blacklist('_ image _ abnormal.wbmp')
Brian Salomondcf0ab02017-03-20 11:10:21 -0400325 blacklist([gl_prefix + 'msaa' + sample_count, 'gm', '_', 'blurcircles'])
Eric Boren7e97dc02017-02-02 09:02:37 -0500326
Ben Wagnere5f19a82017-03-06 13:33:03 -0500327 if 'IntelHD405' in bot and 'Ubuntu16' in bot:
328 # skia:6331
Ben Wagnerbb91bd32017-03-20 22:56:19 -0400329 blacklist(['glmsaa8', 'image', 'gen_codec_gpu', 'abnormal.wbmp'])
330 blacklist(['glesmsaa4', 'image', 'gen_codec_gpu', 'abnormal.wbmp'])
Ben Wagnere5f19a82017-03-06 13:33:03 -0500331
Eric Boren7e97dc02017-02-02 09:02:37 -0500332 if 'Nexus5' in bot:
333 # skia:5876
Ben Wagner6a3ae842017-02-21 18:17:15 -0500334 blacklist(['_', 'gm', '_', 'encode-platform'])
Eric Boren7e97dc02017-02-02 09:02:37 -0500335
Ben Wagner2f5055f2017-02-07 14:25:46 -0500336 if 'AndroidOne-GPU' in bot: # skia:4697, skia:4704, skia:4694, skia:4705
Brian Salomondcf0ab02017-03-20 11:10:21 -0400337 blacklist(['_', 'gm', '_', 'bigblurs'])
338 blacklist(['_', 'gm', '_', 'bleed'])
339 blacklist(['_', 'gm', '_', 'bleed_alpha_bmp'])
340 blacklist(['_', 'gm', '_', 'bleed_alpha_bmp_shader'])
341 blacklist(['_', 'gm', '_', 'bleed_alpha_image'])
342 blacklist(['_', 'gm', '_', 'bleed_alpha_image_shader'])
343 blacklist(['_', 'gm', '_', 'bleed_image'])
344 blacklist(['_', 'gm', '_', 'dropshadowimagefilter'])
345 blacklist(['_', 'gm', '_', 'filterfastbounds'])
346 blacklist([gl_prefix, 'gm', '_', 'imageblurtiled'])
Brian Salomondcf0ab02017-03-20 11:10:21 -0400347 blacklist(['_', 'gm', '_', 'imagefiltersclipped'])
348 blacklist(['_', 'gm', '_', 'imagefiltersscaled'])
349 blacklist(['_', 'gm', '_', 'imageresizetiled'])
350 blacklist(['_', 'gm', '_', 'matrixconvolution'])
351 blacklist(['_', 'gm', '_', 'strokedlines'])
Brian Salomon4b33ef62017-03-22 16:51:30 -0400352 if sample_count is not '':
353 gl_msaa_config = gl_prefix + 'msaa' + sample_count
354 blacklist([gl_msaa_config, 'gm', '_', 'imageblurtiled'])
355 blacklist([gl_msaa_config, 'gm', '_', 'imagefiltersbase'])
Ben Wagner2f5055f2017-02-07 14:25:46 -0500356
Eric Boren7e97dc02017-02-02 09:02:37 -0500357 match = []
358 if 'Valgrind' in bot: # skia:3021
359 match.append('~Threaded')
360
361 if 'AndroidOne' in bot: # skia:4711
362 match.append('~WritePixels')
363
364 if 'NexusPlayer' in bot:
365 match.append('~ResourceCache')
366
367 if 'Nexus10' in bot:
368 match.append('~CopySurface') # skia:5509
369 match.append('~SRGBReadWritePixels') # skia:6097
370
Ben Wagner5fb88b32017-03-01 14:13:55 -0500371 if 'GalaxyJ5' in bot:
372 match.append('~SRGBReadWritePixels') # skia:6097
373
Ben Wagner7da7fe62017-04-06 13:44:16 +0000374 if 'GalaxyS6' in bot:
375 match.append('~SpecialImage') # skia:6338
376
Kevin Lubick465748c2017-03-27 12:22:52 -0400377 if 'GalaxyS7_G930A' in bot:
378 match.append('~WritePixels') # skia:6427
379
Eric Boren7e97dc02017-02-02 09:02:37 -0500380 if 'ANGLE' in bot and 'Debug' in bot:
381 match.append('~GLPrograms') # skia:4717
382
383 if 'MSAN' in bot:
384 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
385
386 if 'TSAN' in bot:
387 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
388 match.extend(['~RGBA4444TextureTest', # Flakier than they are important.
389 '~RGB565TextureTest'])
390
391 if 'Vulkan' in bot and 'Adreno' in bot:
392 # skia:5777
393 match.extend(['~XfermodeImageFilterCroppedInput',
394 '~GrTextureStripAtlasFlush',
395 '~CopySurface'])
396
397 if 'Vulkan' in bot and 'NexusPlayer' in bot:
398 match.extend(['~hardstop_gradient', # skia:6037
399 '~gradients_dup_color_stops', # skia:6037
400 '~gradients_no_texture$', # skia:6132
401 '~tilemodes', # skia:6132
402 '~shadertext$', # skia:6132
Matt Sarettb73721a2017-02-07 14:41:20 -0500403 '~bitmapfilters', # skia:6132
404 '~GrContextFactory_abandon']) #skia:6209
Eric Boren7e97dc02017-02-02 09:02:37 -0500405
Greg Daniel6579da22017-02-15 14:41:48 -0500406 if 'Vulkan' in bot and 'IntelIris540' in bot and 'Ubuntu' in bot:
Greg Danield3caa772017-03-24 11:40:29 -0400407 match.extend(['~VkHeapTests']) # skia:6245
Greg Daniel6579da22017-02-15 14:41:48 -0500408
Ben Wagner37b1d842017-03-24 12:11:51 -0400409 if 'Vulkan' in bot and 'IntelIris540' in bot and 'Win' in bot:
410 # skia:6398
411 blacklist(['vk', 'gm', '_', 'aarectmodes'])
412 blacklist(['vk', 'gm', '_', 'aaxfermodes'])
413 blacklist(['vk', 'gm', '_', 'arithmode'])
414 blacklist(['vk', 'gm', '_', 'composeshader_bitmap'])
415 blacklist(['vk', 'gm', '_', 'composeshader_bitmap2'])
416 blacklist(['vk', 'gm', '_', 'dftextCOLR'])
417 blacklist(['vk', 'gm', '_', 'drawregionmodes'])
418 blacklist(['vk', 'gm', '_', 'filterfastbounds'])
419 blacklist(['vk', 'gm', '_', 'fontcache'])
420 blacklist(['vk', 'gm', '_', 'fontmgr_iterWin10'])
421 blacklist(['vk', 'gm', '_', 'fontmgr_iter_factoryWin10'])
422 blacklist(['vk', 'gm', '_', 'fontmgr_matchWin10'])
423 blacklist(['vk', 'gm', '_', 'fontscalerWin'])
424 blacklist(['vk', 'gm', '_', 'fontscalerdistortable'])
425 blacklist(['vk', 'gm', '_', 'gammagradienttext'])
426 blacklist(['vk', 'gm', '_', 'gammatextWin'])
427 blacklist(['vk', 'gm', '_', 'gradtext'])
428 blacklist(['vk', 'gm', '_', 'hairmodes'])
429 blacklist(['vk', 'gm', '_', 'imagefilters_xfermodes'])
430 blacklist(['vk', 'gm', '_', 'imagefiltersclipped'])
431 blacklist(['vk', 'gm', '_', 'imagefiltersgraph'])
432 blacklist(['vk', 'gm', '_', 'imagefiltersscaled'])
433 blacklist(['vk', 'gm', '_', 'imagefiltersstroked'])
434 blacklist(['vk', 'gm', '_', 'imagefilterstransformed'])
435 blacklist(['vk', 'gm', '_', 'imageresizetiled'])
436 blacklist(['vk', 'gm', '_', 'lcdblendmodes'])
437 blacklist(['vk', 'gm', '_', 'lcdoverlap'])
438 blacklist(['vk', 'gm', '_', 'lcdtextWin'])
439 blacklist(['vk', 'gm', '_', 'lcdtextsize'])
440 blacklist(['vk', 'gm', '_', 'matriximagefilter'])
441 blacklist(['vk', 'gm', '_', 'mixedtextblobsCOLR'])
442 blacklist(['vk', 'gm', '_', 'pictureimagefilter'])
443 blacklist(['vk', 'gm', '_', 'resizeimagefilter'])
444 blacklist(['vk', 'gm', '_', 'rotate_imagefilter'])
445 blacklist(['vk', 'gm', '_', 'savelayer_lcdtext'])
446 blacklist(['vk', 'gm', '_', 'srcmode'])
447 blacklist(['vk', 'gm', '_', 'surfaceprops'])
448 blacklist(['vk', 'gm', '_', 'textblobgeometrychange'])
449 blacklist(['vk', 'gm', '_', 'textbloblooper'])
450 blacklist(['vk', 'gm', '_', 'textblobmixedsizes'])
451 blacklist(['vk', 'gm', '_', 'textblobmixedsizes_df'])
452 blacklist(['vk', 'gm', '_', 'textblobrandomfont'])
453 blacklist(['vk', 'gm', '_', 'textfilter_color'])
454 blacklist(['vk', 'gm', '_', 'textfilter_image'])
455 blacklist(['vk', 'gm', '_', 'typefacerenderingWin'])
456 blacklist(['vk', 'gm', '_', 'varied_text_clipped_lcd'])
457 blacklist(['vk', 'gm', '_', 'varied_text_ignorable_clip_lcd'])
458 blacklist(['vk', 'gm', '_', 'xfermodeimagefilter'])
459 match.append('~ApplyGamma')
460 match.append('~ComposedImageFilterBounds_Gpu')
461 match.append('~ImageFilterFailAffectsTransparentBlack_Gpu')
462 match.append('~ImageFilterZeroBlurSigma_Gpu')
463 match.append('~ImageNewShader_GPU')
464 match.append('~NewTextureFromPixmap')
465 match.append('~ReadPixels_Gpu')
466 match.append('~ReadPixels_Texture')
467 match.append('~ReadWriteAlpha')
468 match.append('~SRGBReadWritePixels')
469 match.append('~SpecialImage_DeferredGpu')
470 match.append('~SpecialImage_Gpu')
471 match.append('~WritePixels_Gpu')
472 match.append('~XfermodeImageFilterCroppedInput_Gpu')
473
Eric Boren7e97dc02017-02-02 09:02:37 -0500474 if 'IntelIris540' in bot and 'ANGLE' in bot:
475 match.append('~IntTexture') # skia:6086
Ben Wagnerae5a8712017-02-07 15:01:41 -0500476 blacklist(['_', 'gm', '_', 'discard']) # skia:6141
477 # skia:6103
478 for config in ['angle_d3d9_es2', 'angle_d3d11_es2', 'angle_gl_es2']:
479 blacklist([config, 'gm', '_', 'multipicturedraw_invpathclip_simple'])
480 blacklist([config, 'gm', '_', 'multipicturedraw_noclip_simple'])
481 blacklist([config, 'gm', '_', 'multipicturedraw_pathclip_simple'])
482 blacklist([config, 'gm', '_', 'multipicturedraw_rectclip_simple'])
483 blacklist([config, 'gm', '_', 'multipicturedraw_rrectclip_simple'])
Eric Boren7e97dc02017-02-02 09:02:37 -0500484
Ben Wagnerc119a2f2017-03-23 17:26:12 -0400485 if 'IntelBayTrail' in bot and 'Ubuntu' in bot:
486 match.append('~ImageStorageLoad') # skia:6358
487
Kevin Lubick03964342017-02-21 07:58:16 -0500488 if 'Vivante' in bot:
489 # This causes the bot to spin for >3.5 hours.
490 blacklist(['_', 'gm', '_', 'scaled_tilemodes_npot'])
491
Eric Boren7e97dc02017-02-02 09:02:37 -0500492 if blacklisted:
493 args.append('--blacklist')
494 args.extend(blacklisted)
495
496 if match:
497 args.append('--match')
498 args.extend(match)
499
500 # These bots run out of memory running RAW codec tests. Do not run them in
501 # parallel
502 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
503 or 'Win8-MSVC-ShuttleB' in bot):
504 args.append('--noRAW_threading')
505
506 return args
507
508
509def key_params(api):
510 """Build a unique key from the builder name (as a list).
511
512 E.g. arch x86 gpu GeForce320M mode MacMini4.1 os Mac10.6
513 """
514 # Don't bother to include role, which is always Test.
515 # TryBots are uploaded elsewhere so they can use the same key.
516 blacklist = ['role', 'is_trybot']
517
518 flat = []
519 for k in sorted(api.vars.builder_cfg.keys()):
520 if k not in blacklist:
521 flat.append(k)
522 flat.append(api.vars.builder_cfg[k])
523 return flat
524
525
526def test_steps(api):
527 """Run the DM test."""
528 use_hash_file = False
529 if api.vars.upload_dm_results:
530 # This must run before we write anything into
531 # api.flavor.device_dirs.dm_dir or we may end up deleting our
532 # output on machines where they're the same.
533 api.flavor.create_clean_host_dir(api.vars.dm_dir)
534 host_dm_dir = str(api.vars.dm_dir)
535 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
536 if host_dm_dir != device_dm_dir:
537 api.flavor.create_clean_device_dir(device_dm_dir)
538
539 # Obtain the list of already-generated hashes.
540 hash_filename = 'uninteresting_hashes.txt'
541
542 # Ensure that the tmp_dir exists.
543 api.run.run_once(api.file.makedirs,
544 'tmp_dir',
545 api.vars.tmp_dir,
546 infra_step=True)
547
548 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
549 hashes_file = api.flavor.device_path_join(
550 api.flavor.device_dirs.tmp_dir, hash_filename)
551 api.run(
552 api.python.inline,
553 'get uninteresting hashes',
554 program="""
555 import contextlib
556 import math
557 import socket
558 import sys
559 import time
560 import urllib2
561
562 HASHES_URL = 'https://gold.skia.org/_/hashes'
563 RETRIES = 5
564 TIMEOUT = 60
565 WAIT_BASE = 15
566
567 socket.setdefaulttimeout(TIMEOUT)
568 for retry in range(RETRIES):
569 try:
570 with contextlib.closing(
571 urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:
572 hashes = w.read()
573 with open(sys.argv[1], 'w') as f:
574 f.write(hashes)
575 break
576 except Exception as e:
577 print 'Failed to get uninteresting hashes from %s:' % HASHES_URL
578 print e
579 if retry == RETRIES:
580 raise
581 waittime = WAIT_BASE * math.pow(2, retry)
582 print 'Retry in %d seconds.' % waittime
583 time.sleep(waittime)
584 """,
585 args=[host_hashes_file],
Eric Boren7e97dc02017-02-02 09:02:37 -0500586 abort_on_failure=False,
587 fail_build_on_failure=False,
588 infra_step=True)
589
590 if api.path.exists(host_hashes_file):
591 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
592 use_hash_file = True
593
594 # Run DM.
595 properties = [
596 'gitHash', api.vars.got_revision,
597 'master', api.vars.master_name,
598 'builder', api.vars.builder_name,
599 'build_number', api.vars.build_number,
600 ]
601 if api.vars.is_trybot:
602 properties.extend([
603 'issue', api.vars.issue,
604 'patchset', api.vars.patchset,
605 'patch_storage', api.vars.patch_storage,
606 ])
607 if api.vars.no_buildbot:
608 properties.extend(['no_buildbot', 'True'])
609 properties.extend(['swarming_bot_id', api.vars.swarming_bot_id])
610 properties.extend(['swarming_task_id', api.vars.swarming_task_id])
611
612 args = [
613 'dm',
614 '--undefok', # This helps branches that may not know new flags.
615 '--resourcePath', api.flavor.device_dirs.resource_dir,
616 '--skps', api.flavor.device_dirs.skp_dir,
617 '--images', api.flavor.device_path_join(
618 api.flavor.device_dirs.images_dir, 'dm'),
619 '--colorImages', api.flavor.device_path_join(
620 api.flavor.device_dirs.images_dir, 'colorspace'),
621 '--nameByHash',
622 '--properties'
623 ] + properties
624
625 args.extend(['--svgs', api.flavor.device_dirs.svg_dir])
626
627 args.append('--key')
628 args.extend(key_params(api))
629 if use_hash_file:
630 args.extend(['--uninterestingHashesFile', hashes_file])
631 if api.vars.upload_dm_results:
632 args.extend(['--writePath', api.flavor.device_dirs.dm_dir])
633
634 skip_flag = None
635 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
636 skip_flag = '--nogpu'
637 elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
638 skip_flag = '--nocpu'
639 if skip_flag:
640 args.append(skip_flag)
641 args.extend(dm_flags(api.vars.builder_name))
642
Eric Borenbbb24f22017-03-21 08:20:33 -0400643 env = api.step.get_from_context('env', {})
Kevin Lubick35115eb2017-02-17 10:25:34 -0500644 if 'Ubuntu16' in api.vars.builder_name:
645 # The vulkan in this asset name simply means that the graphics driver
646 # supports Vulkan. It is also the driver used for GL code.
Kevin Lubick0a51b482017-02-06 12:45:29 -0500647 dri_path = api.vars.slave_dir.join('linux_vulkan_intel_driver_release')
648 if 'Debug' in api.vars.builder_name:
649 dri_path = api.vars.slave_dir.join('linux_vulkan_intel_driver_debug')
650
Kevin Lubick35115eb2017-02-17 10:25:34 -0500651 if 'Vulkan' in api.vars.builder_name:
652 sdk_path = api.vars.slave_dir.join('linux_vulkan_sdk', 'bin')
653 lib_path = api.vars.slave_dir.join('linux_vulkan_sdk', 'lib')
654 env.update({
655 'PATH':'%%(PATH)s:%s' % sdk_path,
656 'LD_LIBRARY_PATH': '%s:%s' % (lib_path, dri_path),
657 'LIBGL_DRIVERS_PATH': dri_path,
658 'VK_ICD_FILENAMES':'%s' % dri_path.join('intel_icd.x86_64.json'),
659 })
660 else:
661 # Even the non-vulkan NUC jobs could benefit from the newer drivers.
662 env.update({
663 'LD_LIBRARY_PATH': dri_path,
664 'LIBGL_DRIVERS_PATH': dri_path,
665 })
Kevin Lubick0a51b482017-02-06 12:45:29 -0500666
Ben Wagner46df2a12017-02-21 19:10:24 -0500667 # See skia:2789.
668 if '_AbandonGpuContext' in api.vars.builder_cfg.get('extra_config', ''):
669 args.append('--abandonGpuContext')
670 if '_PreAbandonGpuContext' in api.vars.builder_cfg.get('extra_config', ''):
671 args.append('--preAbandonGpuContext')
672
Eric Boren53262d02017-03-20 15:40:12 -0400673 with api.step.context({'env': env}):
674 api.run(api.flavor.step, 'dm', cmd=args, abort_on_failure=False)
Eric Boren7e97dc02017-02-02 09:02:37 -0500675
676 if api.vars.upload_dm_results:
677 # Copy images and JSON to host machine if needed.
678 api.flavor.copy_directory_contents_to_host(
679 api.flavor.device_dirs.dm_dir, api.vars.dm_dir)
680
Eric Boren7e97dc02017-02-02 09:02:37 -0500681
682class TestApi(recipe_api.RecipeApi):
683 def run(self):
684 self.m.core.setup()
Eric Borenbbb24f22017-03-21 08:20:33 -0400685 env = self.m.step.get_from_context('env', {})
Mike Klein3b36c062017-02-06 13:44:12 -0500686 if 'iOS' in self.m.vars.builder_name:
Eric Borenbbb24f22017-03-21 08:20:33 -0400687 env['IOS_BUNDLE_ID'] = 'com.google.dm'
688 with self.m.step.context({'env': env}):
689 try:
690 self.m.flavor.install_everything()
691 test_steps(self.m)
692 finally:
693 self.m.flavor.cleanup_steps()
694 self.m.run.check_failure()