blob: 1d93c7c1956a0886c451a54b77792a8b1ef19c4e [file] [log] [blame]
Jamie Madillcf4f8c72021-05-20 19:24:231#!/usr/bin/env python3
Avi Drissmandfd880852022-09-15 20:11:092# Copyright 2020 The Chromium Authors
Brian Sheedya31578e2020-05-18 20:24:363# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import unittest
7
Brian Sheedyfe2702e2024-12-13 21:48:208# //testing/buildbot imports.
Brian Sheedya31578e2020-05-18 20:24:369import buildbot_json_magic_substitutions as magic_substitutions
10
11
Ben Pastene2ea8ba52020-10-16 21:43:2512def CreateConfigWithPool(pool, device_type=None):
13 dims = {
Brian Sheedy9517d1c2022-04-08 01:17:0114 'name': 'test_name',
15 'swarming': {
Garrett Beatyade673d2023-08-04 22:00:2516 'dimensions': {
17 'pool': pool,
18 },
Brian Sheedy9517d1c2022-04-08 01:17:0119 },
Brian Sheedya31578e2020-05-18 20:24:3620 }
Ben Pastene2ea8ba52020-10-16 21:43:2521 if device_type:
Garrett Beatyade673d2023-08-04 22:00:2522 dims['swarming']['dimensions']['device_type'] = device_type
Ben Pastene2ea8ba52020-10-16 21:43:2523 return dims
Brian Sheedya31578e2020-05-18 20:24:3624
25
26class ChromeOSTelemetryRemoteTest(unittest.TestCase):
27
28 def testVirtualMachineSubstitutions(self):
29 test_config = CreateConfigWithPool('chromium.tests.cros.vm')
Brian Sheedy5f173bb2021-11-24 00:45:5430 self.assertEqual(
Brian Sheedyb6491ba2022-09-26 20:49:4931 magic_substitutions.ChromeOSTelemetryRemote(test_config, None, {}), [
Brian Sheedy5f173bb2021-11-24 00:45:5432 '--remote=127.0.0.1',
33 '--remote-ssh-port=9222',
34 ])
Brian Sheedya31578e2020-05-18 20:24:3635
36 def testPhysicalHardwareSubstitutions(self):
Ben Pastene2ea8ba52020-10-16 21:43:2537 test_config = CreateConfigWithPool('chromium.tests', device_type='eve')
Brian Sheedy5f173bb2021-11-24 00:45:5438 self.assertEqual(
Brian Sheedyb6491ba2022-09-26 20:49:4939 magic_substitutions.ChromeOSTelemetryRemote(test_config, None, {}),
Brian Sheedy5f173bb2021-11-24 00:45:5440 ['--remote=variable_chromeos_device_hostname'])
Brian Sheedya31578e2020-05-18 20:24:3641
Brian Sheedyb6491ba2022-09-26 20:49:4942 def testSkylabSubstitutions(self):
43 tester_config = {'browser_config': 'cros-chrome', 'use_swarming': False}
44 self.assertEqual(
45 magic_substitutions.ChromeOSTelemetryRemote({}, None, tester_config),
46 [])
47
Brian Sheedya31578e2020-05-18 20:24:3648 def testNoPool(self):
49 test_config = CreateConfigWithPool(None)
Brian Sheedy5f173bb2021-11-24 00:45:5450 with self.assertRaisesRegex(RuntimeError, 'No pool *'):
Brian Sheedyb6491ba2022-09-26 20:49:4951 magic_substitutions.ChromeOSTelemetryRemote(test_config, None, {})
Brian Sheedya31578e2020-05-18 20:24:3652
53 def testUnknownPool(self):
54 test_config = CreateConfigWithPool('totally-legit-pool')
Brian Sheedy5f173bb2021-11-24 00:45:5455 with self.assertRaisesRegex(RuntimeError, 'Unknown CrOS pool *'):
Brian Sheedyb6491ba2022-09-26 20:49:4956 magic_substitutions.ChromeOSTelemetryRemote(test_config, None, {})
Brian Sheedya31578e2020-05-18 20:24:3657
58
Brian Sheedy9517d1c2022-04-08 01:17:0159class ChromeOSGtestFilterFileTest(unittest.TestCase):
60 def testVirtualMachineFile(self):
61 test_config = CreateConfigWithPool('chromium.tests.cros.vm')
62 self.assertEqual(
Brian Sheedyb6491ba2022-09-26 20:49:4963 magic_substitutions.ChromeOSGtestFilterFile(test_config, None, {}), [
Brian Sheedy9517d1c2022-04-08 01:17:0164 '--test-launcher-filter-file=../../testing/buildbot/filters/'
65 'chromeos.amd64-generic.test_name.filter',
66 ])
67
68 def testPhysicalHardwareFile(self):
69 test_config = CreateConfigWithPool('chromium.tests', device_type='eve')
70 self.assertEqual(
Brian Sheedyb6491ba2022-09-26 20:49:4971 magic_substitutions.ChromeOSGtestFilterFile(test_config, None, {}), [
72 '--test-launcher-filter-file=../../testing/buildbot/filters/'
73 'chromeos.eve.test_name.filter',
74 ])
75
76 def testSkylab(self):
77 test_config = {'name': 'test_name', 'cros_board': 'eve'}
78 tester_config = {'browser_config': 'cros-chrome', 'use_swarming': False}
79 self.assertEqual(
80 magic_substitutions.ChromeOSGtestFilterFile(test_config, None,
81 tester_config),
82 [
Brian Sheedy9517d1c2022-04-08 01:17:0183 '--test-launcher-filter-file=../../testing/buildbot/filters/'
84 'chromeos.eve.test_name.filter',
85 ])
86
Brian Sheedy67937ad12024-03-06 22:53:5587 def testSkylabWithVariant(self):
88 test_config = {
89 'name': 'test_name SOME_VARIANT',
90 'cros_board': 'eve',
91 'variant_id': 'SOME_VARIANT',
92 }
93 tester_config = {'browser_config': 'cros-chrome', 'use_swarming': False}
94 self.assertEqual(
95 magic_substitutions.ChromeOSGtestFilterFile(test_config, None,
96 tester_config),
97 [
98 '--test-launcher-filter-file=../../testing/buildbot/filters/'
99 'chromeos.eve.test_name.filter',
100 ])
101
Brian Sheedy9517d1c2022-04-08 01:17:01102 def testNoPool(self):
103 test_config = CreateConfigWithPool(None)
104 with self.assertRaisesRegex(RuntimeError, 'No pool *'):
Brian Sheedyb6491ba2022-09-26 20:49:49105 magic_substitutions.ChromeOSGtestFilterFile(test_config, None, {})
Brian Sheedy9517d1c2022-04-08 01:17:01106
107 def testUnknownPool(self):
108 test_config = CreateConfigWithPool('totally-legit-pool')
109 with self.assertRaisesRegex(RuntimeError, 'Unknown CrOS pool *'):
Brian Sheedyb6491ba2022-09-26 20:49:49110 magic_substitutions.ChromeOSGtestFilterFile(test_config, None, {})
Brian Sheedy9517d1c2022-04-08 01:17:01111
112
Garrett Beatyade673d2023-08-04 22:00:25113def CreateConfigWithGpu(gpu):
Brian Sheedyb18cb762020-06-30 00:09:29114 return {
115 'swarming': {
Garrett Beatyade673d2023-08-04 22:00:25116 'dimensions': {
117 'gpu': gpu,
118 },
Brian Sheedyb18cb762020-06-30 00:09:29119 },
120 }
121
122
Brian Sheedy0b46d6b2023-11-27 21:33:02123class GPUExpectedVendorId(unittest.TestCase):
124 def testSingleGpuSingleDimension(self):
125 test_config = CreateConfigWithGpu('vendor:device1-driver')
126 self.assertEqual(
127 magic_substitutions.GPUExpectedVendorId(test_config, None, {}),
128 ['--expected-vendor-id', 'vendor'])
129
130 def testDoubleGpuSingleDimension(self):
131 test_config = CreateConfigWithGpu(
132 'vendor:device1-driver|vendor:device2-driver')
133 self.assertEqual(
134 magic_substitutions.GPUExpectedVendorId(test_config, None, {}),
135 ['--expected-vendor-id', 'vendor'])
136
137 def testDoubleGpuSingleDimensionDifferentVendors(self):
138 test_config = CreateConfigWithGpu(
139 'vendor:device1-driver|vendor2:device2-driver')
140 with self.assertRaises(AssertionError):
141 magic_substitutions.GPUExpectedVendorId(test_config, None, {})
142
143 def testAppleSilicon(self):
144 test_config = CreateConfigWithGpu('apple:m1')
145 self.assertEqual(
146 magic_substitutions.GPUExpectedVendorId(test_config, None, {}),
147 ['--expected-vendor-id', '106b'])
148
149 def testNoGpu(self):
150 test_config = {
151 'swarming': {
152 'dimensions': {},
153 },
154 }
155 self.assertEqual(
156 magic_substitutions.GPUExpectedVendorId(test_config, None, {}),
157 ['--expected-vendor-id', '0'])
158
159 def testNoDimensions(self):
160 with self.assertRaises(AssertionError):
161 magic_substitutions.GPUExpectedVendorId({}, None, {})
162
163 def testSkylabKnownBoard(self):
164 test_config = {
165 'name': 'test_name',
166 'cros_board': 'volteer',
167 }
168 tester_config = {
169 'browser_config': 'cros-chrome',
170 'use_swarming': False,
171 }
172 self.assertEqual(
173 magic_substitutions.GPUExpectedVendorId(test_config, None,
174 tester_config),
175 ['--expected-vendor-id', '8086'])
176
177 def testSkylabUnknownBoard(self):
178 test_config = {
179 'name': 'test_name',
180 'cros_board': 'fancy_new_board',
181 }
182 tester_config = {
183 'browser_config': 'cros-chrome',
184 'use_swarming': False,
185 }
186 self.assertEqual(
187 magic_substitutions.GPUExpectedVendorId(test_config, None,
188 tester_config),
189 ['--expected-vendor-id', '0'])
190
191
Brian Sheedyb18cb762020-06-30 00:09:29192class GPUExpectedDeviceId(unittest.TestCase):
193 def assertDeviceIdCorrectness(self, retval, device_ids):
194 self.assertEqual(len(retval), 2 * len(device_ids))
Jamie Madillcf4f8c72021-05-20 19:24:23195 for i in range(0, len(retval), 2):
Brian Sheedyb18cb762020-06-30 00:09:29196 self.assertEqual(retval[i], '--expected-device-id')
197 for d in device_ids:
198 self.assertIn(d, retval)
199
200 def testSingleGpuSingleDimension(self):
Garrett Beatyade673d2023-08-04 22:00:25201 test_config = CreateConfigWithGpu('vendor:device1-driver')
Brian Sheedyb18cb762020-06-30 00:09:29202 self.assertDeviceIdCorrectness(
Brian Sheedyb6491ba2022-09-26 20:49:49203 magic_substitutions.GPUExpectedDeviceId(test_config, None, {}),
204 ['device1'])
Brian Sheedyb18cb762020-06-30 00:09:29205
Brian Sheedyb18cb762020-06-30 00:09:29206 def testDoubleGpuSingleDimension(self):
Garrett Beatyade673d2023-08-04 22:00:25207 test_config = CreateConfigWithGpu(
208 'vendor:device1-driver|vendor:device2-driver')
Brian Sheedyb18cb762020-06-30 00:09:29209 self.assertDeviceIdCorrectness(
Brian Sheedyb6491ba2022-09-26 20:49:49210 magic_substitutions.GPUExpectedDeviceId(test_config, None, {}),
Brian Sheedyb18cb762020-06-30 00:09:29211 ['device1', 'device2'])
212
Brian Sheedy0b46d6b2023-11-27 21:33:02213 def testAppleSilicon(self):
214 test_config = CreateConfigWithGpu('apple:m1')
215 self.assertDeviceIdCorrectness(
216 magic_substitutions.GPUExpectedDeviceId(test_config, None, {}), ['0'])
217
Brian Sheedyb18cb762020-06-30 00:09:29218 def testNoGpu(self):
219 self.assertDeviceIdCorrectness(
220 magic_substitutions.GPUExpectedDeviceId(
221 {'swarming': {
Garrett Beatyade673d2023-08-04 22:00:25222 'dimensions': {}
Brian Sheedyb6491ba2022-09-26 20:49:49223 }}, None, {}), ['0'])
Brian Sheedyb18cb762020-06-30 00:09:29224
225 def testNoDimensions(self):
226 with self.assertRaises(AssertionError):
Brian Sheedyb6491ba2022-09-26 20:49:49227 magic_substitutions.GPUExpectedDeviceId({}, None, {})
Brian Sheedy5f173bb2021-11-24 00:45:54228
Brian Sheedy0b46d6b2023-11-27 21:33:02229 def testSkylabKnownBoard(self):
230 test_config = {
231 'name': 'test_name',
232 'cros_board': 'volteer',
233 }
234 tester_config = {
235 'browser_config': 'cros-chrome',
236 'use_swarming': False,
237 }
238 self.assertDeviceIdCorrectness(
239 magic_substitutions.GPUExpectedDeviceId(test_config, None,
240 tester_config), ['9a49'])
241
242 def testSkylabUnknownBoard(self):
243 test_config = {
244 'name': 'test_name',
245 'cros_board': 'fancy_new_board',
246 }
247 tester_config = {
248 'browser_config': 'cros-chrome',
249 'use_swarming': False,
250 }
251 self.assertDeviceIdCorrectness(
252 magic_substitutions.GPUExpectedDeviceId(test_config, None,
253 tester_config), ['0'])
254
Brian Sheedy5f173bb2021-11-24 00:45:54255
Brian Sheedy910cda82022-07-19 11:58:34256class GPUParallelJobs(unittest.TestCase):
257 def testNoOsType(self):
Garrett Beatyade673d2023-08-04 22:00:25258 test_config = CreateConfigWithGpu('vendor:device1-driver')
Brian Sheedy910cda82022-07-19 11:58:34259 with self.assertRaises(AssertionError):
Brian Sheedyd544b662023-07-06 20:14:38260 magic_substitutions.GPUParallelJobs(test_config, 'name', {})
Brian Sheedy910cda82022-07-19 11:58:34261
262 def testParallelJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25263 test_config = CreateConfigWithGpu('vendor:device1-driver')
Brian Sheedy910cda82022-07-19 11:58:34264 for os_type in ['lacros', 'linux', 'mac', 'win']:
Brian Sheedyd544b662023-07-06 20:14:38265 retval = magic_substitutions.GPUParallelJobs(test_config, 'name',
Brian Sheedy910cda82022-07-19 11:58:34266 {'os_type': os_type})
267 self.assertEqual(retval, ['--jobs=4'])
268
269 def testSerialJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25270 test_config = CreateConfigWithGpu('vendor:device1-driver')
Brian Sheedy910cda82022-07-19 11:58:34271 for os_type in ['android', 'chromeos', 'fuchsia']:
Brian Sheedyd544b662023-07-06 20:14:38272 retval = magic_substitutions.GPUParallelJobs(test_config, 'name',
Brian Sheedy910cda82022-07-19 11:58:34273 {'os_type': os_type})
274 self.assertEqual(retval, ['--jobs=1'])
275
Austin Eng479701f2022-08-19 13:32:50276 def testWebGPUCTSWindowsIntelSerialJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25277 intel_config = CreateConfigWithGpu('8086:device1-driver')
278 amd_config = CreateConfigWithGpu('1002:device1-driver')
Austin Eng479701f2022-08-19 13:32:50279
Brian Sheedyf98717032023-03-20 18:30:19280 for gpu_config in [intel_config, amd_config]:
Austin Eng479701f2022-08-19 13:32:50281 for name, telemetry_test_name in [('webgpu_cts', None),
282 (None, 'webgpu_cts')]:
283 is_intel = intel_config == gpu_config
284 c = gpu_config.copy()
285 if name:
286 c['name'] = name
287 if telemetry_test_name:
288 c['telemetry_test_name'] = telemetry_test_name
289 for os_type in ['lacros', 'linux', 'mac', 'win']:
Brian Sheedyd544b662023-07-06 20:14:38290 retval = magic_substitutions.GPUParallelJobs(c, 'name',
Austin Eng479701f2022-08-19 13:32:50291 {'os_type': os_type})
292 if is_intel and os_type == 'win':
293 self.assertEqual(retval, ['--jobs=1'])
294 else:
295 self.assertEqual(retval, ['--jobs=4'])
296
Brian Sheedy7ac35952022-10-20 20:31:04297 def testWebGLWindowsIntelParallelJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25298 intel_config = CreateConfigWithGpu('8086:device1-driver')
299 amd_config = CreateConfigWithGpu('1002:device1-driver')
Brian Sheedy7ac35952022-10-20 20:31:04300 for gpu_config in [intel_config, amd_config]:
301 for name, telemetry_test_name in [('webgl_conformance', None),
Yuly Novikov0aba6f7e2022-11-22 21:24:33302 ('webgl1_conformance', None),
303 ('webgl2_conformance', None),
304 (None, 'webgl1_conformance'),
305 (None, 'webgl2_conformance')]:
Brian Sheedy7ac35952022-10-20 20:31:04306 is_intel = intel_config == gpu_config
307 c = gpu_config.copy()
308 if name:
309 c['name'] = name
310 if telemetry_test_name:
311 c['telemetry_test_name'] = telemetry_test_name
312 for os_type in ['lacros', 'linux', 'mac', 'win']:
Brian Sheedyd544b662023-07-06 20:14:38313 retval = magic_substitutions.GPUParallelJobs(c, 'name',
Brian Sheedy7ac35952022-10-20 20:31:04314 {'os_type': os_type})
315 if is_intel and os_type == 'win':
316 self.assertEqual(retval, ['--jobs=2'])
317 else:
318 self.assertEqual(retval, ['--jobs=4'])
319
Brian Sheedyf98717032023-03-20 18:30:19320 def testWebGLMacNvidiaParallelJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25321 amd_config = CreateConfigWithGpu('1002:device1-driver')
322 nvidia_config = CreateConfigWithGpu('10de:device1-driver')
Brian Sheedyf98717032023-03-20 18:30:19323
324 for gpu_config in [nvidia_config, amd_config]:
Brian Sheedyd544b662023-07-06 20:14:38325 for name, telemetry_test_name in [('webgl1_conformance', None),
326 (None, 'webgl1_conformance')]:
Brian Sheedyf98717032023-03-20 18:30:19327 is_nvidia = gpu_config == nvidia_config
328 c = gpu_config.copy()
329 if name:
330 c['name'] = name
331 if telemetry_test_name:
332 c['telemetry_test_name'] = telemetry_test_name
333 for os_type in ['lacros', 'linux', 'mac', 'win']:
Brian Sheedyd544b662023-07-06 20:14:38334 retval = magic_substitutions.GPUParallelJobs(c, 'name',
Brian Sheedyf98717032023-03-20 18:30:19335 {'os_type': os_type})
336 if is_nvidia and os_type == 'mac':
337 self.assertEqual(retval, ['--jobs=3'])
338 else:
339 self.assertEqual(retval, ['--jobs=4'])
340
Brian Sheedyd544b662023-07-06 20:14:38341 def testPixelMacDebugParallelJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25342 gpu_config = CreateConfigWithGpu('1002:device1-driver')
Brian Sheedyd544b662023-07-06 20:14:38343 for name, telemetry_test_name in [('pixel_skia_gold_test', None),
344 (None, 'pixel')]:
345 c = gpu_config.copy()
346 if name:
347 c['name'] = name
348 if telemetry_test_name:
349 c['telemetry_test_name'] = telemetry_test_name
350 for os_type in ['lacros', 'linux', 'mac', 'win']:
351 for tester_name in ('Name Debug', 'Name Dbg', 'name debug', 'name dbg'):
352 retval = magic_substitutions.GPUParallelJobs(c, tester_name,
353 {'os_type': os_type})
354 if os_type == 'mac':
355 self.assertEqual(retval, ['--jobs=1'])
356 else:
357 self.assertEqual(retval, ['--jobs=4'])
358 # Double check that non-debug Mac pixel tests still get parallelized.
359 retval = magic_substitutions.GPUParallelJobs(c, 'name release',
360 {'os_type': 'mac'})
361 self.assertEqual(retval, ['--jobs=4'])
362
363 def testPixelMacNvidiaParallelJobs(self):
Garrett Beatyade673d2023-08-04 22:00:25364 gpu_config = CreateConfigWithGpu('10de:device1-driver')
Brian Sheedyd544b662023-07-06 20:14:38365 for name, telemetry_test_name in [('pixel_skia_gold_test', None),
366 (None, 'pixel')]:
367 c = gpu_config.copy()
368 if name:
369 c['name'] = name
370 if telemetry_test_name:
371 c['telemetry_test_name'] = telemetry_test_name
372 for os_type in ['lacros', 'linux', 'mac', 'win']:
373 retval = magic_substitutions.GPUParallelJobs(c, 'name',
374 {'os_type': os_type})
375 if os_type == 'mac':
376 self.assertEqual(retval, ['--jobs=1'])
377 else:
378 self.assertEqual(retval, ['--jobs=4'])
379
Brian Sheedy910cda82022-07-19 11:58:34380
Garrett Beatyade673d2023-08-04 22:00:25381def CreateConfigWithDeviceType(device_type):
Brian Sheedyba13cf522022-09-13 21:00:09382 return {
383 'swarming': {
Garrett Beatyade673d2023-08-04 22:00:25384 'dimensions': {
385 'device_type': device_type,
386 },
Brian Sheedyba13cf522022-09-13 21:00:09387 },
388 }
389
390
391class GPUTelemetryNoRootForUnrootedDevices(unittest.TestCase):
392 def testNoOsType(self):
Garrett Beatyade673d2023-08-04 22:00:25393 test_config = CreateConfigWithDeviceType('a13')
Brian Sheedyba13cf522022-09-13 21:00:09394 with self.assertRaises(AssertionError):
395 magic_substitutions.GPUTelemetryNoRootForUnrootedDevices(
396 test_config, None, {})
397
398 def testNonAndroidOs(self):
399 retval = magic_substitutions.GPUTelemetryNoRootForUnrootedDevices(
400 {}, None, {'os_type': 'linux'})
401 self.assertEqual(retval, [])
402
403 def testUnrootedDevices(self):
Brian Sheedy9c404d62024-12-16 16:26:09404 devices = ('a13', 'a13ve', 'a23', 'dm1q', 'devonn')
Brian Sheedyba13cf522022-09-13 21:00:09405 for d in devices:
Garrett Beatyade673d2023-08-04 22:00:25406 test_config = CreateConfigWithDeviceType(d)
Brian Sheedyba13cf522022-09-13 21:00:09407 retval = magic_substitutions.GPUTelemetryNoRootForUnrootedDevices(
408 test_config, None, {'os_type': 'android'})
409 self.assertEqual(retval,
410 ['--compatibility-mode=dont-require-rooted-device'])
411
Brian Sheedyba13cf522022-09-13 21:00:09412 def testRootedDevices(self):
Garrett Beatyade673d2023-08-04 22:00:25413 test_config = CreateConfigWithDeviceType('hammerhead')
Brian Sheedyba13cf522022-09-13 21:00:09414 retval = magic_substitutions.GPUTelemetryNoRootForUnrootedDevices(
415 test_config, None, {'os_type': 'android'})
416 self.assertEqual(retval, [])
417
418
Brian Sheedy55140f72023-06-02 17:32:23419class GPUWebGLRuntimeFile(unittest.TestCase):
420 def testNoOsType(self):
421 test_config = {'telemetry_test_name': 'webgl1_conformance'}
422 with self.assertRaises(AssertionError):
423 magic_substitutions.GPUWebGLRuntimeFile(test_config, None, {})
424
425 def testNoSuite(self):
426 tester_config = {'os_type': 'linux'}
427 with self.assertRaises(AssertionError):
428 magic_substitutions.GPUWebGLRuntimeFile({}, None, tester_config)
429
430 def testUnknownSuite(self):
431 test_config = {'telemetry_test_name': 'foo'}
432 tester_config = {'os_type': 'linux'}
433 with self.assertRaises(AssertionError):
434 magic_substitutions.GPUWebGLRuntimeFile(test_config, None, tester_config)
435
436 def testKnownOsTypes(self):
437 for os_type in ('android', 'linux', 'mac', 'win'):
438 for suite in ('webgl1_conformance', 'webgl2_conformance'):
439 retval = magic_substitutions.GPUWebGLRuntimeFile(
440 {'telemetry_test_name': suite}, None, {'os_type': os_type})
441 self.assertEqual(retval, [
442 '--read-abbreviated-json-results-from=../../content/test/data/gpu/'
443 f'{suite}_{os_type}_runtimes.json'
444 ])
445
446 def testUnknownOsType(self):
447 for suite in ('webgl1_conformance', 'webgl2_conformance'):
448 retval = magic_substitutions.GPUWebGLRuntimeFile(
449 {'telemetry_test_name': suite}, None, {'os_type': 'foo'})
450 self.assertEqual(retval, [
451 '--read-abbreviated-json-results-from=../../content/test/data/gpu/'
452 f'{suite}_linux_runtimes.json'
453 ])
454
455
Brian Sheedya31578e2020-05-18 20:24:36456if __name__ == '__main__':
457 unittest.main()