Modified: trunk/Tools/ChangeLog (226735 => 226736)
--- trunk/Tools/ChangeLog 2018-01-10 22:43:52 UTC (rev 226735)
+++ trunk/Tools/ChangeLog 2018-01-10 22:46:30 UTC (rev 226736)
@@ -1,3 +1,25 @@
+2018-01-10 Jonathan Bedard <[email protected]>
+
+ REGRESSION (r226715): ignore WARNING output in linter tests
+ https://bugs.webkit.org/show_bug.cgi?id=181486
+ <rdar://problem/36408847>
+
+ Reviewed by Aakash Jain.
+
+ Linter unit tests should not be interested in logs at the the INFO or WARNING levels.
+
+ * Scripts/webkitpy/common/system/outputcapture.py:
+ (OutputCapture.__init__): Pass logging level to be captured.
+ * Scripts/webkitpy/style/main_unittest.py:
+ (ExpectationLinterInStyleCheckerTest.test_no_linter_errors): Capture logging at the ERROR level.
+ (ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_no_edit): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_edit_in_file): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_only_deletes): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_added_file_with_error): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_deleted_file): Ditto.
+ (ExpectationLinterInStyleCheckerTest.test_linter_deleted_file_no_edit): Ditto.
+
2018-01-10 Carlos Alberto Lopez Perez <[email protected]>
Add a JSCOnly MIPS buildbot
Modified: trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py (226735 => 226736)
--- trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py 2018-01-10 22:43:52 UTC (rev 226735)
+++ trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py 2018-01-10 22:46:30 UTC (rev 226736)
@@ -42,9 +42,9 @@
def stream_wrapper(stream):
return StringIO()
- def __init__(self):
+ def __init__(self, log_level=logging.INFO):
self.saved_outputs = dict()
- self._log_level = logging.INFO
+ self._log_level = log_level
def set_log_level(self, log_level):
self._log_level = log_level
Modified: trunk/Tools/Scripts/webkitpy/style/main_unittest.py (226735 => 226736)
--- trunk/Tools/Scripts/webkitpy/style/main_unittest.py 2018-01-10 22:43:52 UTC (rev 226735)
+++ trunk/Tools/Scripts/webkitpy/style/main_unittest.py 2018-01-10 22:46:30 UTC (rev 226736)
@@ -20,6 +20,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import logging
import optparse
import unittest
@@ -28,7 +29,7 @@
from main import change_directory
from webkitpy.common.host import Host
from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCaptureScope
+from webkitpy.common.system.outputcapture import OutputCapture, OutputCaptureScope
from webkitpy.common.system.logtesting import LogTesting
from webkitpy.style.checker import StyleProcessor
from webkitpy.style.filereader import TextFileReader
@@ -115,7 +116,7 @@
def test_no_linter_errors(self):
host = self._generate_testing_host()
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.do_association_check('/mock-checkout', host)
@@ -127,7 +128,7 @@
'# TestExpectations\ncss1/test.html [ Failure ]\ncss1/test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.process_file('/mock-checkout/LayoutTests/TestExpectations', line_numbers=[1, 2, 3])
@@ -142,7 +143,7 @@
'# TestExpectations\ncss1/test.html [ Failure ]\ncss1/test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.process_paths(['/mock-checkout/LayoutTests/platform/ios/TestExpectations'])
@@ -155,7 +156,7 @@
'# TestExpectations\ncss1/test.html [ Failure ]\ncss1/test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.process_file('/mock-checkout/LayoutTests/TestExpectations', line_numbers=[1])
@@ -168,7 +169,7 @@
'# TestExpectations\ncss1/test.html [ Failure ]\ncss1/test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.process_file('/mock-checkout/LayoutTests/TestExpectations')
@@ -181,7 +182,7 @@
'# TestExpectations\ncss1/test.html [ Failure ]\ncss1/test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.process_file('/mock-checkout/LayoutTests/TestExpectations', line_numbers=[1, 2, 3])
@@ -193,9 +194,8 @@
'/mock-checkout/LayoutTests/TestExpectations':
'# TestExpectations\ncss1/deleted-test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.delete_file('/mock-checkout/LayoutTests/css1/deleted-test.html')
@@ -210,7 +210,7 @@
'# TestExpectations\ncss1/deleted-test.html [ Failure ]\n'}
host = self._generate_testing_host(files)
- scope = OutputCaptureScope()
+ scope = OutputCaptureScope(OutputCapture(logging.ERROR))
with scope:
file_reader = self._generate_file_reader(host.filesystem)
file_reader.delete_file('/mock-checkout/LayoutTests/css1/other-deleted-test.html')