Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: telemetry/telemetry/story/expectations.py

Issue 3001873002: [Telemetry] Add CanRunOnPlatform to story_runner and benchmark class. (Closed)
Patch Set: Charlies comments Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « telemetry/telemetry/internal/story_runner_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 6
7 7
8 class StoryExpectations(object): 8 class StoryExpectations(object):
9 """An object that contains disabling expectations for benchmarks and stories. 9 """An object that contains disabling expectations for benchmarks and stories.
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 """ 128 """
129 for conditions, reason in self._expectations.get(story.name, []): 129 for conditions, reason in self._expectations.get(story.name, []):
130 for condition in conditions: 130 for condition in conditions:
131 if condition.ShouldDisable(platform, finder_options): 131 if condition.ShouldDisable(platform, finder_options):
132 logging.info('%s is disabled on %s due to %s.', 132 logging.info('%s is disabled on %s due to %s.',
133 story.name, condition, reason) 133 story.name, condition, reason)
134 return reason 134 return reason
135 return None 135 return None
136 136
137 137
138 # TODO(rnephew): Since TestConditions are being used for more than
139 # just story expectations now, this should be decoupled and refactored
140 # to be clearer.
138 class _TestCondition(object): 141 class _TestCondition(object):
139 def ShouldDisable(self, platform, finder_options): 142 def ShouldDisable(self, platform, finder_options):
140 raise NotImplementedError 143 raise NotImplementedError
141 144
142 def __str__(self): 145 def __str__(self):
143 raise NotImplementedError 146 raise NotImplementedError
144 147
145 148
146 class _TestConditionByPlatformList(_TestCondition): 149 class _TestConditionByPlatformList(_TestCondition):
147 def __init__(self, platforms, name): 150 def __init__(self, platforms, name):
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 'W6210', 'Cherry Mobile Android One') 236 'W6210', 'Cherry Mobile Android One')
234 ANDROID_SVELTE = _TestConditionAndroidSvelte() 237 ANDROID_SVELTE = _TestConditionAndroidSvelte()
235 ANDROID_WEBVIEW = _TestConditionAndroidWebview() 238 ANDROID_WEBVIEW = _TestConditionAndroidWebview()
236 ANDROID_NOT_WEBVIEW = _TestConditionAndroidNotWebview() 239 ANDROID_NOT_WEBVIEW = _TestConditionAndroidNotWebview()
237 # MAC_10_11 Includes: 240 # MAC_10_11 Includes:
238 # Mac 10.11 Perf, Mac Retina Perf, Mac Pro 10.11 Perf, Mac Air 10.11 Perf 241 # Mac 10.11 Perf, Mac Retina Perf, Mac Pro 10.11 Perf, Mac Air 10.11 Perf
239 MAC_10_11 = _TestConditionByMacVersion('10.11', 'Mac 10.11') 242 MAC_10_11 = _TestConditionByMacVersion('10.11', 'Mac 10.11')
240 # Mac 10_12 Includes: 243 # Mac 10_12 Includes:
241 # Mac 10.12 Perf, Mac Mini 8GB 10.12 Perf 244 # Mac 10.12 Perf, Mac Mini 8GB 10.12 Perf
242 MAC_10_12 = _TestConditionByMacVersion('10.12', 'Mac 10.12') 245 MAC_10_12 = _TestConditionByMacVersion('10.12', 'Mac 10.12')
OLDNEW
« no previous file with comments | « telemetry/telemetry/internal/story_runner_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698