blob: 5b9d993f2e6733ae10008b862c9eb2ab2f42db37 [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(' '))
207
208 # skia:4095
209 bad_serialize_gms = ['bleed_image',
210 'c_gms',
211 'colortype',
212 'colortype_xfermodes',
213 'drawfilter',
214 'fontmgr_bounds_0.75_0',
215 'fontmgr_bounds_1_-0.25',
216 'fontmgr_bounds',
217 'fontmgr_match',
218 'fontmgr_iter']
219
220 # skia:5589
221 bad_serialize_gms.extend(['bitmapfilters',
222 'bitmapshaders',
223 'bleed',
224 'bleed_alpha_bmp',
225 'bleed_alpha_bmp_shader',
226 'convex_poly_clip',
227 'extractalpha',
228 'filterbitmap_checkerboard_32_32_g8',
229 'filterbitmap_image_mandrill_64',
230 'shadows',
231 'simpleaaclip_aaclip'])
232 # skia:5595
233 bad_serialize_gms.extend(['composeshader_bitmap',
234 'scaled_tilemodes_npot',
235 'scaled_tilemodes'])
236 for test in bad_serialize_gms:
237 blacklist.extend(['serialize-8888', 'gm', '_', test])
238
239 if 'Mac' not in bot:
240 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
241 blacklist.extend(['serialize-8888', 'gm', '_', test])
242 # It looks like we skip these only for out-of-memory concerns.
243 if 'Win' in bot or 'Android' in bot:
244 for test in ['verylargebitmap', 'verylarge_picture_image']:
245 blacklist.extend(['serialize-8888', 'gm', '_', test])
246
247 # skia:4769
248 for test in ['drawfilter']:
249 blacklist.extend([ 'sp-8888', 'gm', '_', test])
250 blacklist.extend([ 'pic-8888', 'gm', '_', test])
251 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein03591a72016-08-07 13:35:46 -0700252 blacklist.extend([ 'lite-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700253 # skia:4703
254 for test in ['image-cacherator-from-picture',
255 'image-cacherator-from-raster',
256 'image-cacherator-from-ctable']:
257 blacklist.extend([ 'sp-8888', 'gm', '_', test])
258 blacklist.extend([ 'pic-8888', 'gm', '_', test])
259 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
260 blacklist.extend(['serialize-8888', 'gm', '_', test])
261
fmalita6fb06482016-08-15 12:45:11 -0700262 # SaveLayerDrawRestoreNooper diffs
263 for test in ['car.svg',
264 'gallardo.svg',
265 'rg1024_green_grapes.svg',
266 'Seal_of_Kansas.svg']:
267 blacklist.extend([ 'sp-8888', 'svg', '_', test])
268 blacklist.extend([ 'pic-8888', 'svg', '_', test])
269 blacklist.extend([ '2ndpic-8888', 'svg', '_', test])
270 blacklist.extend(['serialize-8888', 'svg', '_', test])
271
borenete2251ac2016-08-05 05:40:59 -0700272 # Extensions for RAW images
273 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
274 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
275
276 # skbug.com/4888
277 # Blacklist RAW images (and a few large PNGs) on GPU bots
278 # until we can resolve failures
279 if 'GPU' in bot:
280 blacklist.extend('_ image _ interlaced1.png'.split(' '))
281 blacklist.extend('_ image _ interlaced2.png'.split(' '))
282 blacklist.extend('_ image _ interlaced3.png'.split(' '))
283 for raw_ext in r:
284 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
285
borenet2c3112d2016-08-05 06:30:10 -0700286 if 'Nexus9' in bot:
borenete2251ac2016-08-05 05:40:59 -0700287 for raw_ext in r:
288 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
289
290 # Large image that overwhelms older Mac bots
borenet2c3112d2016-08-05 06:30:10 -0700291 if 'MacMini4.1-GPU' in bot:
borenete2251ac2016-08-05 05:40:59 -0700292 blacklist.extend('_ image _ abnormal.wbmp'.split(' '))
293 blacklist.extend(['msaa16', 'gm', '_', 'blurcircles'])
294
295 match = []
296 if 'Valgrind' in bot: # skia:3021
297 match.append('~Threaded')
298
mtkleind5d32872016-08-15 07:47:57 -0700299 if 'Nexus6' in bot: # skia:5637
300 match.append('~CompressCheckerboard')
301
borenete2251ac2016-08-05 05:40:59 -0700302 if 'GalaxyS3' in bot: # skia:1699
303 match.append('~WritePixels')
304
305 if 'AndroidOne' in bot: # skia:4711
borenet2c3112d2016-08-05 06:30:10 -0700306 match.append('~WritePixels')
borenete2251ac2016-08-05 05:40:59 -0700307
308 if 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700309 match.append('~ResourceCache')
borenete2251ac2016-08-05 05:40:59 -0700310
311 if 'Nexus10' in bot: # skia:5509
borenet2c3112d2016-08-05 06:30:10 -0700312 match.append('~CopySurface')
borenete2251ac2016-08-05 05:40:59 -0700313
borenet2c3112d2016-08-05 06:30:10 -0700314 if 'ANGLE' in bot and 'Debug' in bot:
borenete2251ac2016-08-05 05:40:59 -0700315 match.append('~GLPrograms') # skia:4717
316
317 if 'MSAN' in bot:
318 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
319
borenet2c3112d2016-08-05 06:30:10 -0700320 if 'TSAN' in bot:
borenete2251ac2016-08-05 05:40:59 -0700321 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
322
323 if blacklist:
324 args.append('--blacklist')
325 args.extend(blacklist)
326
327 if match:
328 args.append('--match')
329 args.extend(match)
330
331 # These bots run out of memory running RAW codec tests. Do not run them in
332 # parallel
333 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
334 or 'Win8-MSVC-ShuttleB' in bot):
335 args.append('--noRAW_threading')
336
337 return args
338
339
borenetbc20a702016-08-03 10:38:44 -0700340def key_params(api):
341 """Build a unique key from the builder name (as a list).
342
343 E.g. arch x86 gpu GeForce320M mode MacMini4.1 os Mac10.6
344 """
345 # Don't bother to include role, which is always Test.
346 # TryBots are uploaded elsewhere so they can use the same key.
347 blacklist = ['role', 'is_trybot']
348
349 flat = []
350 for k in sorted(api.vars.builder_cfg.keys()):
351 if k not in blacklist:
352 flat.append(k)
353 flat.append(api.vars.builder_cfg[k])
354 return flat
355
356
357def test_steps(api):
358 """Run the DM test."""
359 use_hash_file = False
360 if api.vars.upload_dm_results:
361 # This must run before we write anything into
362 # api.flavor.device_dirs.dm_dir or we may end up deleting our
363 # output on machines where they're the same.
364 api.flavor.create_clean_host_dir(api.vars.dm_dir)
365 host_dm_dir = str(api.vars.dm_dir)
366 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
367 if host_dm_dir != device_dm_dir:
368 api.flavor.create_clean_device_dir(device_dm_dir)
369
370 # Obtain the list of already-generated hashes.
371 hash_filename = 'uninteresting_hashes.txt'
372
373 # Ensure that the tmp_dir exists.
374 api.run.run_once(api.file.makedirs,
375 'tmp_dir',
376 api.vars.tmp_dir,
377 infra_step=True)
378
379 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
380 hashes_file = api.flavor.device_path_join(
381 api.flavor.device_dirs.tmp_dir, hash_filename)
382 api.run(
383 api.python.inline,
384 'get uninteresting hashes',
385 program="""
386 import contextlib
387 import math
388 import socket
389 import sys
390 import time
391 import urllib2
392
393 HASHES_URL = 'https://gold.skia.org/_/hashes'
394 RETRIES = 5
395 TIMEOUT = 60
396 WAIT_BASE = 15
397
398 socket.setdefaulttimeout(TIMEOUT)
399 for retry in range(RETRIES):
400 try:
401 with contextlib.closing(
402 urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:
403 hashes = w.read()
404 with open(sys.argv[1], 'w') as f:
405 f.write(hashes)
406 break
407 except Exception as e:
408 print 'Failed to get uninteresting hashes from %s:' % HASHES_URL
409 print e
410 if retry == RETRIES:
411 raise
412 waittime = WAIT_BASE * math.pow(2, retry)
413 print 'Retry in %d seconds.' % waittime
414 time.sleep(waittime)
415 """,
416 args=[host_hashes_file],
417 cwd=api.vars.skia_dir,
418 abort_on_failure=False,
419 fail_build_on_failure=False,
420 infra_step=True)
421
422 if api.path.exists(host_hashes_file):
423 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
424 use_hash_file = True
425
426 # Run DM.
427 properties = [
428 'gitHash', api.vars.got_revision,
429 'master', api.vars.master_name,
430 'builder', api.vars.builder_name,
431 'build_number', api.vars.build_number,
432 ]
433 if api.vars.is_trybot:
434 properties.extend([
435 'issue', api.vars.issue,
436 'patchset', api.vars.patchset,
437 ])
438
439 args = [
440 'dm',
441 '--undefok', # This helps branches that may not know new flags.
442 '--resourcePath', api.flavor.device_dirs.resource_dir,
443 '--skps', api.flavor.device_dirs.skp_dir,
444 '--images', api.flavor.device_path_join(
445 api.flavor.device_dirs.images_dir, 'dm'),
446 '--colorImages', api.flavor.device_path_join(
447 api.flavor.device_dirs.images_dir, 'colorspace'),
448 '--nameByHash',
449 '--properties'
450 ] + properties
451
rmistry70c43ef2016-08-12 07:25:53 -0700452 args.extend(['--svgs', api.flavor.device_dirs.svg_dir])
rmistrybcba19d2016-08-11 12:36:58 -0700453
borenetbc20a702016-08-03 10:38:44 -0700454 args.append('--key')
455 args.extend(key_params(api))
456 if use_hash_file:
457 args.extend(['--uninterestingHashesFile', hashes_file])
458 if api.vars.upload_dm_results:
459 args.extend(['--writePath', api.flavor.device_dirs.dm_dir])
460
461 skip_flag = None
462 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
463 skip_flag = '--nogpu'
464 elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
465 skip_flag = '--nocpu'
466 if skip_flag:
467 args.append(skip_flag)
borenete2251ac2016-08-05 05:40:59 -0700468 args.extend(dm_flags(api.vars.builder_name))
borenetbc20a702016-08-03 10:38:44 -0700469
470 api.run(api.flavor.step, 'dm', cmd=args,
borenetd460a3c2016-08-05 05:18:05 -0700471 abort_on_failure=False,
472 env=api.vars.default_env)
borenetbc20a702016-08-03 10:38:44 -0700473
474 if api.vars.upload_dm_results:
475 # Copy images and JSON to host machine if needed.
476 api.flavor.copy_directory_contents_to_host(
477 api.flavor.device_dirs.dm_dir, api.vars.dm_dir)
478
479 # See skia:2789.
480 if ('Valgrind' in api.vars.builder_name and
481 api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU'):
482 abandonGpuContext = list(args)
483 abandonGpuContext.append('--abandonGpuContext')
484 api.run(api.flavor.step, 'dm --abandonGpuContext',
485 cmd=abandonGpuContext, abort_on_failure=False)
486 preAbandonGpuContext = list(args)
487 preAbandonGpuContext.append('--preAbandonGpuContext')
488 api.run(api.flavor.step, 'dm --preAbandonGpuContext',
489 cmd=preAbandonGpuContext, abort_on_failure=False,
490 env=api.vars.default_env)
491
492
borenet1ed2ae42016-07-26 11:52:17 -0700493def RunSteps(api):
borenet1436a092016-08-03 08:23:10 -0700494 api.core.setup()
borenetbc20a702016-08-03 10:38:44 -0700495 api.flavor.install()
496 test_steps(api)
497 api.flavor.cleanup_steps()
borenet1436a092016-08-03 08:23:10 -0700498 api.run.check_failure()
borenet1ed2ae42016-07-26 11:52:17 -0700499
500
501def GenTests(api):
502 def AndroidTestData(builder, adb=None):
503 test_data = (
504 api.step_data(
505 'get EXTERNAL_STORAGE dir',
506 stdout=api.raw_io.output('/storage/emulated/legacy')) +
507 api.step_data(
508 'read SKP_VERSION',
509 stdout=api.raw_io.output('42')) +
510 api.step_data(
511 'read SK_IMAGE_VERSION',
512 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700513 api.step_data(
514 'read SVG_VERSION',
515 stdout=api.raw_io.output('42')) +
516 api.step_data(
borenet1ed2ae42016-07-26 11:52:17 -0700517 'exists skia_dm',
518 stdout=api.raw_io.output(''))
519 )
520 if 'GalaxyS3' not in builder:
521 test_data += api.step_data(
522 'adb root',
523 stdout=api.raw_io.output('restarting adbd as root'))
524 if adb:
525 test_data += api.step_data(
526 'which adb',
527 stdout=api.raw_io.output(adb))
528 else:
529 test_data += api.step_data(
530 'which adb',
531 retcode=1)
532
533 return test_data
534
535 for mastername, slaves in TEST_BUILDERS.iteritems():
536 for slavename, builders_by_slave in slaves.iteritems():
537 for builder in builders_by_slave:
538 test = (
539 api.test(builder) +
540 api.properties(buildername=builder,
541 mastername=mastername,
542 slavename=slavename,
543 buildnumber=5,
544 revision='abc123',
545 path_config='kitchen',
546 swarm_out_dir='[SWARM_OUT_DIR]') +
547 api.path.exists(
548 api.path['slave_build'].join('skia'),
549 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
550 'skimage', 'VERSION'),
551 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
552 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700553 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
554 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700555 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
556 )
557 )
558 if ('Android' in builder and
559 ('Test' in builder or 'Perf' in builder) and
560 not 'Appurify' in builder):
561 test += AndroidTestData(builder)
562 if 'Trybot' in builder:
563 test += api.properties(issue=500,
564 patchset=1,
565 rietveld='https://codereview.chromium.org')
566 if 'Win' in builder:
567 test += api.platform('win', 64)
568
569
570 yield test
571
572 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
573 yield (
574 api.test('failed_dm') +
575 api.properties(buildername=builder,
576 mastername='client.skia',
577 slavename='skiabot-linux-swarm-000',
578 buildnumber=6,
579 revision='abc123',
580 path_config='kitchen',
581 swarm_out_dir='[SWARM_OUT_DIR]') +
582 api.path.exists(
583 api.path['slave_build'].join('skia'),
584 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
585 'skimage', 'VERSION'),
586 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
587 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700588 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
589 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700590 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
591 ) +
592 api.step_data('dm', retcode=1)
593 )
594
595 builder = 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Debug'
596 yield (
597 api.test('failed_get_hashes') +
598 api.properties(buildername=builder,
599 mastername='client.skia',
600 slavename='skiabot-linux-swarm-000',
601 buildnumber=6,
602 revision='abc123',
603 path_config='kitchen',
604 swarm_out_dir='[SWARM_OUT_DIR]') +
605 api.path.exists(
606 api.path['slave_build'].join('skia'),
607 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
608 'skimage', 'VERSION'),
609 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
610 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700611 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
612 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700613 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
614 ) +
615 AndroidTestData(builder) +
616 api.step_data('read SKP_VERSION',
617 stdout=api.raw_io.output('42')) +
618 api.step_data('read SK_IMAGE_VERSION',
619 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700620 api.step_data('read SVG_VERSION',
621 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700622 api.step_data('get uninteresting hashes', retcode=1)
623 )
624
625 yield (
626 api.test('download_and_push_skps') +
627 api.properties(buildername=builder,
628 mastername='client.skia',
629 slavename='skiabot-linux-swarm-000',
630 buildnumber=6,
631 revision='abc123',
632 path_config='kitchen',
633 swarm_out_dir='[SWARM_OUT_DIR]') +
634 api.path.exists(
635 api.path['slave_build'].join('skia'),
636 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
637 'skimage', 'VERSION'),
638 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
639 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700640 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
641 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700642 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
643 ) +
644 AndroidTestData(builder) +
645 api.step_data('read SKP_VERSION',
646 stdout=api.raw_io.output('2')) +
647 api.step_data('read SK_IMAGE_VERSION',
648 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700649 api.step_data('read SVG_VERSION',
650 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700651 api.step_data(
652 'exists skps',
653 stdout=api.raw_io.output(''))
654 )
655
656 yield (
657 api.test('missing_SKP_VERSION_device') +
658 api.properties(buildername=builder,
659 mastername='client.skia',
660 slavename='skiabot-linux-swarm-000',
661 buildnumber=6,
662 revision='abc123',
663 path_config='kitchen',
664 swarm_out_dir='[SWARM_OUT_DIR]') +
665 api.path.exists(
666 api.path['slave_build'].join('skia'),
667 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
668 'skimage', 'VERSION'),
669 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
670 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700671 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
672 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700673 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
674 ) +
675 AndroidTestData(builder) +
676 api.step_data('read SKP_VERSION',
677 retcode=1) +
678 api.step_data('read SK_IMAGE_VERSION',
679 stdout=api.raw_io.output('42')) +
rmistrybcba19d2016-08-11 12:36:58 -0700680 api.step_data('read SVG_VERSION',
681 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700682 api.step_data(
683 'exists skps',
684 stdout=api.raw_io.output(''))
685 )
686
687 yield (
688 api.test('download_and_push_skimage') +
689 api.properties(buildername=builder,
690 mastername='client.skia',
691 slavename='skiabot-linux-swarm-000',
692 buildnumber=6,
693 revision='abc123',
694 path_config='kitchen',
695 swarm_out_dir='[SWARM_OUT_DIR]') +
696 api.path.exists(
697 api.path['slave_build'].join('skia'),
698 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
699 'skimage', 'VERSION'),
700 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
701 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700702 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
703 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700704 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
705 ) +
706 AndroidTestData(builder) +
707 api.step_data('read SKP_VERSION',
708 stdout=api.raw_io.output('42')) +
709 api.step_data('read SK_IMAGE_VERSION',
710 stdout=api.raw_io.output('2')) +
rmistrybcba19d2016-08-11 12:36:58 -0700711 api.step_data('read SVG_VERSION',
712 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700713 api.step_data(
714 'exists skia_images',
715 stdout=api.raw_io.output(''))
716 )
717
718 yield (
719 api.test('missing_SK_IMAGE_VERSION_device') +
720 api.properties(buildername=builder,
721 mastername='client.skia',
722 slavename='skiabot-linux-swarm-000',
723 buildnumber=6,
724 revision='abc123',
725 path_config='kitchen',
726 swarm_out_dir='[SWARM_OUT_DIR]') +
727 api.path.exists(
728 api.path['slave_build'].join('skia'),
729 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
730 'skimage', 'VERSION'),
731 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
732 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700733 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
734 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700735 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
736 ) +
737 AndroidTestData(builder) +
738 api.step_data('read SKP_VERSION',
739 stdout=api.raw_io.output('42')) +
740 api.step_data('read SK_IMAGE_VERSION',
741 retcode=1) +
rmistrybcba19d2016-08-11 12:36:58 -0700742 api.step_data('read SVG_VERSION',
743 stdout=api.raw_io.output('42')) +
borenet1ed2ae42016-07-26 11:52:17 -0700744 api.step_data(
745 'exists skia_images',
746 stdout=api.raw_io.output(''))
747 )
748
749 yield (
rmistrybcba19d2016-08-11 12:36:58 -0700750 api.test('download_and_push_svgs') +
751 api.properties(buildername=builder,
752 mastername='client.skia',
753 slavename='skiabot-linux-swarm-000',
754 buildnumber=6,
755 revision='abc123',
756 path_config='kitchen',
757 swarm_out_dir='[SWARM_OUT_DIR]') +
758 api.path.exists(
759 api.path['slave_build'].join('skia'),
760 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
761 'skimage', 'VERSION'),
762 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
763 'skp', 'VERSION'),
764 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
765 'svg', 'VERSION'),
766 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
767 ) +
768 AndroidTestData(builder) +
769 api.step_data('read SKP_VERSION',
770 stdout=api.raw_io.output('42')) +
771 api.step_data('read SK_IMAGE_VERSION',
772 stdout=api.raw_io.output('42')) +
773 api.step_data('read SVG_VERSION',
774 stdout=api.raw_io.output('2')) +
775 api.step_data(
776 'exists svgs',
777 stdout=api.raw_io.output(''))
778 )
779
780 yield (
781 api.test('missing_SVG_VERSION_device') +
782 api.properties(buildername=builder,
783 mastername='client.skia',
784 slavename='skiabot-linux-swarm-000',
785 buildnumber=6,
786 revision='abc123',
787 path_config='kitchen',
788 swarm_out_dir='[SWARM_OUT_DIR]') +
789 api.path.exists(
790 api.path['slave_build'].join('skia'),
791 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
792 'skimage', 'VERSION'),
793 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
794 'skp', 'VERSION'),
795 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
796 'svg', 'VERSION'),
797 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
798 ) +
799 AndroidTestData(builder) +
800 api.step_data('read SKP_VERSION',
801 stdout=api.raw_io.output('42')) +
802 api.step_data('read SK_IMAGE_VERSION',
803 stdout=api.raw_io.output('42')) +
804 api.step_data('read SVG_VERSION',
805 retcode=1) +
806 api.step_data(
807 'exists svgs',
808 stdout=api.raw_io.output(''))
809 )
810
811 yield (
borenet1ed2ae42016-07-26 11:52:17 -0700812 api.test('adb_in_path') +
813 api.properties(buildername=builder,
814 mastername='client.skia',
815 slavename='skiabot-linux-swarm-000',
816 buildnumber=6,
817 revision='abc123',
818 path_config='kitchen',
819 swarm_out_dir='[SWARM_OUT_DIR]') +
820 api.path.exists(
821 api.path['slave_build'].join('skia'),
822 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
823 'skimage', 'VERSION'),
824 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
825 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700826 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
827 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700828 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
829 ) +
830 AndroidTestData(builder, adb='/usr/bin/adb') +
831 api.step_data('read SKP_VERSION',
832 stdout=api.raw_io.output('42')) +
833 api.step_data('read SK_IMAGE_VERSION',
rmistrybcba19d2016-08-11 12:36:58 -0700834 stdout=api.raw_io.output('42')) +
835 api.step_data('read SVG_VERSION',
borenet1ed2ae42016-07-26 11:52:17 -0700836 stdout=api.raw_io.output('42'))
837 )
838
839 builder = 'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release-Trybot'
840 yield (
841 api.test('big_issue_number') +
842 api.properties(buildername=builder,
843 mastername='client.skia.compile',
844 slavename='skiabot-linux-swarm-000',
845 buildnumber=5,
846 revision='abc123',
847 path_config='kitchen',
848 swarm_out_dir='[SWARM_OUT_DIR]',
849 rietveld='https://codereview.chromium.org',
850 patchset=1,
851 issue=2147533002L) +
852 api.path.exists(
853 api.path['slave_build'].join('skia'),
854 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
855 'skimage', 'VERSION'),
856 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
857 'skp', 'VERSION'),
rmistrybcba19d2016-08-11 12:36:58 -0700858 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
859 'svg', 'VERSION'),
borenet1ed2ae42016-07-26 11:52:17 -0700860 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
861 ) +
862 api.platform('win', 64)
863 )