RESOLVED FIXED Bug 67253
NRWT should show the size of the pixel image delta in results.html
https://bugs.webkit.org/show_bug.cgi?id=67253
Summary NRWT should show the size of the pixel image delta in results.html
Simon Fraser (smfr)
Reported 2011-08-30 19:12:01 PDT
RWT shows % pixel diffs in the results; NRWT results do not show this. It's very useful when looking at pixel diffs.
Attachments
Sample ORWT output (34.56 KB, text/html)
2011-08-30 19:12 PDT, Simon Fraser (smfr)
no flags
Patch in progress (9.04 KB, patch)
2011-09-23 14:48 PDT, Simon Fraser (smfr)
no flags
Patch (12.58 KB, patch)
2011-09-23 16:29 PDT, Simon Fraser (smfr)
no flags
update smfr's patch to add more tests, fix style nits (26.50 KB, patch)
2011-09-26 18:08 PDT, Dirk Pranke
no flags
add default value to mockExpectation() in results-test.js (23.99 KB, patch)
2011-09-26 18:27 PDT, Dirk Pranke
no flags
Simon Fraser (smfr)
Comment 1 2011-08-30 19:12:40 PDT
Created attachment 105730 [details] Sample ORWT output
Eric Seidel (no email)
Comment 2 2011-08-31 09:29:00 PDT
Sounds like a great feature. Easy to do.
Simon Fraser (smfr)
Comment 3 2011-08-31 09:33:36 PDT
I'll do it if someone points me in the right direction. I assume the % data will have to go into the json?
Eric Seidel (no email)
Comment 4 2011-08-31 11:41:23 PDT
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py#L75 is responsible for generating the dictionary which gets dumped into full_results.json.
Eric Seidel (no email)
Comment 5 2011-08-31 11:42:28 PDT
I'm still trying to figure out how exactly we'd do this. :)
Eric Seidel (no email)
Comment 6 2011-09-16 13:23:13 PDT
Eric Seidel (no email)
Comment 7 2011-09-16 13:26:21 PDT
Here is the relevant line in NRWT: http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py#L201 We would need to change _read_image_diff to return a tuple. Then there is some plumbing to get it to the json, but should be relatively straightforward.
Eric Seidel (no email)
Comment 8 2011-09-16 13:28:32 PDT
This can be done. It's just a lot of plumbing. I will add this to my list right after bug 65781 which is what I'm currently working on. If someone else wants to take this on, that'd be even better of course, as it frees me up to fix other NRWT bugs. :)
Simon Fraser (smfr)
Comment 9 2011-09-23 14:48:49 PDT
Created attachment 108540 [details] Patch in progress
Simon Fraser (smfr)
Comment 10 2011-09-23 16:23:40 PDT
I have something mostly working.
Simon Fraser (smfr)
Comment 11 2011-09-23 16:29:01 PDT
WebKit Review Bot
Comment 12 2011-09-23 16:32:09 PDT
Attachment 108554 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/fast/harness/results.html', u'..." exit_code: 1 Tools/Scripts/webkitpy/layout_tests/port/webkit.py:184: multiple statements on one line (semicolon) [pep8/E702] [5] Tools/Scripts/webkitpy/layout_tests/port/chromium.py:216: at least two spaces before inline comment [pep8/E261] [5] Total errors found: 2 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Seidel (no email)
Comment 13 2011-09-23 17:02:33 PDT
Comment on attachment 108554 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=108554&action=review > Tools/Scripts/webkitpy/layout_tests/models/test_failures.py:171 > class FailureImageHashMismatch(TestFailure): > """Image hashes didn't match.""" > + def __init__(self, diff_percent=0): > + self.diff_percent = diff_percent I feel like I've tried to add non-static data to these before and others have gotten sad. The test_failures.py design is bad/broken. We'll have to consult Ojan/Dirk here for suggestions. >> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:216 >> + return [result, 0] # FIXME: how to get % diff? > > at least two spaces before inline comment [pep8/E261] [5] It's sad, but true that our python vs. c++ comment spacing is different in webkit. :(
Simon Fraser (smfr)
Comment 14 2011-09-23 17:08:30 PDT
I'm a python noob, so bear in mind when reviewing!
WebKit Review Bot
Comment 15 2011-09-23 17:19:22 PDT
Comment on attachment 108554 [details] Patch Attachment 108554 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9839093 New failing tests: fast/harness/results.html
Simon Fraser (smfr)
Comment 16 2011-09-23 17:21:14 PDT
(In reply to comment #15) > (From update of attachment 108554 [details]) > Attachment 108554 [details] did not pass chromium-ews (chromium-xvfb): > Output: http://queues.webkit.org/results/9839093 > > New failing tests: > fast/harness/results.html Why is results.html inside LayoutTests? This is so stupid.
Dirk Pranke
Comment 17 2011-09-23 17:29:44 PDT
Comment on attachment 108554 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=108554&action=review R-'ing this for now until we can add an integration test and I get a chance to run through the patch by hand. You probably also need to update diff_image in port/test.py. >> Tools/Scripts/webkitpy/layout_tests/models/test_failures.py:171 >> + self.diff_percent = diff_percent > > I feel like I've tried to add non-static data to these before and others have gotten sad. The test_failures.py design is bad/broken. We'll have to consult Ojan/Dirk here for suggestions. I think this should mostly work. We may have to double-check the serialization/pickling code to make sure it transfers across. >> Tools/Scripts/webkitpy/layout_tests/port/webkit.py:184 >> + diff_percent = 0; > > multiple statements on one line (semicolon) [pep8/E702] [5] Python doesn't use semicolons :) > Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:583 > + return [True, 0] We should probably have at least one integration test that returns a non-zero diff value. I will look into what it would take to make this work.
Dirk Pranke
Comment 18 2011-09-23 17:38:12 PDT
(In reply to comment #16) > (In reply to comment #15) > > (From update of attachment 108554 [details] [details]) > > Attachment 108554 [details] [details] did not pass chromium-ews (chromium-xvfb): > > Output: http://queues.webkit.org/results/9839093 > > > > New failing tests: > > fast/harness/results.html > > Why is results.html inside LayoutTests? This is so stupid. results.html itself is a test to ensure that we don't break the generated output.
Dirk Pranke
Comment 19 2011-09-26 18:08:02 PDT
Created attachment 108771 [details] update smfr's patch to add more tests, fix style nits
Dirk Pranke
Comment 20 2011-09-26 18:09:07 PDT
Eric or Tony, can I haz review plz?
Eric Seidel (no email)
Comment 21 2011-09-26 18:15:40 PDT
Comment on attachment 108771 [details] update smfr's patch to add more tests, fix style nits View in context: https://bugs.webkit.org/attachment.cgi?id=108771&action=review Seems OK. > LayoutTests/fast/harness/resources/results-test.js:37 > +function mockExpectation(expected, actual, diff_percentage) I would recommend having this default to None so you don't have to change so many results. > LayoutTests/fast/harness/resources/results-test.js:446 > + subtree['expected-to-pass-but-crashed.html'] = mockExpectation('PASS', 'CRASH', 0); It seems mockExpectation should just have a default value for diff_percentage.
Dirk Pranke
Comment 22 2011-09-26 18:27:35 PDT
Created attachment 108773 [details] add default value to mockExpectation() in results-test.js
Dirk Pranke
Comment 23 2011-09-26 18:28:25 PDT
Comment on attachment 108773 [details] add default value to mockExpectation() in results-test.js (In reply to comment #21) > > LayoutTests/fast/harness/resources/results-test.js:37 > > +function mockExpectation(expected, actual, diff_percentage) > > I would recommend having this default to None so you don't have to change so many results. > Good suggestion. Of course, I didn't actually know how to do that, so I've now learned something as well. Done.
Eric Seidel (no email)
Comment 24 2011-09-27 00:28:16 PDT
Comment on attachment 108773 [details] add default value to mockExpectation() in results-test.js View in context: https://bugs.webkit.org/attachment.cgi?id=108773&action=review OK. > Tools/Scripts/webkitpy/layout_tests/models/test_failures.py:171 > + def __init__(self, diff_percent=0): > + self.diff_percent = diff_percent The pythonistas would tell you you should use =None and then "diff_percent or 0" in the body. It doesn't matter because 0 is a constant, but if you were using [] for example, you could hose yourself, since the "default" object is a static and shared between all calls of the function.
Dirk Pranke
Comment 25 2011-09-28 17:08:39 PDT
Comment on attachment 108773 [details] add default value to mockExpectation() in results-test.js Clearing flags on attachment: 108773 Committed r96272: <http://trac.webkit.org/changeset/96272>
Dirk Pranke
Comment 26 2011-09-28 17:08:44 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.