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

Unified Diff: chrome/test/mini_installer/test_installer.py

Issue 553053002: Emit actions and states from test_installer.py when not in quiet mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: verbose by default, quiet on demand. Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/mini_installer/test_installer.py
diff --git a/chrome/test/mini_installer/test_installer.py b/chrome/test/mini_installer/test_installer.py
index 2ce2dd9d451d64be2e6e9b3a00d6f873ba734d25..fcc94342e8c9aea8f680f8a23e753af40d9d1e9d 100644
--- a/chrome/test/mini_installer/test_installer.py
+++ b/chrome/test/mini_installer/test_installer.py
@@ -40,7 +40,7 @@ class Config:
class InstallerTest(unittest.TestCase):
"""Tests a test case in the config file."""
- def __init__(self, name, test, config, variable_expander):
+ def __init__(self, name, test, config, variable_expander, quiet):
"""Constructor.
Args:
@@ -55,6 +55,7 @@ class InstallerTest(unittest.TestCase):
self._test = test
self._config = config
self._variable_expander = variable_expander
+ self._quiet = quiet
self._verifier_runner = verifier_runner.VerifierRunner()
self._clean_on_teardown = True
@@ -87,7 +88,11 @@ class InstallerTest(unittest.TestCase):
# Starting at index 1, we loop through pairs of (action, state).
for i in range(1, len(self._test), 2):
action = self._test[i]
+ if not self._quiet:
+ sys.stderr.write('Beginning action %s\n' % action)
RunCommand(self._config.actions[action], self._variable_expander)
+ if not self._quiet:
+ sys.stderr.write('Finished action %s\n' % action)
state = self._test[i + 1]
self._VerifyState(state)
@@ -117,6 +122,8 @@ class InstallerTest(unittest.TestCase):
Args:
state: A state name.
"""
+ if not self._quiet:
+ sys.stderr.write('Verifying state %s\n' % state)
try:
self._verifier_runner.VerifyAll(self._config.states[state],
self._variable_expander)
@@ -255,8 +262,8 @@ def main():
help='Build target (Release or Debug)')
parser.add_argument('--force-clean', action='store_true', default=False,
help='Force cleaning existing installations')
- parser.add_argument('-v', '--verbose', action='count', default=0,
- help='Increase test runner verbosity level')
+ parser.add_argument('-q', '--quiet', action='store_true', default=False,
+ help='Reduce test runner output')
parser.add_argument('--write-full-results-to', metavar='FILENAME',
help='Path to write the list of full results to.')
parser.add_argument('--config', metavar='FILENAME',
@@ -289,9 +296,10 @@ def main():
test['name'])
if not args.test or test_name in args.test:
suite.addTest(InstallerTest(test['name'], test['traversal'], config,
- variable_expander))
+ variable_expander, args.quiet))
- result = unittest.TextTestRunner(verbosity=(args.verbose + 1)).run(suite)
+ verbosity = 2 if not args.quiet else 1
+ result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
if is_component_build:
print ('Component build is currently unsupported by the mini_installer: '
'http://crbug.com/377839')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698