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

Unified Diff: tests/presubmit_unittest.py

Issue 7906009: Fix a typo that resulted in no tests to be run in depot_tools. :( (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: More Created 9 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 | « tests/gclient_utils_test.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/presubmit_unittest.py
diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py
index 40887d8aac6e4d07ec876bc41ffabc209e376fef..466189e9c6409e95dae052aba1ab8e22f9af3031 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -8,6 +8,7 @@
# pylint is too confused.
# pylint: disable=E1101,E1103,R0201,W0212,W0403
+import logging
import StringIO
import sys
import time
@@ -578,7 +579,7 @@ def CheckChangeOnCommit(input_api, output_api):
change, False, True, None, input_buf, DEFAULT_SCRIPT, False, None)
self.failIf(output.should_continue())
text = ('Running presubmit upload checks ...\n'
- 'Warning, no presubmit.py found.\n'
+ 'Warning, no PRESUBMIT.py found.\n'
'Running default presubmit script.\n'
'\n'
'** Presubmit ERRORS **\n!!\n\n'
@@ -658,7 +659,7 @@ def CheckChangeOnCommit(input_api, output_api):
change, False, True, output, input_buf, DEFAULT_SCRIPT, False, None))
self.assertEquals(output.getvalue(),
('Running presubmit upload checks ...\n'
- 'Warning, no presubmit.py found.\n'
+ 'Warning, no PRESUBMIT.py found.\n'
'Running default presubmit script.\n'
'\n'
'** Presubmit Messages **\n'
@@ -1894,8 +1895,8 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testRunPythonUnitTestsNonExistentUpload(self):
input_api = self.MockInputApi(None, False)
input_api.subprocess.check_output(
- ['pyyyyython', '-m', '_non_existent_module'], cwd=None, env=None
- ).AndRaise(
+ ['pyyyyython', '-m', '_non_existent_module'], cwd=None, env=None,
+ stderr=input_api.subprocess.STDOUT).AndRaise(
input_api.subprocess.CalledProcessError())
self.mox.ReplayAll()
@@ -1908,8 +1909,8 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testRunPythonUnitTestsNonExistentCommitting(self):
input_api = self.MockInputApi(None, True)
input_api.subprocess.check_output(
- ['pyyyyython', '-m', '_non_existent_module'], cwd=None, env=None
- ).AndRaise(
+ ['pyyyyython', '-m', '_non_existent_module'], cwd=None, env=None,
+ stderr=input_api.subprocess.STDOUT).AndRaise(
input_api.subprocess.CalledProcessError())
self.mox.ReplayAll()
@@ -1923,7 +1924,8 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api.unittest = self.mox.CreateMock(unittest)
input_api.cStringIO = self.mox.CreateMock(presubmit.cStringIO)
input_api.subprocess.check_output(
- ['pyyyyython', '-m', 'test_module'], cwd=None, env=None).AndRaise(
+ ['pyyyyython', '-m', 'test_module'], cwd=None, env=None,
+ stderr=input_api.subprocess.STDOUT).AndRaise(
input_api.subprocess.CalledProcessError())
self.mox.ReplayAll()
@@ -1937,7 +1939,8 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testRunPythonUnitTestsFailureCommitting(self):
input_api = self.MockInputApi(None, True)
input_api.subprocess.check_output(
- ['pyyyyython', '-m', 'test_module'], cwd=None, env=None).AndRaise(
+ ['pyyyyython', '-m', 'test_module'], cwd=None, env=None,
+ stderr=input_api.subprocess.STDOUT).AndRaise(
input_api.subprocess.CalledProcessError())
self.mox.ReplayAll()
@@ -1952,7 +1955,8 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api.cStringIO = self.mox.CreateMock(presubmit.cStringIO)
input_api.unittest = self.mox.CreateMock(unittest)
input_api.subprocess.check_output(
- ['pyyyyython', '-m', 'test_module'], cwd=None, env=None)
+ ['pyyyyython', '-m', 'test_module'], cwd=None, env=None,
+ stderr=input_api.subprocess.STDOUT)
self.mox.ReplayAll()
results = presubmit_canned_checks.RunPythonUnitTests(
@@ -2170,6 +2174,7 @@ mac|success|blew
'foo1', 'description1', self.fake_root_dir, None, 0, 0, None)
input_api = self.MockInputApi(change, False)
input_api.verbose = True
+ input_api.logging = self.mox.CreateMock(logging)
input_api.PresubmitLocalPath().AndReturn(self.fake_root_dir)
input_api.PresubmitLocalPath().AndReturn(self.fake_root_dir)
path = presubmit.os.path.join(self.fake_root_dir, 'random_directory')
@@ -2178,6 +2183,7 @@ mac|success|blew
input_api.subprocess.check_call(
[presubmit.os.path.join('random_directory', 'b'), '--verbose'],
cwd=self.fake_root_dir)
+ input_api.logging.debug('Found 5 files, running 1')
self.mox.ReplayAll()
results = presubmit_canned_checks.RunUnitTestsInDirectory(
« no previous file with comments | « tests/gclient_utils_test.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698