blob: 5445fe37fca55a43ce51a1544343f01391fc509c [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': [
mtkleindf5df812016-09-12 12:24:38 -070027 'Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android',
mtklein122fac32016-09-19 07:26:41 -070028 'Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-GN_Android',
Ben Wagner52245152016-11-02 13:11:05 -040029 'Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-GN_Android',
mtklein122fac32016-09-19 07:26:41 -070030 'Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-GN_Android',
31 'Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-GN_Android',
32 'Test-Android-Clang-Nexus6-GPU-Adreno420-arm-Debug-GN_Android',
egdaniel15ba6d92016-09-20 12:39:29 -070033 'Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-GN_Android_Vulkan',
mtklein122fac32016-09-19 07:26:41 -070034 'Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-GN_Android',
35 'Test-Android-Clang-Nexus9-CPU-Denver-arm64-Debug-GN_Android',
36 'Test-Android-Clang-NexusPlayer-CPU-SSE4-x86-Release-GN_Android',
borenet2c3112d2016-08-05 06:30:10 -070037 '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',
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',
mtklein2b3c2a32016-09-08 08:39:34 -070042 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN',
borenet1ed2ae42016-07-26 11:52:17 -070043 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
rmistrybcba19d2016-08-11 12:36:58 -070044 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared',
borenet2c3112d2016-08-05 06:30:10 -070045 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
borenet1ed2ae42016-07-26 11:52:17 -070046 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
borenet2c3112d2016-08-05 06:30:10 -070047 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan',
borenet1ed2ae42016-07-26 11:52:17 -070048 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot',
borenet2c3112d2016-08-05 06:30:10 -070049 'Test-Win8-MSVC-ShuttleB-GPU-GTX960-x86_64-Debug-ANGLE',
mtkleindf5df812016-09-12 12:24:38 -070050 'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug',
borenet1ed2ae42016-07-26 11:52:17 -070051 ],
52 },
53}
54
55
borenete2251ac2016-08-05 05:40:59 -070056def dm_flags(bot):
57 args = []
58
59 # 32-bit desktop bots tend to run out of memory, because they have relatively
60 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit.
61 if '-x86-' in bot and not 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -070062 args.extend('--threads 4'.split(' '))
borenete2251ac2016-08-05 05:40:59 -070063
64 # These are the canonical configs that we would ideally run on all bots. We
65 # may opt out or substitute some below for specific bots
Ben Wagner52245152016-11-02 13:11:05 -040066 configs = ['8888', 'gpu', 'gpudft', 'gpusrgb', 'pdf']
borenete2251ac2016-08-05 05:40:59 -070067 # Add in either msaa4 or msaa16 to the canonical set of configs to run
68 if 'Android' in bot or 'iOS' in bot:
69 configs.append('msaa4')
70 else:
71 configs.append('msaa16')
72
Ben Wagner52245152016-11-02 13:11:05 -040073 # The NP produces a long error stream when we run with MSAA. The Tegra3 just
74 # doesn't support it.
75 if ('NexusPlayer' in bot or
borenete2251ac2016-08-05 05:40:59 -070076 'Tegra3' in bot or
Ben Wagnera2225492016-11-03 09:04:31 -040077 # We aren't interested in fixing msaa bugs on iPad4.
78 'iPad4' in bot or
benjaminwagnerbc02cae2016-09-23 17:45:45 -070079 # skia:5792
80 'iHD530' in bot):
borenete2251ac2016-08-05 05:40:59 -070081 configs = [x for x in configs if 'msaa' not in x]
82
Ben Wagner52245152016-11-02 13:11:05 -040083 # Runs out of memory on Android bots. Everyone else seems fine.
84 if 'Android' in bot:
borenete2251ac2016-08-05 05:40:59 -070085 configs.remove('pdf')
86
87 if '-GCE-' in bot:
mtklein896ddb72016-09-14 10:33:12 -070088 configs.extend(['565'])
borenete2251ac2016-08-05 05:40:59 -070089 configs.extend(['f16', 'srgb']) # Gamma-correct formats.
90 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
mtklein03591a72016-08-07 13:35:46 -070091 configs.extend(['lite-8888']) # Experimental display list.
borenete2251ac2016-08-05 05:40:59 -070092
93 if '-TSAN' not in bot:
94 if ('TegraK1' in bot or
95 'TegraX1' in bot or
96 'GTX550Ti' in bot or
97 'GTX660' in bot or
98 'GT610' in bot):
99 if 'Android' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700100 configs.append('nvprdit4')
borenete2251ac2016-08-05 05:40:59 -0700101 else:
102 configs.append('nvprdit16')
103
104 # We want to test the OpenGL config not the GLES config on the X1
borenet2c3112d2016-08-05 06:30:10 -0700105 if 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700106 configs = [x.replace('gpu', 'gl') for x in configs]
107 configs = [x.replace('msaa', 'glmsaa') for x in configs]
108 configs = [x.replace('nvpr', 'glnvpr') for x in configs]
109
110 # NP is running out of RAM when we run all these modes. skia:3255
111 if 'NexusPlayer' not in bot:
112 configs.extend(mode + '-8888' for mode in
113 ['serialize', 'tiles_rt', 'pic'])
114
borenete2251ac2016-08-05 05:40:59 -0700115 # Test instanced rendering on a limited number of platforms
borenet2c3112d2016-08-05 06:30:10 -0700116 if 'Nexus6' in bot:
borenete2251ac2016-08-05 05:40:59 -0700117 configs.append('esinst') # esinst4 isn't working yet on Adreno.
borenet2c3112d2016-08-05 06:30:10 -0700118 elif 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700119 # Multisampled instanced configs use nvpr.
120 configs = [x.replace('glnvpr', 'glinst') for x in configs]
121 configs.append('glinst')
122 elif 'MacMini6.2' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700123 configs.extend(['glinst', 'glinst16'])
borenete2251ac2016-08-05 05:40:59 -0700124
125 # CommandBuffer bot *only* runs the command_buffer config.
126 if 'CommandBuffer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700127 configs = ['commandbuffer']
borenete2251ac2016-08-05 05:40:59 -0700128
Brian Salomon02906202016-10-18 13:36:32 -0400129 # ANGLE bot *only* runs the angle configs
130 if 'ANGLE' in bot:
Brian Salomon4a5e49d2016-10-20 10:14:45 -0400131 configs = ['angle_d3d11_es2',
132 'angle_d3d9_es2',
133 'angle_d3d11_es2_msaa4',
134 'angle_gl_es2']
Brian Salomon02906202016-10-18 13:36:32 -0400135
borenete2251ac2016-08-05 05:40:59 -0700136 # Vulkan bot *only* runs the vk config.
137 if 'Vulkan' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700138 configs = ['vk']
borenete2251ac2016-08-05 05:40:59 -0700139
140 args.append('--config')
141 args.extend(configs)
142
143 # Run tests, gms, and image decoding tests everywhere.
rmistry70c43ef2016-08-12 07:25:53 -0700144 args.extend('--src tests gm image colorImage svg'.split(' '))
borenete2251ac2016-08-05 05:40:59 -0700145
146 if 'GalaxyS' in bot:
147 args.extend(('--threads', '0'))
148
mtklein09b352f2016-09-15 06:24:03 -0700149 blacklisted = []
150 def blacklist(quad):
151 config, src, options, name = quad.split(' ') if type(quad) is str else quad
152 if config == '_' or config in configs:
153 blacklisted.extend([config, src, options, name])
borenete2251ac2016-08-05 05:40:59 -0700154
155 # TODO: ???
mtklein09b352f2016-09-15 06:24:03 -0700156 blacklist('f16 _ _ dstreadshuffle')
157 blacklist('f16 image _ _')
158 blacklist('srgb image _ _')
159 blacklist('gpusrgb image _ _')
mtklein1bf8e6e2016-09-15 11:02:05 -0700160 blacklist('glsrgb image _ _')
borenete2251ac2016-08-05 05:40:59 -0700161
162 if 'Valgrind' in bot:
163 # These take 18+ hours to run.
mtklein09b352f2016-09-15 06:24:03 -0700164 blacklist('pdf gm _ fontmgr_iter')
165 blacklist('pdf _ _ PANO_20121023_214540.jpg')
166 blacklist('pdf skp _ worldjournal')
167 blacklist('pdf skp _ desk_baidu.skp')
168 blacklist('pdf skp _ desk_wikipedia.skp')
fmalita7de57792016-10-03 11:07:36 -0700169 blacklist('_ svg _ _')
borenete2251ac2016-08-05 05:40:59 -0700170
171 if 'iOS' in bot:
mtklein09b352f2016-09-15 06:24:03 -0700172 blacklist('gpu skp _ _')
173 blacklist('msaa skp _ _')
174 blacklist('msaa16 gm _ tilemodesProcess')
borenete2251ac2016-08-05 05:40:59 -0700175
176 if 'Mac' in bot or 'iOS' in bot:
177 # CG fails on questionable bmps
mtklein09b352f2016-09-15 06:24:03 -0700178 blacklist('_ image gen_platf rgba32abf.bmp')
179 blacklist('_ image gen_platf rgb24prof.bmp')
180 blacklist('_ image gen_platf rgb24lprof.bmp')
181 blacklist('_ image gen_platf 8bpp-pixeldata-cropped.bmp')
182 blacklist('_ image gen_platf 4bpp-pixeldata-cropped.bmp')
183 blacklist('_ image gen_platf 32bpp-pixeldata-cropped.bmp')
184 blacklist('_ image gen_platf 24bpp-pixeldata-cropped.bmp')
borenete2251ac2016-08-05 05:40:59 -0700185
186 # CG has unpredictable behavior on this questionable gif
187 # It's probably using uninitialized memory
mtklein09b352f2016-09-15 06:24:03 -0700188 blacklist('_ image gen_platf frame_larger_than_image.gif')
borenete2251ac2016-08-05 05:40:59 -0700189
msarett16b15dd2016-09-20 05:50:16 -0700190 # CG has unpredictable behavior on incomplete pngs
191 # skbug.com/5774
192 blacklist('_ image gen_platf inc0.png')
193 blacklist('_ image gen_platf inc1.png')
194 blacklist('_ image gen_platf inc2.png')
195 blacklist('_ image gen_platf inc3.png')
196 blacklist('_ image gen_platf inc4.png')
197 blacklist('_ image gen_platf inc5.png')
198 blacklist('_ image gen_platf inc6.png')
199 blacklist('_ image gen_platf inc7.png')
200 blacklist('_ image gen_platf inc8.png')
201 blacklist('_ image gen_platf inc9.png')
202 blacklist('_ image gen_platf inc10.png')
203 blacklist('_ image gen_platf inc11.png')
204 blacklist('_ image gen_platf inc12.png')
205 blacklist('_ image gen_platf inc13.png')
206 blacklist('_ image gen_platf inc14.png')
207
borenete2251ac2016-08-05 05:40:59 -0700208 # WIC fails on questionable bmps
209 if 'Win' in bot:
mtklein09b352f2016-09-15 06:24:03 -0700210 blacklist('_ image gen_platf rle8-height-negative.bmp')
211 blacklist('_ image gen_platf rle4-height-negative.bmp')
212 blacklist('_ image gen_platf pal8os2v2.bmp')
213 blacklist('_ image gen_platf pal8os2v2-16.bmp')
214 blacklist('_ image gen_platf rgba32abf.bmp')
215 blacklist('_ image gen_platf rgb24prof.bmp')
216 blacklist('_ image gen_platf rgb24lprof.bmp')
217 blacklist('_ image gen_platf 8bpp-pixeldata-cropped.bmp')
218 blacklist('_ image gen_platf 4bpp-pixeldata-cropped.bmp')
219 blacklist('_ image gen_platf 32bpp-pixeldata-cropped.bmp')
220 blacklist('_ image gen_platf 24bpp-pixeldata-cropped.bmp')
borenete2251ac2016-08-05 05:40:59 -0700221 if 'x86_64' in bot and 'CPU' in bot:
222 # This GM triggers a SkSmallAllocator assert.
mtklein09b352f2016-09-15 06:24:03 -0700223 blacklist('_ gm _ composeshader_bitmap')
borenete2251ac2016-08-05 05:40:59 -0700224
225 if 'Android' in bot or 'iOS' in bot:
226 # This test crashes the N9 (perhaps because of large malloc/frees). It also
227 # is fairly slow and not platform-specific. So we just disable it on all of
228 # Android and iOS. skia:5438
mtklein09b352f2016-09-15 06:24:03 -0700229 blacklist('_ test _ GrShape')
borenete2251ac2016-08-05 05:40:59 -0700230
231 if 'Win8' in bot:
232 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with
233 # 'Unexpected error' from DirectWrite"
mtklein09b352f2016-09-15 06:24:03 -0700234 blacklist('_ gm _ fontscalerdistortable')
fmalitab5b6de92016-08-16 07:08:48 -0700235 # skia:5636
mtklein09b352f2016-09-15 06:24:03 -0700236 blacklist('_ svg _ Nebraska-StateSeal.svg')
borenete2251ac2016-08-05 05:40:59 -0700237
238 # skia:4095
239 bad_serialize_gms = ['bleed_image',
240 'c_gms',
241 'colortype',
242 'colortype_xfermodes',
243 'drawfilter',
244 'fontmgr_bounds_0.75_0',
245 'fontmgr_bounds_1_-0.25',
246 'fontmgr_bounds',
247 'fontmgr_match',
fmalitace2fc6a2016-08-26 10:13:39 -0700248 'fontmgr_iter',
249 'imagemasksubset']
borenete2251ac2016-08-05 05:40:59 -0700250
251 # skia:5589
252 bad_serialize_gms.extend(['bitmapfilters',
253 'bitmapshaders',
254 'bleed',
255 'bleed_alpha_bmp',
256 'bleed_alpha_bmp_shader',
257 'convex_poly_clip',
258 'extractalpha',
259 'filterbitmap_checkerboard_32_32_g8',
260 'filterbitmap_image_mandrill_64',
261 'shadows',
262 'simpleaaclip_aaclip'])
263 # skia:5595
264 bad_serialize_gms.extend(['composeshader_bitmap',
265 'scaled_tilemodes_npot',
266 'scaled_tilemodes'])
mtklein768dc8f2016-09-20 15:41:29 -0700267 # skia:5778
268 bad_serialize_gms.append('typefacerendering_pfaMac')
borenete2251ac2016-08-05 05:40:59 -0700269 for test in bad_serialize_gms:
mtklein09b352f2016-09-15 06:24:03 -0700270 blacklist(['serialize-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700271
272 if 'Mac' not in bot:
273 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
mtklein09b352f2016-09-15 06:24:03 -0700274 blacklist(['serialize-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700275 # 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']:
mtklein09b352f2016-09-15 06:24:03 -0700278 blacklist(['serialize-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700279
280 # skia:4769
281 for test in ['drawfilter']:
mtklein09b352f2016-09-15 06:24:03 -0700282 blacklist([ 'sp-8888', 'gm', '_', test])
283 blacklist([ 'pic-8888', 'gm', '_', test])
284 blacklist(['2ndpic-8888', 'gm', '_', test])
285 blacklist([ 'lite-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700286 # skia:4703
287 for test in ['image-cacherator-from-picture',
288 'image-cacherator-from-raster',
289 'image-cacherator-from-ctable']:
mtklein09b352f2016-09-15 06:24:03 -0700290 blacklist([ 'sp-8888', 'gm', '_', test])
291 blacklist([ 'pic-8888', 'gm', '_', test])
292 blacklist([ '2ndpic-8888', 'gm', '_', test])
293 blacklist(['serialize-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700294
fmalitaed387722016-09-30 06:14:49 -0700295 # GM that requires raster-backed canvas
296 for test in ['gamut']:
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
borenete2251ac2016-08-05 05:40:59 -0700303 # Extensions for RAW images
304 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
305 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
306
307 # skbug.com/4888
308 # Blacklist RAW images (and a few large PNGs) on GPU bots
309 # until we can resolve failures
310 if 'GPU' in bot:
mtklein09b352f2016-09-15 06:24:03 -0700311 blacklist('_ image _ interlaced1.png')
312 blacklist('_ image _ interlaced2.png')
313 blacklist('_ image _ interlaced3.png')
borenete2251ac2016-08-05 05:40:59 -0700314 for raw_ext in r:
mtklein09b352f2016-09-15 06:24:03 -0700315 blacklist('_ image _ .%s' % raw_ext)
borenete2251ac2016-08-05 05:40:59 -0700316
borenet2c3112d2016-08-05 06:30:10 -0700317 if 'Nexus9' in bot:
borenete2251ac2016-08-05 05:40:59 -0700318 for raw_ext in r:
mtklein09b352f2016-09-15 06:24:03 -0700319 blacklist('_ image _ .%s' % raw_ext)
borenete2251ac2016-08-05 05:40:59 -0700320
321 # Large image that overwhelms older Mac bots
borenet2c3112d2016-08-05 06:30:10 -0700322 if 'MacMini4.1-GPU' in bot:
mtklein09b352f2016-09-15 06:24:03 -0700323 blacklist('_ image _ abnormal.wbmp')
324 blacklist(['msaa16', 'gm', '_', 'blurcircles'])
borenete2251ac2016-08-05 05:40:59 -0700325
326 match = []
327 if 'Valgrind' in bot: # skia:3021
328 match.append('~Threaded')
329
borenete2251ac2016-08-05 05:40:59 -0700330 if 'AndroidOne' in bot: # skia:4711
borenet2c3112d2016-08-05 06:30:10 -0700331 match.append('~WritePixels')
borenete2251ac2016-08-05 05:40:59 -0700332
333 if 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700334 match.append('~ResourceCache')
borenete2251ac2016-08-05 05:40:59 -0700335
336 if 'Nexus10' in bot: # skia:5509
borenet2c3112d2016-08-05 06:30:10 -0700337 match.append('~CopySurface')
borenete2251ac2016-08-05 05:40:59 -0700338
borenet2c3112d2016-08-05 06:30:10 -0700339 if 'ANGLE' in bot and 'Debug' in bot:
borenete2251ac2016-08-05 05:40:59 -0700340 match.append('~GLPrograms') # skia:4717
341
342 if 'MSAN' in bot:
343 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
344
borenet2c3112d2016-08-05 06:30:10 -0700345 if 'TSAN' in bot:
borenete2251ac2016-08-05 05:40:59 -0700346 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
Mike Klein4d7bb932016-10-19 12:18:01 -0400347 match.extend(['~RGBA4444TextureTest', # Flakier than they are important.
348 '~RGB565TextureTest'])
borenete2251ac2016-08-05 05:40:59 -0700349
egdaniel15ba6d92016-09-20 12:39:29 -0700350 if 'Vulkan' in bot and 'Adreno' in bot:
351 # skia:5777
352 match.extend(['~XfermodeImageFilterCroppedInput',
353 '~GrTextureStripAtlasFlush',
354 '~CopySurface'])
355
mtklein09b352f2016-09-15 06:24:03 -0700356 if blacklisted:
borenete2251ac2016-08-05 05:40:59 -0700357 args.append('--blacklist')
mtklein09b352f2016-09-15 06:24:03 -0700358 args.extend(blacklisted)
borenete2251ac2016-08-05 05:40:59 -0700359
360 if match:
361 args.append('--match')
362 args.extend(match)
363
364 # These bots run out of memory running RAW codec tests. Do not run them in
365 # parallel
366 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
367 or 'Win8-MSVC-ShuttleB' in bot):
368 args.append('--noRAW_threading')
369
370 return args
371
372
borenetbc20a702016-08-03 10:38:44 -0700373def key_params(api):
374 """Build a unique key from the builder name (as a list).
375
376 E.g. arch x86 gpu GeForce320M mode MacMini4.1 os Mac10.6
377 """
378 # Don't bother to include role, which is always Test.
379 # TryBots are uploaded elsewhere so they can use the same key.
380 blacklist = ['role', 'is_trybot']
381
382 flat = []
383 for k in sorted(api.vars.builder_cfg.keys()):
384 if k not in blacklist:
385 flat.append(k)
386 flat.append(api.vars.builder_cfg[k])
387 return flat
388
389
390def test_steps(api):
391 """Run the DM test."""
392 use_hash_file = False
393 if api.vars.upload_dm_results:
394 # This must run before we write anything into
395 # api.flavor.device_dirs.dm_dir or we may end up deleting our
396 # output on machines where they're the same.
397 api.flavor.create_clean_host_dir(api.vars.dm_dir)
398 host_dm_dir = str(api.vars.dm_dir)
399 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
400 if host_dm_dir != device_dm_dir:
401 api.flavor.create_clean_device_dir(device_dm_dir)
402
403 # Obtain the list of already-generated hashes.
404 hash_filename = 'uninteresting_hashes.txt'
405
406 # Ensure that the tmp_dir exists.
407 api.run.run_once(api.file.makedirs,
408 'tmp_dir',
409 api.vars.tmp_dir,
410 infra_step=True)
411
412 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
413 hashes_file = api.flavor.device_path_join(
414 api.flavor.device_dirs.tmp_dir, hash_filename)
415 api.run(
416 api.python.inline,
417 'get uninteresting hashes',
418 program="""
419 import contextlib
420 import math
421 import socket
422 import sys
423 import time
424 import urllib2
425
426 HASHES_URL = 'https://gold.skia.org/_/hashes'
427 RETRIES = 5
428 TIMEOUT = 60
429 WAIT_BASE = 15
430
431 socket.setdefaulttimeout(TIMEOUT)
432 for retry in range(RETRIES):
433 try:
434 with contextlib.closing(
435 urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:
436 hashes = w.read()
437 with open(sys.argv[1], 'w') as f:
438 f.write(hashes)
439 break
440 except Exception as e:
441 print 'Failed to get uninteresting hashes from %s:' % HASHES_URL
442 print e
443 if retry == RETRIES:
444 raise
445 waittime = WAIT_BASE * math.pow(2, retry)
446 print 'Retry in %d seconds.' % waittime
447 time.sleep(waittime)
448 """,
449 args=[host_hashes_file],
450 cwd=api.vars.skia_dir,
451 abort_on_failure=False,
452 fail_build_on_failure=False,
453 infra_step=True)
454
455 if api.path.exists(host_hashes_file):
456 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
457 use_hash_file = True
458
459 # Run DM.
460 properties = [
461 'gitHash', api.vars.got_revision,
462 'master', api.vars.master_name,
463 'builder', api.vars.builder_name,
464 'build_number', api.vars.build_number,
465 ]
466 if api.vars.is_trybot:
467 properties.extend([
rmistry3f1c9c02016-08-24 05:07:06 -0700468 'issue', api.vars.issue,
469 'patchset', api.vars.patchset,
470 'patch_storage', api.vars.patch_storage,
borenetbc20a702016-08-03 10:38:44 -0700471 ])
borenetbfa5b452016-10-19 10:13:32 -0700472 if api.vars.no_buildbot:
473 properties.extend(['no_buildbot', 'True'])
474 properties.extend(['swarming_bot_id', api.vars.swarming_bot_id])
475 properties.extend(['swarming_task_id', api.vars.swarming_task_id])
borenetbc20a702016-08-03 10:38:44 -0700476
477 args = [
478 'dm',
479 '--undefok', # This helps branches that may not know new flags.
480 '--resourcePath', api.flavor.device_dirs.resource_dir,
481 '--skps', api.flavor.device_dirs.skp_dir,
482 '--images', api.flavor.device_path_join(
483 api.flavor.device_dirs.images_dir, 'dm'),
484 '--colorImages', api.flavor.device_path_join(
485 api.flavor.device_dirs.images_dir, 'colorspace'),
486 '--nameByHash',
487 '--properties'
488 ] + properties
489
rmistry70c43ef2016-08-12 07:25:53 -0700490 args.extend(['--svgs', api.flavor.device_dirs.svg_dir])
rmistrybcba19d2016-08-11 12:36:58 -0700491
borenetbc20a702016-08-03 10:38:44 -0700492 args.append('--key')
493 args.extend(key_params(api))
494 if use_hash_file:
495 args.extend(['--uninterestingHashesFile', hashes_file])
496 if api.vars.upload_dm_results:
497 args.extend(['--writePath', api.flavor.device_dirs.dm_dir])
498
499 skip_flag = None
500 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
501 skip_flag = '--nogpu'
502 elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
503 skip_flag = '--nocpu'
504 if skip_flag:
505 args.append(skip_flag)
borenete2251ac2016-08-05 05:40:59 -0700506 args.extend(dm_flags(api.vars.builder_name))
borenetbc20a702016-08-03 10:38:44 -0700507
508 api.run(api.flavor.step, 'dm', cmd=args,
borenetd460a3c2016-08-05 05:18:05 -0700509 abort_on_failure=False,
510 env=api.vars.default_env)
borenetbc20a702016-08-03 10:38:44 -0700511
512 if api.vars.upload_dm_results:
513 # Copy images and JSON to host machine if needed.
514 api.flavor.copy_directory_contents_to_host(
515 api.flavor.device_dirs.dm_dir, api.vars.dm_dir)
516
517 # See skia:2789.
518 if ('Valgrind' in api.vars.builder_name and
519 api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU'):
520 abandonGpuContext = list(args)
521 abandonGpuContext.append('--abandonGpuContext')
522 api.run(api.flavor.step, 'dm --abandonGpuContext',
523 cmd=abandonGpuContext, abort_on_failure=False)
524 preAbandonGpuContext = list(args)
525 preAbandonGpuContext.append('--preAbandonGpuContext')
526 api.run(api.flavor.step, 'dm --preAbandonGpuContext',
527 cmd=preAbandonGpuContext, abort_on_failure=False,
528 env=api.vars.default_env)
529
530
borenet1ed2ae42016-07-26 11:52:17 -0700531def RunSteps(api):
borenet1436a092016-08-03 08:23:10 -0700532 api.core.setup()
mtkleindf5df812016-09-12 12:24:38 -0700533 try:
534 api.flavor.install()
535 test_steps(api)
536 finally:
537 api.flavor.cleanup_steps()
borenet1436a092016-08-03 08:23:10 -0700538 api.run.check_failure()
borenet1ed2ae42016-07-26 11:52:17 -0700539
540
541def GenTests(api):
borenet1ed2ae42016-07-26 11:52:17 -0700542 for mastername, slaves in TEST_BUILDERS.iteritems():
543 for slavename, builders_by_slave in slaves.iteritems():
544 for builder in builders_by_slave:
545 test = (
546 api.test(builder) +
547 api.properties(buildername=builder,
548 mastername=mastername,
549 slavename=slavename,
550 buildnumber=5,
551 revision='abc123',
552 path_config='kitchen',
553 swarm_out_dir='[SWARM_OUT_DIR]') +
554 api.path.exists(
555 api.path['slave_build'].join('skia'),
556 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
557 'skimage', 'VERSION'),
558 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
559 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700560 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
561 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700562 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
563 )
564 )
borenet1ed2ae42016-07-26 11:52:17 -0700565 if 'Trybot' in builder:
566 test += api.properties(issue=500,
567 patchset=1,
568 rietveld='https://codereview.chromium.org')
569 if 'Win' in builder:
570 test += api.platform('win', 64)
571
572
573 yield test
574
575 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
576 yield (
577 api.test('failed_dm') +
578 api.properties(buildername=builder,
579 mastername='client.skia',
580 slavename='skiabot-linux-swarm-000',
581 buildnumber=6,
582 revision='abc123',
583 path_config='kitchen',
584 swarm_out_dir='[SWARM_OUT_DIR]') +
585 api.path.exists(
586 api.path['slave_build'].join('skia'),
587 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
588 'skimage', 'VERSION'),
589 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
590 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700591 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
592 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700593 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
594 ) +
595 api.step_data('dm', retcode=1)
596 )
597
mtklein122fac32016-09-19 07:26:41 -0700598 builder = 'Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-GN_Android'
borenet1ed2ae42016-07-26 11:52:17 -0700599 yield (
600 api.test('failed_get_hashes') +
601 api.properties(buildername=builder,
602 mastername='client.skia',
603 slavename='skiabot-linux-swarm-000',
604 buildnumber=6,
605 revision='abc123',
606 path_config='kitchen',
607 swarm_out_dir='[SWARM_OUT_DIR]') +
608 api.path.exists(
609 api.path['slave_build'].join('skia'),
610 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
611 'skimage', 'VERSION'),
612 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
613 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700614 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
615 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700616 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
617 ) +
borenet1ed2ae42016-07-26 11:52:17 -0700618 api.step_data('get uninteresting hashes', retcode=1)
619 )
620
mtklein122fac32016-09-19 07:26:41 -0700621 builder = 'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug'
borenet1ed2ae42016-07-26 11:52:17 -0700622 yield (
623 api.test('missing_SKP_VERSION_device') +
624 api.properties(buildername=builder,
625 mastername='client.skia',
626 slavename='skiabot-linux-swarm-000',
627 buildnumber=6,
628 revision='abc123',
629 path_config='kitchen',
630 swarm_out_dir='[SWARM_OUT_DIR]') +
631 api.path.exists(
632 api.path['slave_build'].join('skia'),
633 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
634 'skimage', 'VERSION'),
635 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
636 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700637 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
638 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700639 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
640 ) +
mtklein122fac32016-09-19 07:26:41 -0700641 api.step_data('read SKP_VERSION', retcode=1)
borenet1ed2ae42016-07-26 11:52:17 -0700642 )
643
644 builder = 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot'
645 yield (
646 api.test('big_issue_number') +
647 api.properties(buildername=builder,
648 mastername='client.skia.compile',
649 slavename='skiabot-linux-swarm-000',
650 buildnumber=5,
651 revision='abc123',
652 path_config='kitchen',
653 swarm_out_dir='[SWARM_OUT_DIR]',
654 rietveld='https://codereview.chromium.org',
655 patchset=1,
656 issue=2147533002L) +
657 api.path.exists(
658 api.path['slave_build'].join('skia'),
659 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
660 'skimage', 'VERSION'),
661 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
662 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700663 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
664 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700665 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
666 ) +
667 api.platform('win', 64)
668 )
rmistry3f1c9c02016-08-24 05:07:06 -0700669
670 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot'
rmistry3f1c9c02016-08-24 05:07:06 -0700671 yield (
672 api.test('recipe_with_gerrit_patch') +
673 api.properties(
674 buildername=builder,
675 mastername='client.skia',
676 slavename='skiabot-linux-swarm-000',
677 buildnumber=5,
678 path_config='kitchen',
679 swarm_out_dir='[SWARM_OUT_DIR]',
680 revision='abc123',
borenet96b38422016-10-27 06:35:51 -0700681 patch_storage='gerrit') +
682 api.properties.tryserver(
683 buildername=builder,
684 gerrit_project='skia',
685 gerrit_url='https://skia-review.googlesource.com/',
686 )
rmistry3f1c9c02016-08-24 05:07:06 -0700687 )
borenetbfa5b452016-10-19 10:13:32 -0700688
689 yield (
690 api.test('nobuildbot') +
691 api.properties(
692 buildername=builder,
693 mastername='client.skia',
694 slavename='skiabot-linux-swarm-000',
695 buildnumber=5,
696 path_config='kitchen',
697 swarm_out_dir='[SWARM_OUT_DIR]',
698 revision='abc123',
699 nobuildbot='True',
borenet96b38422016-10-27 06:35:51 -0700700 patch_storage='gerrit') +
701 api.properties.tryserver(
702 buildername=builder,
703 gerrit_project='skia',
704 gerrit_url='https://skia-review.googlesource.com/',
705 ) +
borenetbfa5b452016-10-19 10:13:32 -0700706 api.step_data('get swarming bot id',
707 stdout=api.raw_io.output('skia-bot-123')) +
708 api.step_data('get swarming task id', stdout=api.raw_io.output('123456'))
709 )