Title: [104740] trunk/Tools
Revision
104740
Author
[email protected]
Date
2012-01-11 13:42:22 -0800 (Wed, 11 Jan 2012)

Log Message

test-webkitpy: fix -v and eliminate some spurious warnings
https://bugs.webkit.org/show_bug.cgi?id=76099

Reviewed by Adam Barth.

when we added support for --xml output, we broke the -v flag.

Also, fix the code to swallow a harmless warning from
VCSUtils.pm and fix a deprecated warning in jsonchecker.py.

test-webkitpy is now silent again except for the one known
logging issue.

* Scripts/webkitpy/common/checkout/checkout.py:
(Checkout.commit_message_for_this_commit):
* Scripts/webkitpy/common/checkout/checkout_unittest.py:
(test_commit_message_for_this_commit):
* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONChecker.check):
(JSONChecker.line_number_from_json_exception):
* Scripts/webkitpy/test/main.py:
(Tester.run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (104739 => 104740)


--- trunk/Tools/ChangeLog	2012-01-11 21:36:24 UTC (rev 104739)
+++ trunk/Tools/ChangeLog	2012-01-11 21:42:22 UTC (rev 104740)
@@ -1,5 +1,30 @@
 2012-01-11  Dirk Pranke  <[email protected]>
 
+        test-webkitpy: fix -v and eliminate some spurious warnings
+        https://bugs.webkit.org/show_bug.cgi?id=76099
+
+        Reviewed by Adam Barth.
+
+        when we added support for --xml output, we broke the -v flag.
+
+        Also, fix the code to swallow a harmless warning from
+        VCSUtils.pm and fix a deprecated warning in jsonchecker.py.
+
+        test-webkitpy is now silent again except for the one known
+        logging issue.
+
+        * Scripts/webkitpy/common/checkout/checkout.py:
+        (Checkout.commit_message_for_this_commit):
+        * Scripts/webkitpy/common/checkout/checkout_unittest.py:
+        (test_commit_message_for_this_commit):
+        * Scripts/webkitpy/style/checkers/jsonchecker.py:
+        (JSONChecker.check):
+        (JSONChecker.line_number_from_json_exception):
+        * Scripts/webkitpy/test/main.py:
+        (Tester.run_tests):
+
+2012-01-11  Dirk Pranke  <[email protected]>
+
         webkitpy: webkitpy.layout_tests.port tests should only use MockSystemHost, not MockHost
         https://bugs.webkit.org/show_bug.cgi?id=76084
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py (104739 => 104740)


--- trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py	2012-01-11 21:36:24 UTC (rev 104739)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py	2012-01-11 21:42:22 UTC (rev 104740)
@@ -1,9 +1,9 @@
 # Copyright (c) 2010 Google Inc. All rights reserved.
-# 
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
-# 
+#
 #     * Redistributions of source code must retain the above copyright
 # notice, this list of conditions and the following disclaimer.
 #     * Redistributions in binary form must reproduce the above
@@ -13,7 +13,7 @@
 #     * Neither the name of Google Inc. nor the names of its
 # contributors may be used to endorse or promote products derived from
 # this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -121,13 +121,13 @@
     def modified_non_changelogs(self, git_commit, changed_files=None):
         return self._modified_files_matching_predicate(git_commit, lambda path: not self.is_path_to_changelog(path), changed_files=changed_files)
 
-    def commit_message_for_this_commit(self, git_commit, changed_files=None):
+    def commit_message_for_this_commit(self, git_commit, changed_files=None, return_stderr=False):
         changelog_paths = self.modified_changelogs(git_commit, changed_files)
         if not len(changelog_paths):
             raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
                               "All changes require a ChangeLog.  See:\n %s" % urls.contribution_guidelines)
 
-        message_text = self._scm.run([self._scm.script_path('commit-log-editor'), '--print-log'] + changelog_paths, return_stderr=False)
+        message_text = self._scm.run([self._scm.script_path('commit-log-editor'), '--print-log'] + changelog_paths, return_stderr=return_stderr)
         return CommitMessage(message_text.splitlines())
 
     def recent_commit_infos_for_files(self, paths):

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py (104739 => 104740)


--- trunk/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py	2012-01-11 21:36:24 UTC (rev 104739)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py	2012-01-11 21:42:22 UTC (rev 104740)
@@ -139,7 +139,9 @@
 
         checkout = Checkout(mock_scm)
         checkout.modified_changelogs = lambda git_commit, changed_files=None: self.changelogs
-        commit_message = checkout.commit_message_for_this_commit(git_commit=None)
+        commit_message = checkout.commit_message_for_this_commit(git_commit=None, return_stderr=True)
+        # Throw away the first line - a warning about unknown VCS root.
+        commit_message.message_lines = commit_message.message_lines[1:]
         self.assertEqual(commit_message.message(), self.expected_commit_message)
 
 

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py (104739 => 104740)


--- trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py	2012-01-11 21:36:24 UTC (rev 104739)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py	2012-01-11 21:42:22 UTC (rev 104740)
@@ -44,11 +44,11 @@
         try:
             json.loads('\n'.join(lines) + '\n')
         except ValueError, e:
-            self._handle_style_error(self.line_number_from_json_exception(e), 'json/syntax', 5, e.message)
+            self._handle_style_error(self.line_number_from_json_exception(e), 'json/syntax', 5, str(e))
 
     @staticmethod
     def line_number_from_json_exception(error):
-        match = re.search(r': line (?P<line>\d+) column \d+', error.message)
+        match = re.search(r': line (?P<line>\d+) column \d+', str(error))
         if not match:
             return 0
         return int(match.group('line'))

Modified: trunk/Tools/Scripts/webkitpy/test/main.py (104739 => 104740)


--- trunk/Tools/Scripts/webkitpy/test/main.py	2012-01-11 21:36:24 UTC (rev 104739)
+++ trunk/Tools/Scripts/webkitpy/test/main.py	2012-01-11 21:42:22 UTC (rev 104740)
@@ -116,7 +116,7 @@
             from webkitpy.thirdparty.autoinstalled.xmlrunner import XMLTestRunner
             test_runner = XMLTestRunner(output='test-webkitpy-xml-reports')
         else:
-            test_runner = unittest.TextTestRunner()
+            test_runner = unittest.TextTestRunner
 
         if len(sys_argv) > 1 and not sys_argv[-1].startswith("-"):
             # Then explicit modules or test names were provided, which
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to