| 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 """ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 self.skipTest('Benchmark %s is disabled' % SinglePageBenchmark.Name()) | 106 self.skipTest('Benchmark %s is disabled' % SinglePageBenchmark.Name()) |
| 107 | 107 |
| 108 if self.id() in _DISABLED_TESTS: | 108 if self.id() in _DISABLED_TESTS: |
| 109 self.skipTest('Test is explicitly disabled') | 109 self.skipTest('Test is explicitly disabled') |
| 110 | 110 |
| 111 self.assertEqual(0, SinglePageBenchmark().Run(options), | 111 self.assertEqual(0, SinglePageBenchmark().Run(options), |
| 112 msg='Failed: %s' % benchmark_class) | 112 msg='Failed: %s' % benchmark_class) |
| 113 | 113 |
| 114 # We attach the test method to SystemHealthBenchmarkSmokeTest dynamically | 114 # We attach the test method to SystemHealthBenchmarkSmokeTest dynamically |
| 115 # so that we can set the test method name to include | 115 # so that we can set the test method name to include |
| 116 # '<benchmark class name>.<story display name>'. | 116 # '<benchmark class name>.<story name>'. |
| 117 test_method_name = '%s.%s' % ( | 117 test_method_name = '%s.%s' % ( |
| 118 benchmark_class.Name(), story_to_smoke_test.display_name) | 118 benchmark_class.Name(), story_to_smoke_test.name) |
| 119 | 119 |
| 120 class SystemHealthBenchmarkSmokeTest(unittest.TestCase): | 120 class SystemHealthBenchmarkSmokeTest(unittest.TestCase): |
| 121 pass | 121 pass |
| 122 | 122 |
| 123 setattr(SystemHealthBenchmarkSmokeTest, test_method_name, RunTest) | 123 setattr(SystemHealthBenchmarkSmokeTest, test_method_name, RunTest) |
| 124 | 124 |
| 125 return SystemHealthBenchmarkSmokeTest(methodName=test_method_name) | 125 return SystemHealthBenchmarkSmokeTest(methodName=test_method_name) |
| 126 | 126 |
| 127 | 127 |
| 128 def GenerateBenchmarkOptions(benchmark_class): | 128 def GenerateBenchmarkOptions(benchmark_class): |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 # Prefetch WPR archive needed by the stories set to avoid race condition | 169 # Prefetch WPR archive needed by the stories set to avoid race condition |
| 170 # when feching them when tests are run in parallel. | 170 # when feching them when tests are run in parallel. |
| 171 # See crbug.com/700426 for more details. | 171 # See crbug.com/700426 for more details. |
| 172 stories_set.wpr_archive_info.DownloadArchivesIfNeeded() | 172 stories_set.wpr_archive_info.DownloadArchivesIfNeeded() |
| 173 | 173 |
| 174 for story_to_smoke_test in stories_set.stories: | 174 for story_to_smoke_test in stories_set.stories: |
| 175 suite.addTest( | 175 suite.addTest( |
| 176 _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test)) | 176 _GenerateSmokeTestCase(benchmark_class, story_to_smoke_test)) |
| 177 | 177 |
| 178 return suite | 178 return suite |
| OLD | NEW |