Bug 75836 - webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl should test stdout and stderr
Summary: webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl should test stdout ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 73531
  Show dependency treegraph
 
Reported: 2012-01-09 01:11 PST by Kentaro Hara
Modified: 2019-07-18 18:59 PDT (History)
3 users (show)

See Also:


Attachments
Patch (33.81 KB, patch)
2012-01-09 01:21 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (33.76 KB, patch)
2012-01-24 13:45 PST, Kentaro Hara
ddkilzer: review+
Details | Formatted Diff | Diff
rebased patch for commit (36.49 KB, patch)
2012-01-24 15:43 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-01-09 01:11:58 PST
Currently parser_unittests.pl can just test the returned value of get_function_line_ranges() in prepare-ChangeLog. 

parser_unittests.pl should also test the stdout and stderr of get_function_line_ranges(), so that it can test warning messages.
Comment 1 Kentaro Hara 2012-01-09 01:21:51 PST
Created attachment 121631 [details]
Patch
Comment 2 Kentaro Hara 2012-01-09 01:24:51 PST
ddkilzer: I uploaded a patch for testing warning messages of prepare-ChangeLog. The git diff is pretty long but there is no essential change in *-expected.txt (except for css_unittests_warning-expected.txt).
Comment 3 David Kilzer (:ddkilzer) 2012-01-24 12:55:18 PST
Comment on attachment 121631 [details]
Patch

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

r- to remove the absolute paths from the stderr (and stdout) output.  Otherwise, this looks great!

> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning-expected.txt:10
> +  'stderr' => 'mismatched comment found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched comment found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched comment found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched brace found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched brace found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched brace found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched brace found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +mismatched brace found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
> +',

This will fail on the bots because the paths won't match.  You need to sanitize the stdout and stderr output to remove the absolute paths up to the WebKit source directory.  In other words, this error:

mismatched comment found in /usr/local/google/home/haraken/chrome-build/src/third_party/WebKit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css

Should look like this:

mismatched comment found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css

I think you can use a regex on the stderr and stdout output to remove the WebKit source directory path (sourceDir() from the webkitdirs.pm module).
Comment 4 Kentaro Hara 2012-01-24 13:45:09 PST
Created attachment 123797 [details]
Patch
Comment 5 David Kilzer (:ddkilzer) 2012-01-24 13:56:31 PST
Comment on attachment 123797 [details]
Patch

r=me  Thanks!
Comment 6 Kentaro Hara 2012-01-24 15:43:20 PST
Created attachment 123830 [details]
rebased patch for commit
Comment 7 WebKit Review Bot 2012-01-24 17:19:20 PST
Comment on attachment 123830 [details]
rebased patch for commit

Clearing flags on attachment: 123830

Committed r105837: <http://trac.webkit.org/changeset/105837>
Comment 8 David Kilzer (:ddkilzer) 2012-01-26 14:56:58 PST
Manually marking as RESOLVED/FIXED.