From 8d19523063c73308d397c6e2c099c9b1b95add0b Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Tue, 5 Oct 2010 12:58:49 +0000 Subject: [PATCH] Add a note warning the users that presubmit hooks will be run. Otherwise the scripts make it looks like they are hung when the presubmit checks are slow. TEST=none BUG=none Review URL: http://codereview.chromium.org/3613007 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61506 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_support.py | 1 + tests/presubmit_unittest.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/presubmit_support.py b/presubmit_support.py index c03c3eabf3..f6216432f7 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -945,6 +945,7 @@ def DoPresubmitChecks(change, Return: True if execution can continue, False if not. """ + print "Running presubmit hooks..." start_time = time.time() presubmit_files = ListRelevantPresubmitFiles(change.AbsoluteLocalPaths(True), change.RepositoryRoot()) diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index eddae18e23..4a8ad588cc 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -341,6 +341,7 @@ class PresubmitUnittest(PresubmitTestsBase): self.failIf(presubmit.DoPresubmitChecks(change, False, True, output, input, None, False)) self.assertEqual(output.getvalue().count('!!'), 2) + self.checkstdout('Running presubmit hooks...\n') def testDoPresubmitChecksPromptsAfterWarnings(self): join = presubmit.os.path.join @@ -379,6 +380,7 @@ class PresubmitUnittest(PresubmitTestsBase): self.failUnless(presubmit.DoPresubmitChecks(change, False, True, output, input, None, True)) self.assertEquals(output.getvalue().count('??'), 2) + self.checkstdout('Running presubmit hooks...\nRunning presubmit hooks...\n') def testDoPresubmitChecksNoWarningPromptIfErrors(self): join = presubmit.os.path.join @@ -413,6 +415,7 @@ class PresubmitUnittest(PresubmitTestsBase): self.assertEqual(output.getvalue().count('??'), 2) self.assertEqual(output.getvalue().count('XX!!XX'), 2) self.assertEqual(output.getvalue().count('(y/N)'), 0) + self.checkstdout('Running presubmit hooks...\n') def testDoDefaultPresubmitChecksAndFeedback(self): join = presubmit.os.path.join @@ -452,6 +455,7 @@ def CheckChangeOnCommit(input_api, output_api): 'Was the presubmit check useful? Please send feedback & hate mail ' 'to maruel@chromium.org!\n') self.assertEquals(output.getvalue(), text) + self.checkstdout('Running presubmit hooks...\n') def testDirectoryHandling(self): files = [ @@ -523,6 +527,7 @@ def CheckChangeOnCommit(input_api, output_api): 'Running default presubmit script.\n' '** Presubmit Messages **\n' 'http://tracker.com/42\n\n')) + self.checkstdout('Running presubmit hooks...\n') def testGetTrySlavesExecuter(self): self.mox.ReplayAll()