Changeset 83646 in webkit


Ignore:
Timestamp:
Apr 12, 2011 3:02:14 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-04-12 Dirk Pranke <dpranke@chromium.org>

Reviewed by Tony Chang.

new-run-webkit-tests: --results-directory is relative to builddir, not $PWD
https://bugs.webkit.org/show_bug.cgi?id=58272

NRWT was interpreting the --results-directory cmd line arg as
relative to the build directory, not the current working
directory (ORWT uses the latter, which is much more intuitive).

This patch fixes the base case, but includes an override for
Chromium that is needed until the bots can be updated.

  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/base_unittest.py:
  • Scripts/webkitpy/layout_tests/port/chromium.py:
  • Scripts/webkitpy/layout_tests/port/port_testcase.py:
  • Scripts/webkitpy/layout_tests/port/test.py:
  • Scripts/webkitpy/layout_tests/port/webkit.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
Location:
trunk/Tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r83643 r83646  
     12011-04-12  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        new-run-webkit-tests: --results-directory is relative to builddir, not $PWD
     6        https://bugs.webkit.org/show_bug.cgi?id=58272
     7
     8        NRWT was interpreting the --results-directory cmd line arg as
     9        relative to the build directory, not the current working
     10        directory (ORWT uses the latter, which is much more intuitive).
     11       
     12        This patch fixes the base case, but includes an override for
     13        Chromium that is needed until the bots can be updated.
     14
     15        * Scripts/webkitpy/layout_tests/port/base.py:
     16        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
     17        * Scripts/webkitpy/layout_tests/port/chromium.py:
     18        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
     19        * Scripts/webkitpy/layout_tests/port/test.py:
     20        * Scripts/webkitpy/layout_tests/port/webkit.py:
     21        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     22        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
     23
    1242011-04-12  Philippe Normand  <pnormand@igalia.com>
    225
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r83635 r83646  
    141141        self._test_configuration = None
    142142        self._multiprocessing_is_available = (multiprocessing is not None)
     143        self._results_directory = None
    143144
    144145    def default_child_processes(self):
     
    571572
    572573    def results_directory(self):
    573         """Absolute path to the place to store the test results."""
    574         raise NotImplementedError('Port.results_directory')
     574        """Absolute path to the place to store the test results (uses --results-directory)."""
     575        if not self._results_directory:
     576            option_val = self.get_option('results_directory') or self.default_results_directory()
     577            self._results_directory = self._filesystem.abspath(option_val)
     578        return self._results_directory
     579
     580    def default_results_directory(self):
     581        """Absolute path to the default place to store the test results."""
     582        raise NotImplementedError()
    575583
    576584    def setup_test_run(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py

    r82972 r83646  
    275275        self.assertVirtual(port.diff_image, None, None)
    276276        self.assertVirtual(port.path_to_test_expectations_file)
    277         self.assertVirtual(port.results_directory)
     277        self.assertVirtual(port.default_results_directory)
    278278        self.assertVirtual(port.test_expectations)
    279279        self.assertVirtual(port._path_to_apache)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r83635 r83646  
    201201            'chromium', 'test_expectations.txt')
    202202
    203     def results_directory(self):
     203    def default_results_directory(self):
    204204        try:
    205205            return self.path_from_chromium_base('webkit',
    206206                self.get_option('configuration'),
    207                 self.get_option('results_directory'))
     207                'layout-test-results')
    208208        except AssertionError:
    209209            return self._build_path(self.get_option('configuration'),
    210                                     self.get_option('results_directory'))
     210                                    'layout-test-results')
     211
     212    def results_directory(self):
     213        # FIXME: This is a hack needed for compatibility with the Chromium
     214        # buildbots until their scripts can be updated. Once they have been,
     215        # this routine can be deleted and we can use the base class.
     216        # See https://bugs.webkit.org/show_bug.cgi?id=58272 for more details.
     217        if not self._results_directory:
     218            option_val = self.get_option('results_directory')
     219            if option_val and not self._filesystem.isabs(option_val):
     220                self._results_directory = self._build_path(self.get_option('configuration'),
     221                                                           option_val)
     222            else:
     223                return super(ChromiumPort, self).results_directory(self)
     224        return self._results_directory
    211225
    212226    def setup_test_run(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py

    r83476 r83646  
    3939
    4040from webkitpy.tool import mocktool
    41 mock_options = mocktool.MockOptions(results_directory='layout-test-results',
    42                                     use_apache=True,
     41mock_options = mocktool.MockOptions(use_apache=True,
    4342                                    configuration='Release')
    4443
     
    6160            return None
    6261
    63         port = maker(options=options)
    64         if hasattr(options, "results_directory"):
    65             port._options.results_directory = port.results_directory()
    66         return port
     62        return maker(options=options)
    6763
    6864    def test_default_worker_model(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r83635 r83646  
    330330        return None
    331331
    332     def results_directory(self):
    333         if not self._results_directory:
    334             self._results_directory = self._filesystem.join('/tmp',
    335                 self.get_option('results_directory'))
    336         return self._results_directory
     332    def default_results_directory(self):
     333        return '/tmp/layout-test-results'
    337334
    338335    def setup_test_run(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r83475 r83646  
    167167        return result
    168168
    169     def results_directory(self):
     169    def default_results_directory(self):
    170170        # Results are store relative to the built products to make it easy
    171171        # to have multiple copies of webkit checked out and built.
    172         return self._build_path(self.get_option('results_directory'))
     172        return self._build_path('layout-test-results')
    173173
    174174    def setup_test_run(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r83635 r83646  
    153153        options.use_apache = sys.platform in ('darwin', 'linux2')
    154154
    155     if not port_obj._filesystem.isabs(options.results_directory):
    156         # This normalizes the path to the build dir.
    157         # FIXME: how this happens is not at all obvious; this is a dumb
    158         # interface and should be cleaned up.
    159         options.results_directory = port_obj.results_directory()
    160 
    161155    if not options.time_out_ms:
    162156        if options.configuration == "Debug":
     
    289283            help="Ignore image differences less than this percentage (some "
    290284                "ports may ignore this option)", type="float"),
    291         optparse.make_option("--results-directory",
    292             default="layout-test-results",
    293             help="Output results directory source dir, relative to Debug or "
    294                  "Release"),
     285        optparse.make_option("--results-directory", help="Location of test results"),
    295286        optparse.make_option("--build-directory",
    296287            help="Path to the directory under which build files are kept (should not include configuration)"),
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

    r82972 r83646  
    3636import itertools
    3737import logging
     38import os
    3839import Queue
    3940import sys
     
    466467        # We run a configuration that should fail, to generate output, then
    467468        # look for what the output results url was.
    468 
     469        fs = port.unit_test_filesystem()
     470        fs.maybe_make_directory('/tmp/cwd')
     471        fs.chdir('/tmp/cwd')
    469472        res, out, err, user = logging_run(['--results-directory=foo'],
    470                                           tests_included=True)
    471         self.assertEqual(user.opened_urls, ['/tmp/foo/results.html'])
     473                                          tests_included=True, filesystem=fs)
     474        self.assertEqual(user.opened_urls, ['/tmp/cwd/foo/results.html'])
    472475
    473476    # These next tests test that we run the tests in ascending alphabetical
Note: See TracChangeset for help on using the changeset viewer.