[TestExpectations] Remove --csv option
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2020 01:33:14 +0000 (01:33 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2020 01:33:14 +0000 (01:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=213762
<rdar://problem/64913762>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationLine.to_csv): Deleted.
* Scripts/webkitpy/tool/commands/queries.py:
(PrintExpectations.__init__): Remove --csv option.
(PrintExpectations._format_lines): Ditto.
(PrintBaselines.__init__): Ditto.
(PrintBaselines.execute): Ditto.
(PrintBaselines._print_baselines): Ditto.
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(PrintExpectationsTest.run_test):
(PrintExpectationsTest.test_include):
(PrintBaselinesTest.test_basic):
(PrintBaselinesTest.test_multiple):
(PrintExpectationsTest.test_csv): Deleted.
(PrintBaselinesTest.test_csv): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@263714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
Tools/Scripts/webkitpy/tool/commands/queries.py
Tools/Scripts/webkitpy/tool/commands/queries_unittest.py

index 14d92c3..d010c53 100644 (file)
@@ -1,3 +1,27 @@
+2020-06-29  Jonathan Bedard  <jbedard@apple.com>
+
+        [TestExpectations] Remove --csv option
+        https://bugs.webkit.org/show_bug.cgi?id=213762
+        <rdar://problem/64913762>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectationLine.to_csv): Deleted.
+        * Scripts/webkitpy/tool/commands/queries.py:
+        (PrintExpectations.__init__): Remove --csv option.
+        (PrintExpectations._format_lines): Ditto.
+        (PrintBaselines.__init__): Ditto.
+        (PrintBaselines.execute): Ditto.
+        (PrintBaselines._print_baselines): Ditto.
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        (PrintExpectationsTest.run_test):
+        (PrintExpectationsTest.test_include):
+        (PrintBaselinesTest.test_basic):
+        (PrintBaselinesTest.test_multiple):
+        (PrintExpectationsTest.test_csv): Deleted.
+        (PrintBaselinesTest.test_csv): Deleted.
+
 2020-06-29  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
 
         Remove ENABLE_STREAMS_API compilation flag
index ff5145f..c1e2a17 100644 (file)
@@ -461,10 +461,6 @@ class TestExpectationLine(object):
         return self._format_line(self.modifiers, self.name, self.expectations, self.comment,
             include_modifiers, include_expectations, include_comment)
 
-    def to_csv(self):
-        # Note that this doesn't include the comments.
-        return '%s,%s,%s' % (self.name, ' '.join(self.modifiers), ' '.join(self.expectations))
-
     def _serialize_parsed_expectations(self, parsed_expectation_to_string):
         result = []
         for index in TestExpectations.EXPECTATION_ORDER:
index fa41f97..6cb0645 100644 (file)
@@ -451,8 +451,6 @@ class PrintExpectations(Command):
                         help='limit to tests not matching the given keyword (for example, "skip", "slow", or "crash". May specify multiple times'),
             make_option('-i', '--include-keyword', action='append', default=[],
                         help='limit to tests with the given keyword (for example, "skip", "slow", or "crash". May specify multiple times'),
-            make_option('--csv', action='store_true', default=False,
-                        help='Print a CSV-style report that includes the port name, modifiers, tests, and expectations'),
             make_option('-f', '--full', action='store_true', default=False,
                         help='Print a full TestExpectations-style line for every match'),
             make_option('--paths', action='store_true', default=False,
@@ -514,10 +512,7 @@ class PrintExpectations(Command):
 
     def _format_lines(self, options, port_name, lines):
         output = []
-        if options.csv:
-            for line in lines:
-                output.append("%s,%s" % (port_name, line.to_csv()))
-        elif lines:
+        if lines:
             include_modifiers = options.full
             include_expectations = options.full or len(options.include_keyword) != 1 or len(options.exclude_keyword)
             output.append("// For %s" % port_name)
@@ -540,8 +535,6 @@ class PrintBaselines(Command):
         options = [
             make_option('--all', action='store_true', default=False,
                         help='display the baselines for *all* tests'),
-            make_option('--csv', action='store_true', default=False,
-                        help='Print a CSV-style report that includes the port name, test_name, test platform, baseline type, baseline location, and baseline platform'),
         ] + platform_options(use_globs=True)
         Command.__init__(self, options=options)
         self._platform_regexp = re.compile('platform/([^\/]+)/(.+)')
@@ -565,8 +558,7 @@ class PrintBaselines(Command):
         for port_name in port_names:
             if port_name != port_names[0]:
                 print()
-            if not options.csv:
-                print("// For %s" % port_name)
+            print("// For %s" % port_name)
             port = tool.port_factory.get(port_name)
             for test_name in tests:
                 self._print_baselines(options, port_name, test_name, port.expected_baselines_by_extension(test_name))
@@ -575,11 +567,7 @@ class PrintBaselines(Command):
         for extension in sorted(baselines.keys()):
             baseline_location = baselines[extension]
             if baseline_location:
-                if options.csv:
-                    print("%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._platform_for_path(test_name),
-                                                 extension[1:], baseline_location, self._platform_for_path(baseline_location)))
-                else:
-                    print(baseline_location)
+                print(baseline_location)
 
     def _platform_for_path(self, relpath):
         platform_matchobj = self._platform_regexp.match(relpath)
index 07098b0..6da0d32 100644 (file)
@@ -160,7 +160,7 @@ class FailureReasonTest(unittest.TestCase):
 
 class PrintExpectationsTest(unittest.TestCase):
     def run_test(self, tests, expected_stdout, platform='test-win-xp', **args):
-        options = MockOptions(all=False, csv=False, full=False, platform=platform,
+        options = MockOptions(all=False, full=False, platform=platform,
                               include_keyword=[], exclude_keyword=[], paths=False).update(**args)
         tool = MockTool()
         tool.port_factory.all_port_names = lambda: TestPort.ALL_BASELINE_VARIANTS
@@ -215,12 +215,6 @@ class PrintExpectationsTest(unittest.TestCase):
                        'failures/expected/image.html\n'),
                       include_keyword=['image'])
 
