Bug 75836

Summary: webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl should test stdout and stderr
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: Tools / TestsAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: ddkilzer, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=199927
Bug Depends on:    
Bug Blocks: 73531    
Attachments:
Description Flags
Patch
none
Patch
ddkilzer: review+
rebased patch for commit none

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.