| OLD | NEW |
| 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 """Run the first page of one benchmark for every module. | 5 """Run the first page of one benchmark for every module. |
| 6 | 6 |
| 7 Only benchmarks that have a composable measurement are included. | 7 Only benchmarks that have a composable measurement are included. |
| 8 Ideally this test would be comprehensive, however, running one page | 8 Ideally this test would be comprehensive, however, running one page |
| 9 of every benchmark would run impractically long. | 9 of every benchmark would run impractically long. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import os | 12 import os |
| 13 import unittest | 13 import unittest |
| 14 | 14 |
| 15 from telemetry import benchmark as benchmark_module | 15 from telemetry import benchmark as benchmark_module |
| 16 from telemetry.core import discover | 16 from telemetry.core import discover |
| 17 from telemetry.page import page_test | 17 from telemetry.page import page_test |
| 18 from telemetry.unittest_util import options_for_unittests | 18 from telemetry.unittest_util import options_for_unittests |
| 19 from telemetry.unittest_util import progress_reporter | 19 from telemetry.unittest_util import progress_reporter |
| 20 | 20 |
| 21 | 21 |
| 22 def SmokeTestGenerator(benchmark): | 22 def SmokeTestGenerator(benchmark): |
| 23 # NOTE TO SHERIFFS: DO NOT DISABLE THIS TEST. | 23 # NOTE TO SHERIFFS: DO NOT DISABLE THIS TEST. |
| 24 # | 24 # |
| 25 # This smoke test dynamically tests all benchmarks. So disabling it for one | 25 # This smoke test dynamically tests all benchmarks. So disabling it for one |
| 26 # failing or flaky benchmark would disable a much wider swath of coverage | 26 # failing or flaky benchmark would disable a much wider swath of coverage |
| 27 # than is usally intended. Instead, if a particular benchmark is failing, | 27 # than is usally intended. Instead, if a particular benchmark is failing, |
| 28 # disable it in tools/perf/benchmarks/*. | 28 # disable it in tools/perf/benchmarks/*. |
| 29 | 29 @benchmark_module.Disabled('chromeos') # crbug.com/351114 |
| 30 # EXCEPTIONS TO THE ABOVE RULE: crbug.com/351114, crbug.com/423688 | |
| 31 @benchmark_module.Disabled('chromeos', 'mavericks') | |
| 32 def BenchmarkSmokeTest(self): | 30 def BenchmarkSmokeTest(self): |
| 33 # Only measure a single page so that this test cycles reasonably quickly. | 31 # Only measure a single page so that this test cycles reasonably quickly. |
| 34 benchmark.options['pageset_repeat'] = 1 | 32 benchmark.options['pageset_repeat'] = 1 |
| 35 benchmark.options['page_repeat'] = 1 | 33 benchmark.options['page_repeat'] = 1 |
| 36 | 34 |
| 37 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 | 35 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 |
| 38 def CreatePageSet(self, options): | 36 def CreatePageSet(self, options): |
| 39 # pylint: disable=E1002 | 37 # pylint: disable=E1002 |
| 40 ps = super(SinglePageBenchmark, self).CreatePageSet(options) | 38 ps = super(SinglePageBenchmark, self).CreatePageSet(options) |
| 41 for p in ps.pages: | 39 for p in ps.pages: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 # in a class, and then throw the ones we don't need away instead. | 105 # in a class, and then throw the ones we don't need away instead. |
| 108 if hasattr(benchmark, '_enabled_strings'): | 106 if hasattr(benchmark, '_enabled_strings'): |
| 109 method._enabled_strings = benchmark._enabled_strings | 107 method._enabled_strings = benchmark._enabled_strings |
| 110 if hasattr(benchmark, '_disabled_strings'): | 108 if hasattr(benchmark, '_disabled_strings'): |
| 111 method._disabled_strings = benchmark._disabled_strings | 109 method._disabled_strings = benchmark._disabled_strings |
| 112 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 110 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
| 113 | 111 |
| 114 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 112 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
| 115 | 113 |
| 116 return suite | 114 return suite |
| OLD | NEW |