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