Title: [287536] trunk/Tools
Revision
287536
Author
[email protected]
Date
2022-01-03 04:49:34 -0800 (Mon, 03 Jan 2022)

Log Message

A manual test was imported with the WPT css-transforms test suite
https://bugs.webkit.org/show_bug.cgi?id=234245

Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_parser.py:
(TestParser.analyze_test): Manual tests may also be reference tests and these
should not be imported.
* Scripts/webkitpy/w3c/test_parser_unittest.py:
(test_analyze_manual_reference_wpt_test): Add a test for this situation.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (287535 => 287536)


--- trunk/Tools/ChangeLog	2022-01-03 11:55:54 UTC (rev 287535)
+++ trunk/Tools/ChangeLog	2022-01-03 12:49:34 UTC (rev 287536)
@@ -1,3 +1,16 @@
+2022-01-03  Martin Robinson  <[email protected]>
+
+        A manual test was imported with the WPT css-transforms test suite
+        https://bugs.webkit.org/show_bug.cgi?id=234245
+
+        Reviewed by Youenn Fablet.
+
+        * Scripts/webkitpy/w3c/test_parser.py:
+        (TestParser.analyze_test): Manual tests may also be reference tests and these
+        should not be imported.
+        * Scripts/webkitpy/w3c/test_parser_unittest.py:
+        (test_analyze_manual_reference_wpt_test): Add a test for this situation.
+
 2022-01-02  Wenson Hsieh  <[email protected]>
 
         [WebKit2] Camera continuity is disabled in richly editable content

Modified: trunk/Tools/Scripts/webkitpy/w3c/test_parser.py (287535 => 287536)


--- trunk/Tools/Scripts/webkitpy/w3c/test_parser.py	2022-01-03 11:55:54 UTC (rev 287535)
+++ trunk/Tools/Scripts/webkitpy/w3c/test_parser.py	2022-01-03 12:49:34 UTC (rev 287536)
@@ -83,9 +83,13 @@
         if ref_contents is not None:
             self.ref_doc = Parser(ref_contents)
 
-        # First check if it's a reftest
         matches = self.reference_links_of_type('match') + self.reference_links_of_type('mismatch')
-        if matches:
+
+        # Manual tests may also have properties that make them look like non-manual reference or JS
+        # tests, so exclude them first.
+        if self.is_wpt_manualtest() and not self.is_reference_filename():
+            test_info = {'test': self.filename, 'manualtest': True}
+        elif matches:
             if len(matches) > 1:
                 # FIXME: Is this actually true? We should fix this.
                 _log.warning('Multiple references are not supported. Importing the first ref defined in %s',
@@ -120,9 +124,6 @@
                     reference_relpath = self.filesystem.relpath(self.filesystem.dirname(self.filename), self.filesystem.dirname(ref_file)) + self.filesystem.sep
                     test_info['reference_support_info'] = {'reference_relpath': reference_relpath, 'files': reference_support_files}
 
-        # we check for wpt manual test before checking for jstest, as some WPT manual tests can be classified as CSS JS tests
-        elif self.is_wpt_manualtest() and not self.is_reference_filename():
-            test_info = {'test': self.filename, 'manualtest': True}
         elif self.is_jstest():
             test_info = {'test': self.filename, 'jstest': True}
         elif self.is_reference_filename():

Modified: trunk/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py (287535 => 287536)


--- trunk/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py	2022-01-03 11:55:54 UTC (rev 287535)
+++ trunk/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py	2022-01-03 12:49:34 UTC (rev 287536)
@@ -204,6 +204,21 @@
         test_info = parser.analyze_test(test_contents=test_html)
         self.assertFalse('manualtest' in test_info.keys() and test_info['manualtest'], 'test_info is not manual')
 
+    def test_analyze_manual_reference_wpt_test(self):
+        """ Tests analyze_test() using a manual reference test """
+
+        test_html = """<head>
+<link rel="match" href=""
+<link href="" rel="stylesheet" type="text/css">
+<script src=""
+</head>
+"""
+        test_path = os.path.join(os.path.sep, 'some', 'madeup', 'path')
+        parser = TestParser(options, os.path.join(test_path, 'somefile-manual.html'))
+        test_info = parser.analyze_test(test_contents=test_html)
+        self.assertTrue(test_info['manualtest'], 'test_info is manual')
+
+
     def test_analyze_css_manual_test(self):
         """ Tests analyze_test() using a css manual test """
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to