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

Unified Diff: tools/telemetry/telemetry/unittest/run_chromeos_tests.py

Issue 700703003: Revert of Switch telemetry over to use typ to run the unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rev_typ_v086
Patch Set: Created 6 years, 1 month 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 | « tools/telemetry/telemetry/unittest/json_results.py ('k') | tools/telemetry/telemetry/unittest/run_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/unittest/run_chromeos_tests.py
diff --git a/tools/telemetry/telemetry/unittest/run_chromeos_tests.py b/tools/telemetry/telemetry/unittest/run_chromeos_tests.py
index abf6f3836cd0ee93a1463d9c0b4acb254c54c79a..0912d8463434e5e830dabbf5475b242639fb0e50 100644
--- a/tools/telemetry/telemetry/unittest/run_chromeos_tests.py
+++ b/tools/telemetry/telemetry/unittest/run_chromeos_tests.py
@@ -3,7 +3,9 @@
# found in the LICENSE file.
import logging
import os
+import sys
+from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import run_tests
from telemetry.core import util
@@ -12,29 +14,35 @@
stream = _LoggingOutputStream()
error_string = ''
- if unit_tests:
- logging.info('Running telemetry unit tests with browser_type "%s".' %
- browser_type)
- ret = _RunOneSetOfTests(browser_type, 'telemetry', unit_tests, stream)
- if ret:
- error_string += 'The unit tests failed.\n'
+ logging.info('Running telemetry unit tests with browser_type "%s".' %
+ browser_type)
+ ret = _RunOneSetOfTests(browser_type, 'telemetry',
+ os.path.join('telemetry', 'telemetry'),
+ unit_tests, stream)
+ if ret:
+ error_string += 'The unit tests failed.\n'
- if perf_tests:
- logging.info('Running telemetry perf tests with browser_type "%s".' %
- browser_type)
- ret = _RunOneSetOfTests(browser_type, 'perf', perf_tests, stream)
- if ret:
- error_string = 'The perf tests failed.\n'
+ logging.info('Running telemetry perf tests with browser_type "%s".' %
+ browser_type)
+ ret = _RunOneSetOfTests(browser_type, 'perf', 'perf', perf_tests, stream)
+ if ret:
+ error_string = 'The perf tests failed.\n'
return error_string
-def _RunOneSetOfTests(browser_type, dir_name, tests, stream):
- top_level_dir = os.path.join(util.GetChromiumSrcDir(), 'tools', dir_name)
- args = ['--browser', browser_type,
- '--top-level-dir', top_level_dir,
- '--jobs', '1'] + tests
- return run_tests.RunTestsCommand.main(args, stream=stream)
+def _RunOneSetOfTests(browser_type, root_dir, sub_dir, tests, stream):
+ if not tests:
+ return
+ top_level_dir = os.path.join(util.GetChromiumSrcDir(), 'tools', root_dir)
+ sub_dir = os.path.join(util.GetChromiumSrcDir(), 'tools', sub_dir)
+
+ sys.path.append(top_level_dir)
+
+ output_formatters = [gtest_progress_reporter.GTestProgressReporter(stream)]
+ run_tests.config = run_tests.Config(top_level_dir, [sub_dir],
+ output_formatters)
+ return run_tests.RunTestsCommand.main(['--browser', browser_type] + tests)
class _LoggingOutputStream(object):
« no previous file with comments | « tools/telemetry/telemetry/unittest/json_results.py ('k') | tools/telemetry/telemetry/unittest/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698