-    def test_csv(self):
-        self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
-                      ('test-win-xp,failures/expected/image.html,BUGTEST,IMAGE\n'
-                       'test-win-xp,failures/expected/text.html,BUGTEST,FAIL\n'),
-                      csv=True)
-
     def test_paths(self):
         self.run_test([],
                       ('LayoutTests/TestExpectations\n'
@@ -263,7 +257,7 @@ class PrintBaselinesTest(unittest.TestCase):
         command = PrintBaselines()
         command.bind_to_tool(self.tool)
         self.capture_output()
-        command.execute(MockOptions(all=False, csv=False, platform=None), ['passes/text.html'], self.tool)
+        command.execute(MockOptions(all=False, platform=None), ['passes/text.html'], self.tool)
         stdout, _, _ = self.restore_output()
         self.assertMultiLineEqual(stdout,
                           ('// For test-win-xp\n'
@@ -274,7 +268,7 @@ class PrintBaselinesTest(unittest.TestCase):
         command = PrintBaselines()
         command.bind_to_tool(self.tool)
         self.capture_output()
-        command.execute(MockOptions(all=False, csv=False, platform='test-win-*'), ['passes/text.html'], self.tool)
+        command.execute(MockOptions(all=False, platform='test-win-*'), ['passes/text.html'], self.tool)
         stdout, _, _ = self.restore_output()
         self.assertMultiLineEqual(stdout,
                           ('// For test-win-vista\n'
@@ -288,13 +282,3 @@ class PrintBaselinesTest(unittest.TestCase):
                            '// For test-win-xp\n'
                            'passes/text-expected.png\n'
                            'passes/text-expected.txt\n'))
-
-    def test_csv(self):
-        command = PrintBaselines()
-        command.bind_to_tool(self.tool)
-        self.capture_output()
-        command.execute(MockOptions(all=False, platform='*xp', csv=True), ['passes/text.html'], self.tool)
-        stdout, _, _ = self.restore_output()
-        self.assertMultiLineEqual(stdout,
-                          ('test-win-xp,passes/text.html,None,png,passes/text-expected.png,None\n'
-                           'test-win-xp,passes/text.html,None,txt,passes/text-expected.txt,None\n'))