Changeset 110724 in webkit


Ignore:
Timestamp:
Mar 14, 2012 11:55:58 AM (12 years ago)
Author:
dpranke@chromium.org
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):

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r110722 r110724  
     12012-03-14  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Please add a way to manually skip some tests in NRWT
     4        https://bugs.webkit.org/show_bug.cgi?id=81019
     5
     6        Reviewed by Ojan Vafai.
     7
     8        This patch implements the -i / --ignore-tests flag from ORWT
     9        and refactors the test_expectations.py code slightly to handle
     10        it.
     11
     12        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     13        (Manager.parse_expectations):
     14        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
     15        (TestExpectations.__init__):
     16        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
     17        (test_add_skipped_tests):
     18        (test_add_skipped_tests_duplicate):
     19        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     20        (parse_args):
     21        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
     22        (MainTest.test_ignore_tests):
     23        (MainTest.test_ignore_tests.assert_ignored):
     24
    1252012-03-14  Dirk Pranke  <dpranke@chromium.org>
    226
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r108413 r110724  
    365365        invalid syntax."""
    366366        port = self._port
     367        tests_to_ignore = set(self._options.ignore_tests)
    367368        self._expectations = test_expectations.TestExpectations(
    368369            port,
     
    371372            port.test_configuration(),
    372373            self._options.lint_test_files,
    373             port.test_expectations_overrides())
     374            port.test_expectations_overrides(),
     375            port.skipped_tests(self._test_files).union(tests_to_ignore))
    374376
    375377    def _split_into_chunks_if_necessary(self, skipped):
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

    r108143 r110724  
    688688
    689689    def __init__(self, port, tests, expectations,
    690                  test_config, is_lint_mode=False, overrides=None):
     690                 test_config, is_lint_mode=False, overrides=None,
     691                 skipped_tests=None):
    691692        """Loads and parses the test expectations given in the string.
    692693        Args:
     
    703704                that need to manage two sets of expectations (e.g., upstream
    704705                and downstream expectations).
     706            skipped_tests: test paths to skip.
    705707        """
    706708        self._full_test_list = tests
     
    714716        self._expectations = self._parser.parse(expectations)
    715717        self._add_expectations(self._expectations, overrides_allowed=False)
    716         self._add_skipped_tests(port.skipped_tests(tests))
     718        self._add_skipped_tests(skipped_tests or [])
    717719
    718720        if overrides:
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py

    r110514 r110724  
    263263    def test_add_skipped_tests(self):
    264264        port = MockHost().port_factory.get('qt')
    265         port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
    266265        port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
    267         expectations = TestExpectations(port, tests=['failures/expected/text.html'], expectations='', test_config=port.test_configuration())
     266        expectations = TestExpectations(port, tests=['failures/expected/text.html'], expectations='', test_config=port.test_configuration(), skipped_tests=set(['failures/expected/text.html']))
    268267        self.assertEquals(expectations.get_modifiers('failures/expected/text.html'), [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER])
    269268        self.assertEquals(expectations.get_expectations('failures/expected/text.html'), set([PASS]))
     
    271270    def test_add_skipped_tests_duplicate(self):
    272271        port = MockHost().port_factory.get('qt')
    273         port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
    274272        port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
    275         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)
     273        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']))
    276274
    277275
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r107718 r110724  
    380380        # -i|--ignore-tests               Comma-separated list of directories
    381381        #                                 or tests to ignore
     382        optparse.make_option("-i", "--ignore-tests", action="append", default=[],
     383            help="directories or test to ignore (may specify multiple times)"),
    382384        optparse.make_option("--test-list", action="append",
    383385            help="read list of tests to run from file", metavar="FILE"),
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r109429 r110724  
    398398        self.assertEquals(tests_run, ['passes/image.html', 'passes/text.html'])
    399399
     400    def test_ignore_tests(self):
     401        def assert_ignored(args, tests_expected_to_run):
     402            tests_to_run = ['failures/expected/image.html', 'passes/image.html']
     403            tests_run = get_tests_run(args + tests_to_run, tests_included=True, flatten_batches=True)
     404            self.assertEquals(tests_run, tests_expected_to_run)
     405
     406        assert_ignored(['-i', 'failures/expected/image.html'], ['passes/image.html'])
     407        assert_ignored(['-i', 'passes'], ['failures/expected/image.html'])
     408
     409        # Note here that there is an expectation for failures/expected/image.html already, but
     410        # it is overriden by the command line arg. This might be counter-intuitive.
     411        # FIXME: This isn't currently working ...
     412        # assert_ignored(['-i', 'failures/expected'], ['passes/image.html'])
     413
    400414    def test_iterations(self):
    401415        tests_to_run = ['passes/image.html', 'passes/text.html']
Note: See TracChangeset for help on using the changeset viewer.