| Index: telemetry/telemetry/internal/story_runner.py
|
| diff --git a/telemetry/telemetry/internal/story_runner.py b/telemetry/telemetry/internal/story_runner.py
|
| index 7c67856ba008dd77231aa66daa6f2693c0227895..f464fe75edeea3456168982121ca32be4ecc0714 100644
|
| --- a/telemetry/telemetry/internal/story_runner.py
|
| +++ b/telemetry/telemetry/internal/story_runner.py
|
| @@ -187,7 +187,8 @@ def StoriesGroupedByStateClass(story_set, allow_multiple_groups):
|
|
|
|
|
| def Run(test, story_set, finder_options, results, max_failures=None,
|
| - tear_down_after_story=False, tear_down_after_story_set=False):
|
| + tear_down_after_story=False, tear_down_after_story_set=False,
|
| + expectations=None):
|
| """Runs a given test against a given page_set with the given options.
|
|
|
| Stop execution for unexpected exceptions such as KeyboardInterrupt.
|
| @@ -237,6 +238,14 @@ def Run(test, story_set, finder_options, results, max_failures=None,
|
| test, finder_options.Copy(), story_set)
|
|
|
| results.WillRunPage(story, storyset_repeat_counter)
|
| +
|
| + if expectations:
|
| + disabled = expectations.IsStoryDisabled(story, state.platform)
|
| + if disabled and not finder_options.run_disabled_tests:
|
| + results.AddValue(skip.SkipValue(story, disabled))
|
| + results.DidRunPage(story)
|
| + continue
|
| +
|
| try:
|
| state.platform.WaitForBatteryTemperature(35)
|
| _WaitForThermalThrottlingIfNeeded(state.platform)
|
| @@ -306,15 +315,23 @@ def RunBenchmark(benchmark, finder_options):
|
|
|
| benchmark_metadata = benchmark.GetMetadata()
|
| possible_browser = browser_finder.FindBrowser(finder_options)
|
| + expectations = benchmark.GetExpectations()
|
| +
|
| if not possible_browser:
|
| print ('Cannot find browser of type %s. To list out all '
|
| 'available browsers, rerun your command with '
|
| '--browser=list' % finder_options.browser_options.browser_type)
|
| return 1
|
| - if (possible_browser and
|
| - not decorators.IsBenchmarkEnabled(benchmark, possible_browser)):
|
| +
|
| + permanently_disabled = expectations.IsBenchmarkDisabled(
|
| + possible_browser.platform)
|
| + # TODO(rnephew): Remove decorators.IsBenchmarkEnabled when deprecated.
|
| + temporarily_disabled = not decorators.IsBenchmarkEnabled(
|
| + benchmark, possible_browser)
|
| +
|
| + if permanently_disabled or temporarily_disabled:
|
| print '%s is disabled on the selected browser' % benchmark.Name()
|
| - if finder_options.run_disabled_tests:
|
| + if finder_options.run_disabled_tests and not permanently_disabled:
|
| print 'Running benchmark anyway due to: --also-run-disabled-tests'
|
| else:
|
| print 'Try --also-run-disabled-tests to force the benchmark to run.'
|
| @@ -362,7 +379,8 @@ def RunBenchmark(benchmark, finder_options):
|
| try:
|
| Run(pt, stories, finder_options, results, benchmark.max_failures,
|
| should_tear_down_state_after_each_story_run,
|
| - benchmark.ShouldTearDownStateAfterEachStorySetRun())
|
| + benchmark.ShouldTearDownStateAfterEachStorySetRun(),
|
| + expectations=expectations)
|
| return_code = min(254, len(results.failures))
|
| except Exception:
|
| exception_formatter.PrintFormattedException()
|
|
|