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

Unified Diff: telemetry/telemetry/benchmark_runner_unittest.py

Issue 2291313002: [Telemetry] Add 'check_independent' command to benchmark_runner (Closed)
Patch Set: add testdata __init__.py Created 4 years, 3 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
« no previous file with comments | « telemetry/telemetry/benchmark_runner.py ('k') | telemetry/telemetry/testdata/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/benchmark_runner_unittest.py
diff --git a/telemetry/telemetry/benchmark_runner_unittest.py b/telemetry/telemetry/benchmark_runner_unittest.py
index 266f87aa17acefab2e02a6f68eeb5fd107390785..df7ad8d7661a2b8fef68f5a4f32787601d8443da 100644
--- a/telemetry/telemetry/benchmark_runner_unittest.py
+++ b/telemetry/telemetry/benchmark_runner_unittest.py
@@ -2,10 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
+import sys
import unittest
from telemetry import benchmark
from telemetry import benchmark_runner
+from telemetry import project_config
from telemetry.testing import stream
import mock
@@ -31,6 +34,28 @@ class UnusualBenchmark(benchmark.Benchmark):
return 'I have a very unusual name'
+class BenchmarkRunnerIntegrationTests(unittest.TestCase):
+ def setUp(self):
+ top_level_dir = os.path.dirname(__file__)
+ self.config = project_config.ProjectConfig(
+ top_level_dir=top_level_dir,
+ benchmark_dirs=[os.path.join(top_level_dir, 'testdata')])
+
+ @mock.patch('sys.exit')
+ def testIndependentStoryIsIndependent(self, exit_mock):
+ with mock.patch.object(
+ sys, 'argv', ['foo', 'check_independent', 'independent']):
+ benchmark_runner.main(self.config)
+ exit_mock.assert_called_with(0)
+
+ @mock.patch('sys.exit')
+ def testDependentStoryIsDependent(self, exit_mock):
+ with mock.patch.object(
+ sys, 'argv', ['foo', 'check_independent', 'dependent']):
+ benchmark_runner.main(self.config)
+ exit_mock.assert_called_with(1)
+
+
class BenchmarkRunnerUnittest(unittest.TestCase):
def setUp(self):
self._stream = stream.TestOutputStream()
« no previous file with comments | « telemetry/telemetry/benchmark_runner.py ('k') | telemetry/telemetry/testdata/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698