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 every benchmark that has a composable measurement. | 5 """Run the first page of every benchmark that has a composable measurement. |
6 | 6 |
7 Ideally this test would be comprehensive, but the above serves as a | 7 Ideally this test would be comprehensive, but the above serves as a |
8 kind of smoke test. | 8 kind of smoke test. |
9 """ | 9 """ |
10 | 10 |
11 import os | 11 import os |
12 import unittest | 12 import unittest |
13 | 13 |
14 from telemetry import benchmark as benchmark_module | 14 from telemetry import benchmark as benchmark_module |
15 from telemetry.core import discover | 15 from telemetry.core import discover |
16 from telemetry.page import page_measurement | 16 from telemetry.page import page_measurement |
17 from telemetry.unittest import options_for_unittests | 17 from telemetry.unittest import options_for_unittests |
18 from telemetry.unittest import output_formatter | 18 from telemetry.unittest import output_formatter |
19 | 19 |
20 | 20 |
21 def SmokeTestGenerator(benchmark): | 21 def SmokeTestGenerator(benchmark): |
22 # In general you should @benchmark_module.Disabled individual benchmarks that | 22 # In general you should @benchmark_module.Disabled individual benchmarks that |
23 # fail, instead of this entire smoke test suite. | 23 # fail, instead of this entire smoke test suite. |
24 # TODO(achuith): Multiple tests failing on CrOS. crbug.com/351114 | 24 # TODO(achuith): Multiple tests failing on CrOS. crbug.com/351114 |
25 @benchmark_module.Disabled('chromeos') | 25 @benchmark_module.Disabled('chromeos') |
26 # Flaky, http://crbug.com/400747 . | |
27 @benchmark_module.Disabled('mac') | |
tonyg
2014/08/05 15:19:46
This isn't the right fix for this. Please see comm
| |
26 def BenchmarkSmokeTest(self): | 28 def BenchmarkSmokeTest(self): |
27 # Only measure a single page so that this test cycles reasonably quickly. | 29 # Only measure a single page so that this test cycles reasonably quickly. |
28 benchmark.options['pageset_repeat'] = 1 | 30 benchmark.options['pageset_repeat'] = 1 |
29 benchmark.options['page_repeat'] = 1 | 31 benchmark.options['page_repeat'] = 1 |
30 | 32 |
31 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 | 33 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 |
32 def CreatePageSet(self, options): | 34 def CreatePageSet(self, options): |
33 # pylint: disable=E1002 | 35 # pylint: disable=E1002 |
34 ps = super(SinglePageBenchmark, self).CreatePageSet(options) | 36 ps = super(SinglePageBenchmark, self).CreatePageSet(options) |
35 ps.pages = ps.pages[:1] | 37 ps.pages = ps.pages[:1] |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 if hasattr(benchmark, 'generated_profile_archive'): | 83 if hasattr(benchmark, 'generated_profile_archive'): |
82 # We'd like to test these, but don't know how yet. | 84 # We'd like to test these, but don't know how yet. |
83 continue | 85 continue |
84 | 86 |
85 class BenchmarkSmokeTest(unittest.TestCase): | 87 class BenchmarkSmokeTest(unittest.TestCase): |
86 pass | 88 pass |
87 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) | 89 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) |
88 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 90 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
89 | 91 |
90 return suite | 92 return suite |
OLD | NEW |