Title: [110724] trunk/Tools
Revision
110724
Author
[email protected]
Date
2012-03-14 11:55:58 -0700 (Wed, 14 Mar 2012)

Log Message

Please add a way to manually skip some tests in NRWT
https://bugs.webkit.org/show_bug.cgi?id=81019

Reviewed by Ojan Vafai.

This patch implements the -i / --ignore-tests flag from ORWT
and refactors the test_expectations.py code slightly to handle
it.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.parse_expectations):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations.__init__):
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
(test_add_skipped_tests):
(test_add_skipped_tests_duplicate):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_ignore_tests):
(MainTest.test_ignore_tests.assert_ignored):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (110723 => 110724)


--- trunk/Tools/ChangeLog	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/ChangeLog	2012-03-14 18:55:58 UTC (rev 110724)
@@ -1,5 +1,29 @@
 2012-03-14  Dirk Pranke  <[email protected]>
 
+        Please add a way to manually skip some tests in NRWT
+        https://bugs.webkit.org/show_bug.cgi?id=81019
+
+        Reviewed by Ojan Vafai.
+
+        This patch implements the -i / --ignore-tests flag from ORWT
+        and refactors the test_expectations.py code slightly to handle
+        it.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager.parse_expectations):
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectations.__init__):
+        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+        (test_add_skipped_tests):
+        (test_add_skipped_tests_duplicate):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (parse_args):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+        (MainTest.test_ignore_tests):
+        (MainTest.test_ignore_tests.assert_ignored):
+
+2012-03-14  Dirk Pranke  <[email protected]>
+
         nrwt: run with no args on lion, is putting baselines in platform/mac-lion, not platform/mac
         https://bugs.webkit.org/show_bug.cgi?id=81028
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (110723 => 110724)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-03-14 18:55:58 UTC (rev 110724)
@@ -364,13 +364,15 @@
         structure holding them. Throws an error if the test_list files have
         invalid syntax."""
         port = self._port
+        tests_to_ignore = set(self._options.ignore_tests)
         self._expectations = test_expectations.TestExpectations(
             port,
             self._test_files,
             port.test_expectations(),
             port.test_configuration(),
             self._options.lint_test_files,
-            port.test_expectations_overrides())
+            port.test_expectations_overrides(),
+            port.skipped_tests(self._test_files).union(tests_to_ignore))
 
     def _split_into_chunks_if_necessary(self, skipped):
         if not self._options.run_chunk and not self._options.run_part:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py (110723 => 110724)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2012-03-14 18:55:58 UTC (rev 110724)
@@ -687,7 +687,8 @@
         return cls.EXPECTATIONS.get(string.lower())
 
     def __init__(self, port, tests, expectations,
-                 test_config, is_lint_mode=False, overrides=None):
+                 test_config, is_lint_mode=False, overrides=None,
+                 skipped_tests=None):
         """Loads and parses the test expectations given in the string.
         Args:
             port: handle to object containing platform-specific functionality
@@ -702,6 +703,7 @@
                 entries in |expectations|. This is used by callers
                 that need to manage two sets of expectations (e.g., upstream
                 and downstream expectations).
+            skipped_tests: test paths to skip.
         """
         self._full_test_list = tests
         self._test_config = test_config
@@ -713,7 +715,7 @@
 
         self._expectations = self._parser.parse(expectations)
         self._add_expectations(self._expectations, overrides_allowed=False)
-        self._add_skipped_tests(port.skipped_tests(tests))
+        self._add_skipped_tests(skipped_tests or [])
 
         if overrides:
             overrides_expectations = self._parser.parse(overrides)

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py (110723 => 110724)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2012-03-14 18:55:58 UTC (rev 110724)
@@ -262,17 +262,15 @@
 
     def test_add_skipped_tests(self):
         port = MockHost().port_factory.get('qt')
-        port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
         port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
-        expectations = TestExpectations(port, tests=['failures/expected/text.html'], expectations='', test_config=port.test_configuration())
+        expectations = TestExpectations(port, tests=['failures/expected/text.html'], expectations='', test_config=port.test_configuration(), skipped_tests=set(['failures/expected/text.html']))
         self.assertEquals(expectations.get_modifiers('failures/expected/text.html'), [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER])
         self.assertEquals(expectations.get_expectations('failures/expected/text.html'), set([PASS]))
 
     def test_add_skipped_tests_duplicate(self):
         port = MockHost().port_factory.get('qt')
-        port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
         port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
-        self.assertRaises(ParseError, TestExpectations, port, tests=['failures/expected/text.html'], expectations='BUGX : failures/expected/text.html = text\n', test_config=port.test_configuration(), is_lint_mode=True)
+        self.assertRaises(ParseError, TestExpectations, port, tests=['failures/expected/text.html'], expectations='BUGX : failures/expected/text.html = text\n', test_config=port.test_configuration(), is_lint_mode=True, skipped_tests=set(['failures/expected/text.html']))
 
 
 class ExpectationSyntaxTests(Base):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (110723 => 110724)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-03-14 18:55:58 UTC (rev 110724)
@@ -379,6 +379,8 @@
         # old-run-webkit-tests:
         # -i|--ignore-tests               Comma-separated list of directories
         #                                 or tests to ignore
+        optparse.make_option("-i", "--ignore-tests", action="" default=[],
+            help="directories or test to ignore (may specify multiple times)"),
         optparse.make_option("--test-list", action=""
             help="read list of tests to run from file", metavar="FILE"),
         # old-run-webkit-tests uses --skipped==[default|ignore|only]

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (110723 => 110724)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2012-03-14 18:54:40 UTC (rev 110723)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2012-03-14 18:55:58 UTC (rev 110724)
@@ -397,6 +397,20 @@
         tests_run = get_tests_run(['--skip-pixel-test-if-no-baseline'] + tests_to_run, tests_included=True, flatten_batches=True)
         self.assertEquals(tests_run, ['passes/image.html', 'passes/text.html'])
 
+    def test_ignore_tests(self):
+        def assert_ignored(args, tests_expected_to_run):
+            tests_to_run = ['failures/expected/image.html', 'passes/image.html']
+            tests_run = get_tests_run(args + tests_to_run, tests_included=True, flatten_batches=True)
+            self.assertEquals(tests_run, tests_expected_to_run)
+
+        assert_ignored(['-i', 'failures/expected/image.html'], ['passes/image.html'])
+        assert_ignored(['-i', 'passes'], ['failures/expected/image.html'])
+
+        # Note here that there is an expectation for failures/expected/image.html already, but
+        # it is overriden by the command line arg. This might be counter-intuitive.
+        # FIXME: This isn't currently working ...
+        # assert_ignored(['-i', 'failures/expected'], ['passes/image.html'])
+
     def test_iterations(self):
         tests_to_run = ['passes/image.html', 'passes/text.html']
         tests_run = get_tests_run(['--iterations', '2'] + tests_to_run, tests_included=True, flatten_batches=True)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to