| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 all system health stories used by system health benchmarks. | 5 """Run all system health stories used by system health benchmarks. |
| 6 | 6 |
| 7 Only memory benchmarks are used when running these stories to make the total | 7 Only memory benchmarks are used when running these stories to make the total |
| 8 cycle time manageable. Other system health benchmarks should be using the same | 8 cycle time manageable. Other system health benchmarks should be using the same |
| 9 stories as memory ones, only with fewer actions (no memory dumping). | 9 stories as memory ones, only with fewer actions (no memory dumping). |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import unittest | 12 import unittest |
| 13 | 13 |
| 14 from core import perf_benchmark | 14 from core import perf_benchmark |
| 15 | 15 |
| 16 from telemetry import benchmark as benchmark_module | 16 from telemetry import benchmark as benchmark_module |
| 17 from telemetry import decorators | 17 from telemetry import decorators |
| 18 from telemetry.core import discover | 18 from telemetry.core import discover |
| 19 from telemetry.internal.browser import browser_finder | 19 from telemetry.internal.browser import browser_finder |
| 20 from telemetry.testing import options_for_unittests | 20 from telemetry.testing import options_for_unittests |
| 21 from telemetry.testing import progress_reporter | 21 from telemetry.testing import progress_reporter |
| 22 | 22 |
| 23 from benchmarks import system_health | 23 from benchmarks import system_health |
| 24 | 24 |
| 25 | 25 |
| 26 # We only cover memory system health | |
| 27 _SH_BENCHMARKS_TO_SMOKE_TEST = [ | |
| 28 system_health.DesktopMemorySystemHealth, | |
| 29 system_health.MobileMemorySystemHealth, | |
| 30 ] | |
| 31 | |
| 32 | |
| 33 def GetSystemHealthBenchmarksToSmokeTest(): | 26 def GetSystemHealthBenchmarksToSmokeTest(): |
| 34 sh_benchmark_classes = discover.DiscoverClassesInModule( | 27 sh_benchmark_classes = discover.DiscoverClassesInModule( |
| 35 system_health, perf_benchmark.PerfBenchmark, | 28 system_health, perf_benchmark.PerfBenchmark, |
| 36 index_by_class_name=True).values() | 29 index_by_class_name=True).values() |
| 37 return list(b for b in sh_benchmark_classes if | 30 return list(b for b in sh_benchmark_classes if |
| 38 b.Name().startswith('system_health.memory')) | 31 b.Name().startswith('system_health.memory')) |
| 39 | 32 |
| 40 | 33 |
| 41 _DISABLED_TESTS = frozenset({ | 34 _DISABLED_TESTS = frozenset({ |
| 42 # crbug.com/624474 | 35 # crbug.com/624474 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 # parsed during test time which happens after load_tests are called. | 126 # parsed during test time which happens after load_tests are called. |
| 134 # Since none of our system health benchmarks creates stories based on | 127 # Since none of our system health benchmarks creates stories based on |
| 135 # command line options, it should be ok to pass options=None to | 128 # command line options, it should be ok to pass options=None to |
| 136 # CreateStorySet. | 129 # CreateStorySet. |
| 137 for story_to_smoke_test in ( | 130 for story_to_smoke_test in ( |
| 138 benchmark_class().CreateStorySet(options=None).stories): | 131 benchmark_class().CreateStorySet(options=None).stories): |
| 139 suite.addTest( | 132 suite.addTest( |
| 140 _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test)) | 133 _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test)) |
| 141 | 134 |
| 142 return suite | 135 return suite |
| OLD | NEW |