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 @benchmark_module.Disabled('chromeos') # crbug.com/351114 | 29 |
| 30 # EXCEPTIONS TO THE ABOVE RULE: crbug.com/351114, crbug.com/423688 |
| 31 @benchmark_module.Disabled('chromeos', 'mavericks') |
30 def BenchmarkSmokeTest(self): | 32 def BenchmarkSmokeTest(self): |
31 # Only measure a single page so that this test cycles reasonably quickly. | 33 # Only measure a single page so that this test cycles reasonably quickly. |
32 benchmark.options['pageset_repeat'] = 1 | 34 benchmark.options['pageset_repeat'] = 1 |
33 benchmark.options['page_repeat'] = 1 | 35 benchmark.options['page_repeat'] = 1 |
34 | 36 |
35 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 | 37 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 |
36 def CreatePageSet(self, options): | 38 def CreatePageSet(self, options): |
37 # pylint: disable=E1002 | 39 # pylint: disable=E1002 |
38 ps = super(SinglePageBenchmark, self).CreatePageSet(options) | 40 ps = super(SinglePageBenchmark, self).CreatePageSet(options) |
39 for p in ps.pages: | 41 for p in ps.pages: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 # in a class, and then throw the ones we don't need away instead. | 107 # in a class, and then throw the ones we don't need away instead. |
106 if hasattr(benchmark, '_enabled_strings'): | 108 if hasattr(benchmark, '_enabled_strings'): |
107 method._enabled_strings = benchmark._enabled_strings | 109 method._enabled_strings = benchmark._enabled_strings |
108 if hasattr(benchmark, '_disabled_strings'): | 110 if hasattr(benchmark, '_disabled_strings'): |
109 method._disabled_strings = benchmark._disabled_strings | 111 method._disabled_strings = benchmark._disabled_strings |
110 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 112 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
111 | 113 |
112 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 114 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
113 | 115 |
114 return suite | 116 return suite |
OLD | NEW |