Changeset 83759 in webkit


Ignore:
Timestamp:
Apr 13, 2011 1:58:13 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

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

Reviewed by Ojan Vafai.

new-run-webkit-tests: suppress extraneous pretty patch warnings
https://bugs.webkit.org/show_bug.cgi?id=58295

NRWT wasn't being careful about when it logged messages from
PrettyPatch not being available; it should only log during
check_build(), and be silent otherwise. This was causing us to
get multiple errors at runtime, which was confusing.

  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/base_unittest.py:
  • Scripts/webkitpy/layout_tests/port/chromium.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r83752 r83759  
     12011-04-13  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        new-run-webkit-tests: suppress extraneous pretty patch warnings
     6        https://bugs.webkit.org/show_bug.cgi?id=58295
     7
     8        NRWT wasn't being careful about when it logged messages from
     9        PrettyPatch not being available; it should only log during
     10        check_build(), and be silent otherwise. This was causing us to
     11        get multiple errors at runtime, which was confusing.
     12
     13        * Scripts/webkitpy/layout_tests/port/base.py:
     14        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
     15        * Scripts/webkitpy/layout_tests/port/chromium.py:
     16
    1172011-04-13  Dirk Pranke  <dpranke@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    • Property svn:executable set to *
    r83646 r83759  
    133133        self._pretty_patch_path = self.path_from_webkit_base("Websites",
    134134            "bugs.webkit.org", "PrettyPatch", "prettify.rb")
    135         # If we're running on a mocked-out filesystem, this file almost
    136         # certainly won't be available, so it's a good test to keep us
    137         # from erroring out later.
    138         self._pretty_patch_available = self._filesystem.exists(self._pretty_patch_path)
     135        self._pretty_patch_available = None
     136
    139137        if not hasattr(self._options, 'configuration') or self._options.configuration is None:
    140138            self._options.configuration = self.default_configuration()
     
    180178        raise NotImplementedError('Port.check_image_diff')
    181179
    182     def check_pretty_patch(self):
     180    def check_pretty_patch(self, logging=True):
    183181        """Checks whether we can use the PrettyPatch ruby script."""
    184 
    185182        # check if Ruby is installed
    186183        try:
     
    188185        except OSError, e:
    189186            if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
    190                 _log.error("Ruby is not installed; "
    191                            "can't generate pretty patches.")
     187                if logging:
     188                    _log.error("Ruby is not installed; can't generate pretty patches.")
     189                    _log.error('')
     190                return False
     191
     192        if not self.path_exists(self._pretty_patch_path):
     193            if logging:
     194                _log.error("Unable to find %s; can't generate pretty patches." % self._pretty_patch_path)
    192195                _log.error('')
    193                 return False
    194 
    195         if not self.path_exists(self._pretty_patch_path):
    196             _log.error('Unable to find %s .' % self._pretty_patch_path)
    197             _log.error("Can't generate pretty patches.")
    198             _log.error('')
    199196            return False
    200197
     
    759756
    760757    def pretty_patch_text(self, diff_path):
     758        if self._pretty_patch_available is None:
     759            self._pretty_patch_available = self.check_pretty_patch(logging=False)
    761760        if not self._pretty_patch_available:
    762761            return self._pretty_patch_error_html
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py

    r83646 r83759  
    8787    def test_pretty_patch_script_error(self):
    8888        # FIXME: This is some ugly white-box test hacking ...
    89         base._pretty_patch_available = True
    9089        port = base.Port(executive=executive_mock.MockExecutive2(exception=ScriptError))
     90        port._pretty_patch_available = True
    9191        self.assertEqual(port.pretty_patch_text("patch.txt"),
    9292                         port._pretty_patch_error_html)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r83749 r83759  
    109109        # It's okay if pretty patch isn't available, but we will at
    110110        # least log a message.
    111         self.check_pretty_patch()
     111        self._pretty_patch_available = self.check_pretty_patch()
    112112
    113113        return result
Note: See TracChangeset for help on using the changeset viewer.