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

Side by Side Diff: telemetry/telemetry/internal/story_runner.py

Issue 2265423005: Updating telemetry logic to return success when a disabled test is run. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: Manually replaying changes after merge Created 4 years, 2 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 | « no previous file | telemetry/telemetry/page/shared_page_state.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import optparse 6 import optparse
7 import os 7 import os
8 import sys 8 import sys
9 import time 9 import time
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 Returns: 277 Returns:
278 The number of failure values (up to 254) or 255 if there is an uncaught 278 The number of failure values (up to 254) or 255 if there is an uncaught
279 exception. 279 exception.
280 """ 280 """
281 benchmark.CustomizeBrowserOptions(finder_options.browser_options) 281 benchmark.CustomizeBrowserOptions(finder_options.browser_options)
282 282
283 benchmark_metadata = benchmark.GetMetadata() 283 benchmark_metadata = benchmark.GetMetadata()
284 possible_browser = browser_finder.FindBrowser(finder_options) 284 possible_browser = browser_finder.FindBrowser(finder_options)
285 if (possible_browser and 285 if (possible_browser and
286 not decorators.IsBenchmarkEnabled(benchmark, possible_browser)): 286 not decorators.IsBenchmarkEnabled(benchmark, possible_browser)):
287 logging.warning('%s is disabled on the selected browser', benchmark.Name()) 287 print '%s is disabled on the selected browser' % benchmark.Name()
288 if finder_options.run_disabled_tests: 288 if finder_options.run_disabled_tests:
289 logging.warning( 289 print 'Running benchmark anyway due to: --also-run-disabled-tests'
290 'Running benchmark anyway due to: --also-run-disabled-tests')
291 else: 290 else:
292 logging.warning( 291 print 'Try --also-run-disabled-tests to force the benchmark to run.'
293 'Try --also-run-disabled-tests to force the benchmark to run.')
294 # If chartjson is specified, this will print a dict indicating the 292 # If chartjson is specified, this will print a dict indicating the
295 # benchmark name and disabled state. crrev.com/2265423005 will update 293 # benchmark name and disabled state.
296 # this return value once this logic is plumbed through the recipe.
297 with results_options.CreateResults( 294 with results_options.CreateResults(
298 benchmark_metadata, finder_options, 295 benchmark_metadata, finder_options,
299 benchmark.ValueCanBeAddedPredicate, benchmark_enabled=False 296 benchmark.ValueCanBeAddedPredicate, benchmark_enabled=False
300 ) as results: 297 ) as results:
301 results.PrintSummary() 298 results.PrintSummary()
302 return 1 299 # When a disabled benchmark is run we now want to return success since
300 # we are no longer filtering these out in the buildbot recipes.
301 return 0
303 302
304 pt = benchmark.CreatePageTest(finder_options) 303 pt = benchmark.CreatePageTest(finder_options)
305 pt.__name__ = benchmark.__class__.__name__ 304 pt.__name__ = benchmark.__class__.__name__
306 305
307 disabled_attr_name = decorators.DisabledAttributeName(benchmark) 306 disabled_attr_name = decorators.DisabledAttributeName(benchmark)
308 # pylint: disable=protected-access 307 # pylint: disable=protected-access
309 pt._disabled_strings = getattr(benchmark, disabled_attr_name, set()) 308 pt._disabled_strings = getattr(benchmark, disabled_attr_name, set())
310 if hasattr(benchmark, '_enabled_strings'): 309 if hasattr(benchmark, '_enabled_strings'):
311 # pylint: disable=protected-access 310 # pylint: disable=protected-access
312 pt._enabled_strings = benchmark._enabled_strings 311 pt._enabled_strings = benchmark._enabled_strings
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 logging.warning('Device is thermally throttled before running ' 428 logging.warning('Device is thermally throttled before running '
430 'performance tests, results will vary.') 429 'performance tests, results will vary.')
431 430
432 431
433 def _CheckThermalThrottling(platform): 432 def _CheckThermalThrottling(platform):
434 if not platform.CanMonitorThermalThrottling(): 433 if not platform.CanMonitorThermalThrottling():
435 return 434 return
436 if platform.HasBeenThermallyThrottled(): 435 if platform.HasBeenThermallyThrottled():
437 logging.warning('Device has been thermally throttled during ' 436 logging.warning('Device has been thermally throttled during '
438 'performance tests, results will vary.') 437 'performance tests, results will vary.')
OLDNEW
« no previous file with comments | « no previous file | telemetry/telemetry/page/shared_page_state.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698