Bug 92398 - All ports should support per test switching of pixel testing
Summary: All ports should support per test switching of pixel testing
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: Balazs Kelemen
URL:
Keywords:
: 91538 (view as bug list)
Depends on: 92855
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 10:41 PDT by Balazs Kelemen
Modified: 2012-08-20 19:13 PDT (History)
20 users (show)

See Also:


Attachments
Patch (35.81 KB, patch)
2012-07-26 11:30 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
patch for ews's (44.97 KB, patch)
2012-07-30 10:43 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (44.96 KB, patch)
2012-07-30 11:27 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (48.63 KB, patch)
2012-07-31 02:34 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (48.80 KB, patch)
2012-07-31 04:30 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (50.22 KB, patch)
2012-07-31 06:14 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (48.79 KB, patch)
2012-07-31 06:40 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (49.38 KB, patch)
2012-07-31 09:38 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (50.84 KB, patch)
2012-07-31 10:19 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (154.86 KB, patch)
2012-08-02 02:06 PDT, Balazs Kelemen
no flags 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-07-26 10:41:41 PDT
This is the next step after bug 91754. The goal is to be able to specify what tests a platform want to run as pixel test with --pixel-test-directory. We will also be able to remove the DriverProxy hack in nrwt which was added to support reftests. I am going to remove the --pixel-tests option from DRT's because it's unlikely that anyone rely on the ability to use it manually. Please notify me if you don't agree on that.
Comment 1 Balazs Kelemen 2012-07-26 11:30:39 PDT
Created attachment 154700 [details]
Patch
Comment 2 Dirk Pranke 2012-07-26 14:31:19 PDT
Comment on attachment 154700 [details]
Patch

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

Thanks for changing all of the ports! that's great. That said, R-'ing for the typo on the mac port :)

Also, it might be nice if someone else who was more familiar with the DRT/WTR/C++ code took a look. Tony, what do you think?

In your earlier change, I missed that the format for the line written to stdin was "test'--pixel-test'hash" ... I was hoping to extend this to support arbitrary arguments, which I suppose you can do by just splicing them between single quotes, but it seems a little odd. why not just separate the args with spaces, e.g., test hash --pixel-test --foo --bar, etc.?

> Tools/DumpRenderTree/efl/DumpRenderTree.cpp:232
> +static bool getExpectedPixelHash(const String& testURL, String& pixelHashOut)

