Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: telemetry/telemetry/internal/story_runner_unittest.py

Issue 3001873002: [Telemetry] Add CanRunOnPlatform to story_runner and benchmark class. (Closed)
Patch Set: Make Method Private Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: telemetry/telemetry/internal/story_runner_unittest.py
diff --git a/telemetry/telemetry/internal/story_runner_unittest.py b/telemetry/telemetry/internal/story_runner_unittest.py
index f50a425966a0887d4c68c11c4ac45b0ffd9379c5..4da4bc94c4a96b78b3f02ad4dd9211ea98f78107 100644
--- a/telemetry/telemetry/internal/story_runner_unittest.py
+++ b/telemetry/telemetry/internal/story_runner_unittest.py
@@ -1252,6 +1252,22 @@ class StoryRunnerTest(unittest.TestCase):
options.run_disabled_tests = False
return options
+ def testRunBenchmarkDisabledBenchmarkViaCanRunonPlatform(self):
+ fake_benchmark = FakeBenchmark()
+ fake_benchmark.SUPPORTED_PLATFORMS = []
+ options = self._GenerateBaseBrowserFinderOptions()
+ tmp_path = tempfile.mkdtemp()
+ try:
+ options.output_dir = tmp_path
+ story_runner.RunBenchmark(fake_benchmark, options)
+ with open(os.path.join(tmp_path, 'results-chart.json')) as f:
+ data = json.load(f)
+ self.assertFalse(data['enabled'])
+ finally:
+ shutil.rmtree(tmp_path)
+
+ # TODO(rnephew): Remove this test when we no longer use
charliea (OOO until 10-5) 2017/08/22 17:22:18 Won't "PermanentlyDisableBenchmark" just become "T
rnephew (Reviews Here) 2017/08/22 17:33:20 Reworded to Refactor instead of Remove.
+ # expectations.PermanentlyDisableBenchmark() to disable benchmarks.
def testRunBenchmarkDisabledBenchmark(self):
fake_benchmark = FakeBenchmark()
fake_benchmark.disabled = True
@@ -1266,6 +1282,8 @@ class StoryRunnerTest(unittest.TestCase):
finally:
shutil.rmtree(tmp_path)
+ # TODO(rnephew): Remove this test when we no longer use
+ # expectations.PermanentlyDisableBenchmark() to disable benchmarks.
def testRunBenchmarkDisabledBenchmarkCannotOverriddenByCommandLine(self):
fake_benchmark = FakeBenchmark()
fake_benchmark.disabled = True
« telemetry/telemetry/internal/story_runner.py ('K') | « telemetry/telemetry/internal/story_runner.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698