blob: ab3a9cc6f7800c735b20ed2344f78b98ef468473 [file] [log] [blame]
mtklein11a2c502015-02-24 09:25:16 -08001#!/usr/bin/env python
2
3usage = '''
4Write extra flags to outfile for DM based on the bot name:
5 $ python dm_flags.py outfile Test-Mac10.9-MacMini6.2-HD4000-x86_64-Release
6Or run self-tests:
7 $ python dm_flags.py test
8'''
9
10import inspect
11import json
12import os
13import sys
14
15
16def lineno():
17 caller = inspect.stack()[1] # Up one level to our caller.
18 return inspect.getframeinfo(caller[0]).lineno
19
20
21cov_start = lineno()+1 # We care about coverage starting just past this def.
mtkleinf73e5892015-02-24 11:45:11 -080022def get_args(bot):
mtklein11a2c502015-02-24 09:25:16 -080023 args = []
24
mtklein341c8082015-03-02 09:51:44 -080025 configs = ['565', '8888', 'gpu']
bsalomon5abf5842015-02-27 10:13:36 -080026 # The S4 crashes and the NP produces a long error stream when we run with
27 # MSAA.
28 if ('GalaxyS4' not in bot and
29 'NexusPlayer' not in bot):
30 if 'Android' in bot:
31 configs.extend(['msaa4', 'nvprmsaa4'])
32 else:
33 configs.extend(['msaa16', 'nvprmsaa16'])
mtklein82b33db2015-03-04 13:58:05 -080034 # Runs out of memory on Android bots and Daisy. Everyone else seems fine.
mtklein150d3502015-03-05 13:38:17 -080035 if 'Android' not in bot and 'Daisy' not in bot:
mtklein84aada82015-03-04 11:47:11 -080036 configs.append('pdf')
bsalomon5abf5842015-02-27 10:13:36 -080037
mtklein11a2c502015-02-24 09:25:16 -080038 # Xoom and NP are running out of RAM when we run all these modes. skia:3255
39 if ('Xoom' not in bot and
40 'NexusPlayer' not in bot):
41 configs.extend(mode + '-8888' for mode in
42 ['serialize', 'tiles_rt', 'pipe'])
43 configs.append('tiles_rt-gpu')
mtkleinee2a3ea2015-02-25 08:16:19 -080044 if 'ANGLE' in bot:
45 configs.append('angle')
mtklein11a2c502015-02-24 09:25:16 -080046 args.append('--config')
47 args.extend(configs)
48
49 blacklist = []
50 # This image is too large to be a texture for many GPUs.
51 blacklist.extend('gpu _ PANO_20121023_214540.jpg'.split(' '))
52 blacklist.extend('msaa _ PANO_20121023_214540.jpg'.split(' '))
53
mtkleine2aab902015-03-17 12:52:16 -070054 # Leon doesn't care about this, so why run it?
55 if 'Win' in bot:
56 blacklist.extend('_ image _'.split(' '))
57 blacklist.extend('_ subset _'.split(' '))
58
mtklein11a2c502015-02-24 09:25:16 -080059 # Drawing SKPs or images into GPU canvases is a New Thing.
60 # It seems like we're running out of RAM on some Android bots, so start off
61 # with a very wide blacklist disabling all these tests on all Android bots.
62 if 'Android' in bot: # skia:3255
63 blacklist.extend('gpu skp _ gpu image _ gpu subset _'.split(' '))
64 blacklist.extend('msaa skp _ msaa image _ gpu subset _'.split(' '))
65
mtklein150d3502015-03-05 13:38:17 -080066 if 'Valgrind' in bot:
mtkleinde7665a2015-03-14 07:24:29 -070067 # PDF + .webp -> jumps depending on uninitialized memory. skia:3505
mtklein150d3502015-03-05 13:38:17 -080068 blacklist.extend('pdf _ .webp'.split(' '))
mtkleinde7665a2015-03-14 07:24:29 -070069 # These both take 18+ hours to run.
70 blacklist.extend('pdf gm fontmgr_iter'.split(' '))
71 blacklist.extend('pdf _ PANO_20121023_214540.jpg'.split(' '))
mtklein7e78f3d2015-03-10 08:03:26 -070072 if 'Valgrind_GPU' in bot:
borenet13e51f92015-03-09 06:59:16 -070073 args.append('--nocpu')
mtklein7e78f3d2015-03-10 08:03:26 -070074 elif 'Valgrind_CPU' in bot:
borenet13e51f92015-03-09 06:59:16 -070075 args.append('--nogpu')
mtklein150d3502015-03-05 13:38:17 -080076
mtklein11a2c502015-02-24 09:25:16 -080077 if blacklist:
78 args.append('--blacklist')
79 args.extend(blacklist)
80
81 match = []
82 if 'Alex' in bot: # skia:2793
83 # This machine looks to be running out of heap.
84 # Running with fewer threads may help.
85 args.extend(['--threads', '1'])
86 if 'Valgrind' in bot: # skia:3021
87 match.append('~Threaded')
mtklein905d01b2015-03-18 14:06:55 -070088 if 'TSAN' in bot: # skia:3562
89 match.append('~Math')
90
mtkleincc99dbc2015-03-11 08:43:43 -070091 if 'Xoom' in bot or 'GalaxyS3' in bot: # skia:1699
mtklein11a2c502015-02-24 09:25:16 -080092 match.append('~WritePixels')
93
94 # skia:3249: these images flakily don't decode on Android.
95 if 'Android' in bot:
96 match.append('~tabl_mozilla_0')
97 match.append('~desk_yahoonews_0')
98
mtklein4e2d3be2015-03-10 11:55:18 -070099 if 'NexusPlayer' in bot:
100 match.append('~ResourceCache')
101
mtklein11a2c502015-02-24 09:25:16 -0800102 if match:
103 args.append('--match')
104 args.extend(match)
105
106 # Though their GPUs are interesting, these don't test anything on
107 # the CPU that other ARMv7+NEON bots don't test faster (N5).
108 if ('Nexus10' in bot or
109 'Nexus7' in bot or
110 'GalaxyS3' in bot or
111 'GalaxyS4' in bot):
112 args.append('--nocpu')
113 return args
114cov_end = lineno() # Don't care about code coverage past here.
115
116
117def self_test():
118 import coverage # This way the bots don't need coverage.py to be installed.
119 args = {}
120 cases = [
mtkleincc99dbc2015-03-11 08:43:43 -0700121 'Test-Android-GalaxyS3-Mali400-Arm7-Debug',
mtklein11a2c502015-02-24 09:25:16 -0800122 'Test-Android-Nexus7-Tegra3-Arm7-Release',
mtklein4e2d3be2015-03-10 11:55:18 -0700123 'Test-Android-NexusPlayer-PowerVR-x86-Release',
mtklein11a2c502015-02-24 09:25:16 -0800124 'Test-Android-Xoom-Tegra2-Arm7-Release',
125 'Test-ChromeOS-Alex-GMA3150-x86-Debug',
borenet13e51f92015-03-09 06:59:16 -0700126 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_GPU',
mtklein905d01b2015-03-18 14:06:55 -0700127 'Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN',
mtklein4e2d3be2015-03-10 11:55:18 -0700128 'Test-Ubuntu14-GCE-NoGPU-x86_64-Release-Valgrind_CPU',
mtkleinee2a3ea2015-02-25 08:16:19 -0800129 'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE',
mtklein11a2c502015-02-24 09:25:16 -0800130 ]
131
132 cov = coverage.coverage()
133 cov.start()
134 for case in cases:
mtkleinf73e5892015-02-24 11:45:11 -0800135 args[case] = get_args(case)
mtklein11a2c502015-02-24 09:25:16 -0800136 cov.stop()
137
138 this_file = os.path.basename(__file__)
139 _, _, not_run, _ = cov.analysis(this_file)
140 filtered = [line for line in not_run if line > cov_start and line < cov_end]
141 if filtered:
142 print 'Lines not covered by test cases: ', filtered
143 sys.exit(1)
144
145 golden = this_file.replace('.py', '.json')
146 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f:
147 json.dump(args, f, indent=2, sort_keys=True)
148
149
150if __name__ == '__main__':
151 if len(sys.argv) == 2 and sys.argv[1] == 'test':
152 self_test()
153 sys.exit(0)
154
155 if len(sys.argv) != 3:
156 print usage
157 sys.exit(1)
158
159 with open(sys.argv[1], 'w') as out:
mtkleinf73e5892015-02-24 11:45:11 -0800160 json.dump(get_args(sys.argv[2]), out)