Bug 88709 - nrwt outputs empty files for wdiff output if wdiff is not installed
Summary: nrwt outputs empty files for wdiff output if wdiff is not installed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Dirk Pranke
URL:
Keywords: NRWT
Depends on:
Blocks:
 
Reported: 2012-06-09 06:09 PDT by Balazs Kelemen
Modified: 2012-06-20 14:30 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.70 KB, patch)
2012-06-19 21:34 PDT, Dirk Pranke
no flags Details | Formatted Diff | Diff
update w/ review feedback (11.41 KB, patch)
2012-06-20 14:13 PDT, Dirk Pranke
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kelemen 2012-06-09 06:09:18 PDT
It would be nice to avoid generating these useless files. Furthermore, I think we should print a warning message if wdiff is not installed, otherwise folks will likely not notice this useful feature at all (on Linux it's usually not installed by default).
Comment 1 Dirk Pranke 2012-06-09 15:58:14 PDT
It's not supposed to generate the files if wdiff isn't installed, so you've found a bug :).
Comment 2 Dirk Pranke 2012-06-19 21:34:41 PDT
Created attachment 148500 [details]
Patch
Comment 3 Tony Chang 2012-06-20 10:15:44 PDT
Comment on attachment 148500 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148500&action=review

Is there a test for this?

Do we need to update the code that generates results.html to make sure it doesn't include links to the non-existent diffs? We should have a test for that.

> Tools/Scripts/webkitpy/layout_tests/port/base.py:239
> +    def _log_wdiff_missing(self):
> +        _log.warning("wdiff is not installed; please install it to generate word-by-word diffs.")
> +        _log.warning('')

I would change this method to just return the string to output.  Then you don't have to duplicate the calls to _log.warning and the calls to _log.warning are next to the 'if logging' check.
Comment 4 Dirk Pranke 2012-06-20 11:19:10 PDT
(In reply to comment #3)
> (From update of attachment 148500 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=148500&action=review
> 
> Is there a test for this?
> 

No ... I realized after I uploaded this last night that I needed to add some tests. Will do so.

> Do we need to update the code that generates results.html to make sure it doesn't include links to the non-existent diffs? We should have a test for that.
>

No, the code already handles that, but I'll add tests.
 
> > Tools/Scripts/webkitpy/layout_tests/port/base.py:239
> > +    def _log_wdiff_missing(self):
> > +        _log.warning("wdiff is not installed; please install it to generate word-by-word diffs.")
> > +        _log.warning('')
> 
> I would change this method to just return the string to output.  Then you don't have to duplicate the calls to _log.warning and the calls to _log.warning are next to the 'if logging' check.

Ok.
Comment 5 Dirk Pranke 2012-06-20 14:13:45 PDT
Created attachment 148652 [details]
update w/ review feedback
Comment 6 Dirk Pranke 2012-06-20 14:30:26 PDT
Committed r120865: <http://trac.webkit.org/changeset/120865>