Changeset 91136 in webkit


Ignore:
Timestamp:
Jul 15, 2011 6:10:59 PM (13 years ago)
Author:
jchaffraix@webkit.org
Message:

[NRWT] Add support for --no-http
https://bugs.webkit.org/show_bug.cgi?id=64564

Reviewed by Dirk Pranke.

Added support for --no-http, which disables both HTTP and websockets tests.
It also matches the old-run-webkit-tests behavior if --force is used.

  • Scripts/webkitpy/layout_tests/controllers/manager.py:

Fixed HTTP_SUBDIR and WEBSOCKET_SUBDIR as tests do not start with a leading separator.
We check if --no-http is set and add the HTTP / websockets tests to the skipped list prior to looking
at the expectation file. Fixed the _test_requires_lock function to use the same code path to determine
what is worth have an HTTP lock as --no-http to avoid badness.

  • Scripts/webkitpy/layout_tests/port/test.py: Added 2 new tests to our mock filesystem to validate that

we do skip properly HTTP / websocket tests inside platform/.

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

Added tests that we properly skip all the tests.

  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:

Added checks for the command line arguments.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r91132 r91136  
     12011-07-15  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [NRWT] Add support for --no-http
     4        https://bugs.webkit.org/show_bug.cgi?id=64564
     5
     6        Reviewed by Dirk Pranke.
     7
     8        Added support for --no-http, which disables both HTTP and websockets tests.
     9        It also matches the old-run-webkit-tests behavior if --force is used.
     10
     11        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     12        Fixed HTTP_SUBDIR and WEBSOCKET_SUBDIR as tests do not start with a leading separator.
     13        We check if --no-http is set and add the HTTP / websockets tests to the skipped list prior to looking
     14        at the expectation file. Fixed the  _test_requires_lock function to use the same code path to determine
     15        what is worth have an HTTP lock as --no-http to avoid badness.
     16
     17        * Scripts/webkitpy/layout_tests/port/test.py: Added 2 new tests to our mock filesystem to validate that
     18        we do skip properly HTTP / websocket tests inside platform/.
     19
     20        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     21        Added tests that we properly skip all the tests.
     22
     23        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
     24        Added checks for the command line arguments.
     25
    1262011-07-13  Jon Honeycutt  <jhoneycutt@apple.com>
    227
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r91059 r91136  
    280280        self._expectations = None
    281281
    282         self.HTTP_SUBDIR = port.TEST_PATH_SEPARATOR + 'http' + port.TEST_PATH_SEPARATOR
    283         self.WEBSOCKET_SUBDIR = port.TEST_PATH_SEPARATOR + 'websocket' + port.TEST_PATH_SEPARATOR
     282        self.HTTP_SUBDIR = 'http' + port.TEST_PATH_SEPARATOR
     283        self.WEBSOCKET_SUBDIR = 'websocket' + port.TEST_PATH_SEPARATOR
    284284        self.LAYOUT_TESTS_DIRECTORY = 'LayoutTests'
    285285        self._has_http_lock = False
     
    356356            self._options.lint_test_files,
    357357            port.test_expectations_overrides())
     358
     359    def _is_http_test(self, test):
     360        return self.HTTP_SUBDIR in test or self.WEBSOCKET_SUBDIR in test
     361
     362    def _http_tests(self):
     363        return set(test for test in self._test_files if self._is_http_test(test))
    358364
    359365    def parse_expectations(self):
     
    386392
    387393        skipped = set()
     394
     395        if not self._options.http:
     396            skipped = skipped.union(self._http_tests())
     397
    388398        if num_all_test_files > 1 and not self._options.force:
    389             skipped = self._expectations.get_tests_with_result_type(
    390                            test_expectations.SKIP)
    391             self._test_files -= skipped
     399            skipped = skipped.union(self._expectations.get_tests_with_result_type(test_expectations.SKIP))
    392400            if self._options.skip_failing_tests:
    393                 failing = self._expectations.get_tests_with_result_type(
    394                                test_expectations.FAIL)
     401                failing = self._expectations.get_tests_with_result_type(test_expectations.FAIL)
    395402                self._test_files -= failing
     403
     404        self._test_files -= skipped
    396405
    397406        # Create a sorted list of test files so the subset chunk,
     
    538547        """Return True if the test needs to be locked when
    539548        running multiple copies of NRWTs."""
    540         split_path = test_file.split(self._port.TEST_PATH_SEPARATOR)
    541         return 'http' in split_path or 'websocket' in split_path
     549        return self._is_http_test(test_file)
    542550
    543551    def _test_is_slow(self, test_file):
     
    936944
    937945    def start_servers_with_lock(self):
     946        assert(self._options.http)
    938947        self._printer.print_update('Acquiring http lock ...')
    939948        self._port.acquire_http_lock()
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r91028 r91136  
    178178
    179179    tests.add('websocket/tests/passes/text.html')
     180
     181    # For --no-http tests, test that platform specific HTTP tests are properly skipped.
     182    tests.add('platform/test-snow-leopard/http/test.html')
     183    tests.add('platform/test-snow-leopard/websocket/test.html')
     184
    180185    return tests
    181186
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r90796 r91136  
    153153            normalized_platform_directories.append(port.filesystem.normpath(path))
    154154        options.additional_platform_directory = normalized_platform_directories
     155
     156    if not options.http and options.force:
     157        warnings.append("--no-http is ignored since --force is also provided")
     158        options.http = True
    155159
    156160    return warnings
     
    318322            default=True, dest="record_results",
    319323            help="Don't record the results."),
    320         # old-run-webkit-tests also has HTTP toggle options:
    321         # --[no-]http                     Run (or do not run) http tests
    322         #                                 (default: run)
     324        optparse.make_option("--http", action="store_true", dest="http",
     325            default=True, help="Run HTTP and WebSocket tests (default)"),
     326        optparse.make_option("--no-http", action="store_false", dest="http",
     327            help="Don't run HTTP and WebSocket tests"),
    323328    ]
    324329
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r91028 r91136  
    651651        self.assertTrue('--additional-platform-directory=foo is ignored since it is not absolute\n' in regular_output.get())
    652652
     653    def test_no_http_and_force(self):
     654        # See test_run_force, using --force raises an exception.
     655        # FIXME: We would like to check the warnings generated.
     656        self.assertRaises(ValueError, logging_run, ['--force', '--no-http'])
     657
     658    @staticmethod
     659    def has_test_of_type(tests, type):
     660        return [test for test in tests if type in test]
     661
     662    def test_no_http_tests(self):
     663        batch_tests_dryrun = get_tests_run(['LayoutTests/http', 'websocket/'], flatten_batches=True)
     664        self.assertTrue(MainTest.has_test_of_type(batch_tests_dryrun, 'http'))
     665        self.assertTrue(MainTest.has_test_of_type(batch_tests_dryrun, 'websocket'))
     666
     667        batch_tests_run_no_http = get_tests_run(['--no-http', 'LayoutTests/http', 'websocket/'], flatten_batches=True)
     668        self.assertFalse(MainTest.has_test_of_type(batch_tests_run_no_http, 'http'))
     669        self.assertFalse(MainTest.has_test_of_type(batch_tests_run_no_http, 'websocket'))
     670
     671        batch_tests_run_http = get_tests_run(['--http', 'LayoutTests/http', 'websocket/'], flatten_batches=True)
     672        self.assertTrue(MainTest.has_test_of_type(batch_tests_run_http, 'http'))
     673        self.assertTrue(MainTest.has_test_of_type(batch_tests_run_http, 'websocket'))
    653674
    654675MainTest = skip_if(MainTest, sys.platform == 'cygwin' and compare_version(sys, '2.6')[0] < 0, 'new-run-webkit-tests tests hang on Cygwin Python 2.5.2')
Note: See TracChangeset for help on using the changeset viewer.