I don't know the EFL implementation at all, but (perhaps naively) wouldn't it be better to parse the url in the caller to see if you needed to get the hash? Or maybe at least change the name of this function?

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:876
> +        printSeparators = (optind < argc - 1 || (dumpPixelsForCurrentTest && dumpTree);

does this compile? I think you're missing a closing paren ...
Comment 3 Tony Chang 2012-07-26 14:35:38 PDT
Comment on attachment 154700 [details]
Patch

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

It's very brave of you to try to change all the ports at the same time! :)

It seems like the code for parsing pathOrURL and the command line arguments is the same for all DRTs (except maybe EFL).  Can we move that into a helper file?  Something like CyclicRedundancyCheck.h or PixelDumpSupport.h.

This was probably discussed in an earlier bug, but why is ' used as a separator? Can't we just search for -- after a space?

> Tools/ChangeLog:10
> +        on the standart input that means that running the current

typo: standart -> standard

> Tools/Scripts/webkitpy/layout_tests/port/driver.py:342
> +            command += "'" + '--pixel-test'

Nit: Can this just be command += "'--pixel-test" ?
Comment 4 Balazs Kelemen 2012-07-27 08:15:12 PDT
(In reply to comment #3)
> (From update of attachment 154700 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=154700&action=review
> 
> It's very brave of you to try to change all the ports at the same time! :)
> 

I know... :)

> It seems like the code for parsing pathOrURL and the command line arguments is the same for all DRTs (except maybe EFL).  Can we move that into a helper file?  Something like CyclicRedundancyCheck.h or PixelDumpSupport.h.
> 
> This was probably discussed in an earlier bug, but why is ' used as a separator? Can't we just search for -- after a space?

Both are good idea. I will do that way in the next patch.
Comment 5 Balazs Kelemen 2012-07-30 09:44:59 PDT
> 
> In your earlier change, I missed that the format for the line written to stdin was "test'--pixel-test'hash" ... I was hoping to extend this to support arbitrary arguments, which I suppose you can do by just splicing them between single quotes, but it seems a little odd. why not just separate the args with spaces, e.g., test hash --pixel-test --foo --bar, etc.?
> 

I have tried to implement this but than realized that ' as separator is used because spaces are used to separate paths (which are simply the argv array in when running in standalone mode). I don't think it's worth to add a bunch of command line parsing logic to drt.
Comment 6 Balazs Kelemen 2012-07-30 10:43:55 PDT
Created attachment 155320 [details]
patch for ews's
Comment 7 Early Warning System Bot 2012-07-30 10:50:11 PDT
Comment on attachment 155320 [details]
patch for ews's

Attachment 155320 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/13396347
Comment 8 Early Warning System Bot 2012-07-30 10:52:39 PDT
Comment on attachment 155320 [details]
patch for ews's

Attachment 155320 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13394378
Comment 9 WebKit Review Bot 2012-07-30 10:53:21 PDT
Attachment 155320 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/DumpRenderTree/D..." exit_code: 1
Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp:34:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Build Bot 2012-07-30 10:54:42 PDT
Comment on attachment 155320 [details]
patch for ews's

Attachment 155320 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13387457
Comment 11 Dirk Pranke 2012-07-30 10:55:37 PDT
(In reply to comment #5)
> I have tried to implement this but than realized that ' as separator is used because spaces are used to separate paths (which are simply the argv array in when running in standalone mode). I don't think it's worth to add a bunch of command line parsing logic to drt.

DRT supports running more than one test at a time using argv? News to me; do all ports support that?
Comment 12 Gyuyoung Kim 2012-07-30 11:00:17 PDT
Comment on attachment 155320 [details]
patch for ews's

Attachment 155320 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13385588
Comment 13 Balazs Kelemen 2012-07-30 11:13:33 PDT
(In reply to comment #11)
> (In reply to comment #5)
> > I have tried to implement this but than realized that ' as separator is used because spaces are used to separate paths (which are simply the argv array in when running in standalone mode). I don't think it's worth to add a bunch of command line parsing logic to drt.
> 
> DRT supports running more than one test at a time using argv? News to me; do all ports support that?

Yes, all of them.
Comment 14 Balazs Kelemen 2012-07-30 11:27:48 PDT
Created attachment 155325 [details]
Patch
Comment 15 Gyuyoung Kim 2012-07-30 11:32:06 PDT
Comment on attachment 155325 [details]
Patch

Attachment 155325 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13385598
Comment 16 Build Bot 2012-07-30 11:34:17 PDT
Comment on attachment 155325 [details]
Patch

Attachment 155325 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13381862
Comment 17 WebKit Review Bot 2012-07-30 11:58:46 PDT
Comment on attachment 155325 [details]
Patch

Attachment 155325 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13391413
Comment 18 Tony Chang 2012-07-30 12:09:20 PDT
(In reply to comment #5)
> > 
> > In your earlier change, I missed that the format for the line written to stdin was "test'--pixel-test'hash" ... I was hoping to extend this to support arbitrary arguments, which I suppose you can do by just splicing them between single quotes, but it seems a little odd. why not just separate the args with spaces, e.g., test hash --pixel-test --foo --bar, etc.?
> > 
> 
> I have tried to implement this but than realized that ' as separator is used because spaces are used to separate paths (which are simply the argv array in when running in standalone mode). I don't think it's worth to add a bunch of command line parsing logic to drt.

I still don't see why you need '.  Any token starting with -- is a flag; everything else is a filename/URL.
Comment 19 Balazs Kelemen 2012-07-31 01:57:01 PDT
> 
> I still don't see why you need '.  Any token starting with -- is a flag; everything else is a filename/URL.

I did not say it's not possible to get rid of it. I said I don't want to bother with it. I don't make it worst than it was and improving it is out of the scope of this patch. (And anyway, it's not a common use case when one want to pass -p and the hash manually.)
Comment 20 Balazs Kelemen 2012-07-31 02:34:30 PDT
Created attachment 155474 [details]
Patch
Comment 21 Gyuyoung Kim 2012-07-31 02:38:01 PDT
Comment on attachment 155474 [details]
Patch

Attachment 155474 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13388723
Comment 22 WebKit Review Bot 2012-07-31 02:41:08 PDT
Comment on attachment 155474 [details]
Patch

Attachment 155474 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13384893
Comment 23 Build Bot 2012-07-31 02:41:41 PDT
Comment on attachment 155474 [details]
Patch

Attachment 155474 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13386787
Comment 24 Early Warning System Bot 2012-07-31 02:44:05 PDT
Comment on attachment 155474 [details]
Patch

Attachment 155474 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/13387710
Comment 25 Early Warning System Bot 2012-07-31 02:48:20 PDT
Comment on attachment 155474 [details]
Patch

Attachment 155474 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13385847
Comment 26 Balazs Kelemen 2012-07-31 04:30:44 PDT
Created attachment 155489 [details]
Patch
Comment 27 WebKit Review Bot 2012-07-31 04:37:48 PDT
Comment on attachment 155489 [details]
Patch

Attachment 155489 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13400395
Comment 28 Build Bot 2012-07-31 05:36:30 PDT
Comment on attachment 155489 [details]
Patch

Attachment 155489 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13400410
Comment 29 Balazs Kelemen 2012-07-31 06:14:55 PDT
Created attachment 155513 [details]
Patch
Comment 30 WebKit Review Bot 2012-07-31 06:21:16 PDT
Comment on attachment 155513 [details]
Patch

Attachment 155513 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13390754
Comment 31 Balazs Kelemen 2012-07-31 06:40:14 PDT
Created attachment 155519 [details]
Patch
Comment 32 WebKit Review Bot 2012-07-31 06:43:35 PDT
Comment on attachment 155519 [details]
Patch

Attachment 155519 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13385931
Comment 33 Balazs Kelemen 2012-07-31 07:42:39 PDT
Could somebody tell me how can I include the common DumpRenderTree.h in the chromium DumpRenderTree.cpp? Include path is not set, #include "../DumpRenderTree.h" doesn't work. I don't know how to add include paths in the gpy build. Could you catch me on IRC? Thanks!
Comment 34 Balazs Kelemen 2012-07-31 09:38:35 PDT
Created attachment 155569 [details]
Patch
Comment 35 Build Bot 2012-07-31 09:50:52 PDT
Comment on attachment 155569 [details]
Patch

Attachment 155569 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13410019
Comment 36 Balazs Kelemen 2012-07-31 10:19:47 PDT
Created attachment 155580 [details]
Patch
Comment 37 WebKit Review Bot 2012-07-31 10:44:55 PDT
Comment on attachment 155580 [details]
Patch

Attachment 155580 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13403260
Comment 38 Dirk Pranke 2012-07-31 11:37:10 PDT
Comment on attachment 155580 [details]
Patch

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

r+ with the nit that I'd change the delimiter back to ' if we're not going to use spaces. I assume you'd have no complaints with someone uploading a separate patch to switch to spaces? Also, fix the .gyp file, please ;).

Tony, are you okay with this?

> Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:136
> +                '../'

you probably need a comma here, else I expect this is messing up the compile path: you'd get '../<(DEPTH)' :). 

Also, this should probably be '<(tools_dir)/DumpRenderTree' rather than a relative path.

> Tools/Scripts/old-run-webkit-tests:754
> +        $suffixPixelTest = ":--pixel-test";

if we're not able to use spaces, it seems like we might as well stay with single quotes as the delimiter.

> Tools/Scripts/webkitpy/layout_tests/port/driver.py:339
> +            command += ":" + driver_input.image_hash

as above.
Comment 39 Tony Chang 2012-07-31 12:29:04 PDT
Comment on attachment 155580 [details]
Patch

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

>> Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:136
>> +                '../'
> 
> you probably need a comma here, else I expect this is messing up the compile path: you'd get '../<(DEPTH)' :). 
> 
> Also, this should probably be '<(tools_dir)/DumpRenderTree' rather than a relative path.

Heh, I suggested the relative path.  Either is fine.

> Tools/DumpRenderTree/DumpRenderTreeCommon.cpp:12
> +    CommandTokenizer(const std::string& input)

Nit: explicit

> Tools/DumpRenderTree/DumpRenderTreeCommon.cpp:53
> +    return m_next != std::string();

Nit: !m_next.empty()

> Tools/WebKitTestRunner/TestController.cpp:516
> +    CommandTokenizer(const std::string& input)

explicit

> Tools/WebKitTestRunner/TestController.cpp:557
> +    return m_next != std::string();

!m_next.empty()
Comment 40 Dirk Pranke 2012-07-31 12:38:13 PDT
(In reply to comment #39)
> > 
> > Also, this should probably be '<(tools_dir)/DumpRenderTree' rather than a relative path.
> 
> Heh, I suggested the relative path.  Either is fine.
>

I've found using relative paths to be fragile and confusing, especially when trying to move files around and/or sort through webkit-in-chromium vs. chromium-in-webkit checkouts. Using the variables made things a lot clearer (again, to me).
Comment 41 Balazs Kelemen 2012-08-01 02:09:25 PDT
Landed in http://trac.webkit.org/changeset/124313.
Keeping bug open because I forgot to remove --pixel-tests from the Qt DRT.
Comment 42 Balazs Kelemen 2012-08-01 02:36:47 PDT
Need to roll out. Adding Tools/DumpRenderTree as include path does not work because there are some files with the same name in the chromium dir. Do you agree to rename these with a Chromium suffix? It would be:
AccessibilityController.h/cpp -> AccessibilityControllerChromium.h/cpp
AccessibilityUIElement.h/cpp -> AccessibilityUIElementChromium.h/cpp
Comment 43 Balazs Kelemen 2012-08-01 02:40:03 PDT
(In reply to comment #42)
> Need to roll out. Adding Tools/DumpRenderTree as include path does not work because there are some files with the same name in the chromium dir. Do you agree to rename these with a Chromium suffix? It would be:
> AccessibilityController.h/cpp -> AccessibilityControllerChromium.h/cpp
> AccessibilityUIElement.h/cpp -> AccessibilityUIElementChromium.h/cpp

Actually we could also change the includes, like
-#include "AccessibilityController.h"
+#include "chromium/TestRunner/AccessibilityController.h"

Which solution do you prefer? :)
Comment 44 Adam Barth 2012-08-01 11:20:50 PDT
> Actually we could also change the includes, like
> -#include "AccessibilityController.h"
> +#include "chromium/TestRunner/AccessibilityController.h"
> 
> Which solution do you prefer? :)

Using an include path like "chromium/TestRunner/AccessibilityController.h" in WebKit isn't correct.
Comment 45 Dirk Pranke 2012-08-01 11:22:39 PDT
Perhaps we should just copy DumpRenderTree.h down into the chromium dir ... it looks like that's what we've done (more or less) for other files. I don't like the duplication, but sharing more code properly is probably a bigger effort than what should be required to make this patch land.
Comment 46 Balazs Kelemen 2012-08-02 02:06:03 PDT
Created attachment 156011 [details]
Patch
Comment 47 Balazs Kelemen 2012-08-02 02:07:27 PDT
(In reply to comment #45)
> Perhaps we should just copy DumpRenderTree.h down into the chromium dir ... it looks like that's what we've done (more or less) for other files. I don't like the duplication, but sharing more code properly is probably a bigger effort than what should be required to make this patch land.

Well, I don't like this idea, I think renaming those files is much more straightforward, so I did that.
Comment 48 Balazs Kelemen 2012-08-02 05:42:04 PDT
Wow, finally it builds everywhere :)
Comment 49 Balazs Kelemen 2012-08-02 13:52:37 PDT
Comment on attachment 156011 [details]
Patch

Going to land it tomorrow as it is late here and I would like to watch bots.
Comment 50 Balazs Kelemen 2012-08-03 04:36:45 PDT
Landed in r124581. ELF regression is fixed in r124595.
Comment 51 Xianzhu Wang 2012-08-06 09:05:02 PDT
*** Bug 91538 has been marked as a duplicate of this bug. ***
Comment 52 Simon Fraser (smfr) 2012-08-20 18:26:07 PDT
How can I manually run DRT with the path to a test and -p to dump pixels now?
Comment 53 Dirk Pranke 2012-08-20 19:13:24 PDT
(In reply to comment #52)
> How can I manually run DRT with the path to a test and -p to dump pixels now?

Assuming your environment is set up properly, 

path-to-DumpRenderTree path-to-LayoutTests/foo/bar.html'-pixel-test

should work (just tested this earlier today).