blob: 99fff3b1398a869e3b5b97a6938b0023ccb02caa [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',
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',
borenet1ed2ae42016-07-26 11:52:17 -070050 ],
51 },
52}
53
54
borenete2251ac2016-08-05 05:40:59 -070055def dm_flags(bot):
56 args = []
57
58 # 32-bit desktop bots tend to run out of memory, because they have relatively
59 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit.
60 if '-x86-' in bot and not 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -070061 args.extend('--threads 4'.split(' '))
borenete2251ac2016-08-05 05:40:59 -070062
63 # These are the canonical configs that we would ideally run on all bots. We
64 # may opt out or substitute some below for specific bots
65 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf']
66 # Add in either msaa4 or msaa16 to the canonical set of configs to run
67 if 'Android' in bot or 'iOS' in bot:
68 configs.append('msaa4')
69 else:
70 configs.append('msaa16')
71
72 # With msaa, the S4 crashes and the NP produces a long error stream when we
73 # run with MSAA. The Tegra2 and Tegra3 just don't support it. No record of
74 # why we're not running msaa on iOS, probably started with gpu config and just
75 # haven't tried.
76 if ('GalaxyS4' in bot or
77 'NexusPlayer' in bot or
78 'Tegra3' in bot or
79 'iOS' in bot):
80 configs = [x for x in configs if 'msaa' not in x]
81
82 # Runs out of memory on Android bots and Daisy. Everyone else seems fine.
83 if 'Android' in bot or 'Daisy' in bot:
84 configs.remove('pdf')
85
86 if '-GCE-' in bot:
87 configs.extend(['f16', 'srgb']) # Gamma-correct formats.
88 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
mtklein03591a72016-08-07 13:35:46 -070089 configs.extend(['lite-8888']) # Experimental display list.
borenete2251ac2016-08-05 05:40:59 -070090
91 if '-TSAN' not in bot:
92 if ('TegraK1' in bot or
93 'TegraX1' in bot or
94 'GTX550Ti' in bot or
95 'GTX660' in bot or
96 'GT610' in bot):
97 if 'Android' in bot:
borenet2c3112d2016-08-05 06:30:10 -070098 configs.append('nvprdit4')
borenete2251ac2016-08-05 05:40:59 -070099 else:
100 configs.append('nvprdit16')
101
102 # We want to test the OpenGL config not the GLES config on the X1
borenet2c3112d2016-08-05 06:30:10 -0700103 if 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700104 configs = [x.replace('gpu', 'gl') for x in configs]
105 configs = [x.replace('msaa', 'glmsaa') for x in configs]
106 configs = [x.replace('nvpr', 'glnvpr') for x in configs]
107
108 # NP is running out of RAM when we run all these modes. skia:3255
109 if 'NexusPlayer' not in bot:
110 configs.extend(mode + '-8888' for mode in
111 ['serialize', 'tiles_rt', 'pic'])
112
113 if 'ANGLE' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700114 configs.append('angle')
borenete2251ac2016-08-05 05:40:59 -0700115
116 # We want to run gpudft on atleast the mali 400
117 if 'GalaxyS3' in bot:
118 configs.append('gpudft')
119
120 # Test instanced rendering on a limited number of platforms
borenet2c3112d2016-08-05 06:30:10 -0700121 if 'Nexus6' in bot:
borenete2251ac2016-08-05 05:40:59 -0700122 configs.append('esinst') # esinst4 isn't working yet on Adreno.
borenet2c3112d2016-08-05 06:30:10 -0700123 elif 'TegraX1' in bot:
borenete2251ac2016-08-05 05:40:59 -0700124 # Multisampled instanced configs use nvpr.
125 configs = [x.replace('glnvpr', 'glinst') for x in configs]
126 configs.append('glinst')
127 elif 'MacMini6.2' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700128 configs.extend(['glinst', 'glinst16'])
borenete2251ac2016-08-05 05:40:59 -0700129
130 # CommandBuffer bot *only* runs the command_buffer config.
131 if 'CommandBuffer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700132 configs = ['commandbuffer']
borenete2251ac2016-08-05 05:40:59 -0700133
134 # Vulkan bot *only* runs the vk config.
135 if 'Vulkan' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700136 configs = ['vk']
borenete2251ac2016-08-05 05:40:59 -0700137
138 args.append('--config')
139 args.extend(configs)
140
141 # Run tests, gms, and image decoding tests everywhere.
rmistry70c43ef2016-08-12 07:25:53 -0700142 args.extend('--src tests gm image colorImage svg'.split(' '))
borenete2251ac2016-08-05 05:40:59 -0700143
144 if 'GalaxyS' in bot:
145 args.extend(('--threads', '0'))
146
147 blacklist = []
148
149 # TODO: ???
150 blacklist.extend('f16 _ _ dstreadshuffle'.split(' '))
151 blacklist.extend('f16 image _ _'.split(' '))
152 blacklist.extend('srgb image _ _'.split(' '))
153 blacklist.extend('gpusrgb image _ _'.split(' '))
154
155 if 'Valgrind' in bot:
156 # These take 18+ hours to run.
157 blacklist.extend('pdf gm _ fontmgr_iter'.split(' '))
158 blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' '))
159 blacklist.extend('pdf skp _ worldjournal'.split(' '))
160 blacklist.extend('pdf skp _ desk_baidu.skp'.split(' '))
161 blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' '))
162
163 if 'iOS' in bot:
164 blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' '))
165 blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' '))
166
167 if 'Mac' in bot or 'iOS' in bot:
168 # CG fails on questionable bmps
169 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
170 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
171 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
172 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
173 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
174 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
175 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
176
177 # CG has unpredictable behavior on this questionable gif
178 # It's probably using uninitialized memory
179 blacklist.extend('_ image gen_platf frame_larger_than_image.gif'.split(' '))
180
181 # WIC fails on questionable bmps
182 if 'Win' in bot:
183 blacklist.extend('_ image gen_platf rle8-height-negative.bmp'.split(' '))
184 blacklist.extend('_ image gen_platf rle4-height-negative.bmp'.split(' '))
185 blacklist.extend('_ image gen_platf pal8os2v2.bmp'.split(' '))
186 blacklist.extend('_ image gen_platf pal8os2v2-16.bmp'.split(' '))
187 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
188 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
189 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
190 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
191 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
192 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
193 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
194 if 'x86_64' in bot and 'CPU' in bot:
195 # This GM triggers a SkSmallAllocator assert.
196 blacklist.extend('_ gm _ composeshader_bitmap'.split(' '))
197
198 if 'Android' in bot or 'iOS' in bot:
199 # This test crashes the N9 (perhaps because of large malloc/frees). It also
200 # is fairly slow and not platform-specific. So we just disable it on all of
201 # Android and iOS. skia:5438
202 blacklist.extend('_ test _ GrShape'.split(' '))
203
204 if 'Win8' in bot:
205 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with
206 # 'Unexpected error' from DirectWrite"
207 blacklist.extend('_ gm _ fontscalerdistortable'.split(' '))
fmalitab5b6de92016-08-16 07:08:48 -0700208 # skia:5636
209 blacklist.extend('_ svg _ Nebraska-StateSeal.svg'.split(' '))
borenete2251ac2016-08-05 05:40:59 -0700210
211 # skia:4095
212 bad_serialize_gms = ['bleed_image',
213 'c_gms',
214 'colortype',
215 'colortype_xfermodes',
216 'drawfilter',
217 'fontmgr_bounds_0.75_0',
218 'fontmgr_bounds_1_-0.25',
219 'fontmgr_bounds',
220 'fontmgr_match',
fmalitace2fc6a2016-08-26 10:13:39 -0700221 'fontmgr_iter',
222 'imagemasksubset']
borenete2251ac2016-08-05 05:40:59 -0700223
224 # skia:5589
225 bad_serialize_gms.extend(['bitmapfilters',
226 'bitmapshaders',
227 'bleed',
228 'bleed_alpha_bmp',
229 'bleed_alpha_bmp_shader',
230 'convex_poly_clip',
231 'extractalpha',
232 'filterbitmap_checkerboard_32_32_g8',
233 'filterbitmap_image_mandrill_64',
234 'shadows',
235 'simpleaaclip_aaclip'])
236 # skia:5595
237 bad_serialize_gms.extend(['composeshader_bitmap',
238 'scaled_tilemodes_npot',
239 'scaled_tilemodes'])
240 for test in bad_serialize_gms:
241 blacklist.extend(['serialize-8888', 'gm', '_', test])
242
243 if 'Mac' not in bot:
244 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
245 blacklist.extend(['serialize-8888', 'gm', '_', test])
246 # It looks like we skip these only for out-of-memory concerns.
247 if 'Win' in bot or 'Android' in bot:
248 for test in ['verylargebitmap', 'verylarge_picture_image']:
249 blacklist.extend(['serialize-8888', 'gm', '_', test])
250
251 # skia:4769
252 for test in ['drawfilter']:
253 blacklist.extend([ 'sp-8888', 'gm', '_', test])
254 blacklist.extend([ 'pic-8888', 'gm', '_', test])
255 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein03591a72016-08-07 13:35:46 -0700256 blacklist.extend([ 'lite-8888', 'gm', '_', test])
borenete2251ac2016-08-05 05:40:59 -0700257 # skia:4703
258 for test in ['image-cacherator-from-picture',
259 'image-cacherator-from-raster',
260 'image-cacherator-from-ctable']:
261 blacklist.extend([ 'sp-8888', 'gm', '_', test])
262 blacklist.extend([ 'pic-8888', 'gm', '_', test])
263 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
264 blacklist.extend(['serialize-8888', 'gm', '_', test])
265
brianosman2c4b64e2016-09-07 07:04:44 -0700266 # GM that requires raster-backed canvas
267 for test in ['gamut']:
268 blacklist.extend([ 'sp-8888', 'gm', '_', test])
269 blacklist.extend([ 'pic-8888', 'gm', '_', test])
270 blacklist.extend([ 'lite-8888', 'gm', '_', test])
271 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
272 blacklist.extend(['serialize-8888', 'gm', '_', 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
301 if 'GalaxyS3' in bot: # skia:1699
302 match.append('~WritePixels')
303
304 if 'AndroidOne' in bot: # skia:4711
borenet2c3112d2016-08-05 06:30:10 -0700305 match.append('~WritePixels')
borenete2251ac2016-08-05 05:40:59 -0700306
307 if 'NexusPlayer' in bot:
borenet2c3112d2016-08-05 06:30:10 -0700308 match.append('~ResourceCache')
borenete2251ac2016-08-05 05:40:59 -0700309
310 if 'Nexus10' in bot: # skia:5509
borenet2c3112d2016-08-05 06:30:10 -0700311 match.append('~CopySurface')
borenete2251ac2016-08-05 05:40:59 -0700312
borenet2c3112d2016-08-05 06:30:10 -0700313 if 'ANGLE' in bot and 'Debug' in bot:
borenete2251ac2016-08-05 05:40:59 -0700314 match.append('~GLPrograms') # skia:4717
315
316 if 'MSAN' in bot:
317 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
318
borenet2c3112d2016-08-05 06:30:10 -0700319 if 'TSAN' in bot:
borenete2251ac2016-08-05 05:40:59 -0700320 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
321
322 if blacklist:
323 args.append('--blacklist')
324 args.extend(blacklist)
325
326 if match:
327 args.append('--match')
328 args.extend(match)
329
330 # These bots run out of memory running RAW codec tests. Do not run them in
331 # parallel
332 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
333 or 'Win8-MSVC-ShuttleB' in bot):
334 args.append('--noRAW_threading')
335
336 return args
337
338
borenetbc20a702016-08-03 10:38:44 -0700339def key_params(api):
340 """Build a unique key from the builder name (as a list).
341
342 E.g. arch x86 gpu GeForce320M mode MacMini4.1 os Mac10.6
343 """
344 # Don't bother to include role, which is always Test.
345 # TryBots are uploaded elsewhere so they can use the same key.
346 blacklist = ['role', 'is_trybot']
347
348 flat = []
349 for k in sorted(api.vars.builder_cfg.keys()):
350 if k not in blacklist:
351 flat.append(k)
352 flat.append(api.vars.builder_cfg[k])
353 return flat
354
355
356def test_steps(api):
357 """Run the DM test."""
358 use_hash_file = False
359 if api.vars.upload_dm_results:
360 # This must run before we write anything into
361 # api.flavor.device_dirs.dm_dir or we may end up deleting our
362 # output on machines where they're the same.
363 api.flavor.create_clean_host_dir(api.vars.dm_dir)
364 host_dm_dir = str(api.vars.dm_dir)
365 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
366 if host_dm_dir != device_dm_dir:
367 api.flavor.create_clean_device_dir(device_dm_dir)
368
369 # Obtain the list of already-generated hashes.
370 hash_filename = 'uninteresting_hashes.txt'
371
372 # Ensure that the tmp_dir exists.
373 api.run.run_once(api.file.makedirs,
374 'tmp_dir',
375 api.vars.tmp_dir,
376 infra_step=True)
377
378 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
379 hashes_file = api.flavor.device_path_join(
380 api.flavor.device_dirs.tmp_dir, hash_filename)
381 api.run(
382 api.python.inline,
383 'get uninteresting hashes',
384 program="""
385 import contextlib
386 import math
387 import socket
388 import sys
389 import time
390 import urllib2
391
392 HASHES_URL = 'https://gold.skia.org/_/hashes'
393 RETRIES = 5
394 TIMEOUT = 60
395 WAIT_BASE = 15
396
397 socket.setdefaulttimeout(TIMEOUT)
398 for retry in range(RETRIES):
399 try:
400 with contextlib.closing(
401 urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:
402 hashes = w.read()
403 with open(sys.argv[1], 'w') as f:
404 f.write(hashes)
405 break
406 except Exception as e:
407 print 'Failed to get uninteresting hashes from %s:' % HASHES_URL
408 print e
409 if retry == RETRIES:
410 raise
411 waittime = WAIT_BASE * math.pow(2, retry)
412 print 'Retry in %d seconds.' % waittime
413 time.sleep(waittime)
414 """,
415 args=[host_hashes_file],
416 cwd=api.vars.skia_dir,
417 abort_on_failure=False,
418 fail_build_on_failure=False,
419 infra_step=True)
420
421 if api.path.exists(host_hashes_file):
422 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
423 use_hash_file = True
424
425 # Run DM.
426 properties = [
427 'gitHash', api.vars.got_revision,
428 'master', api.vars.master_name,
429 'builder', api.vars.builder_name,
430 'build_number', api.vars.build_number,
431 ]
432 if api.vars.is_trybot:
433 properties.extend([
rmistry3f1c9c02016-08-24 05:07:06 -0700434 'issue', api.vars.issue,
435 'patchset', api.vars.patchset,
436 'patch_storage', api.vars.patch_storage,
borenetbc20a702016-08-03 10:38:44 -0700437 ])
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 )
rmistry3f1c9c02016-08-24 05:07:06 -0700864
865 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot'
866 gerrit_kwargs = {
867 'patch_storage': 'gerrit',
868 'repository': 'skia',
869 'event.patchSet.ref': 'refs/changes/00/2100/2',
870 'event.change.number': '2100',
871 }
872 yield (
873 api.test('recipe_with_gerrit_patch') +
874 api.properties(
875 buildername=builder,
876 mastername='client.skia',
877 slavename='skiabot-linux-swarm-000',
878 buildnumber=5,
879 path_config='kitchen',
880 swarm_out_dir='[SWARM_OUT_DIR]',
881 revision='abc123',
882 **gerrit_kwargs)
883 )