[wpt-sync] Sync PR 12187 - Add support for fuzzy matching in reftests.
Categories
(Testing :: web-platform-tests, enhancement, P4)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [wptsync downstream])
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
When we've got this support, list-style-021.xht is one test that really needs this annotation. Maybe it can be annotated as part of this bug, even, to serve as a sanity-check that the fuzzy functionality is working?
(I've just marked it as disabled in bug 1383451, but it really wants a fuzzy(8,1) annotation, for 1px differing by up to 8 in every color channel, with rgb(255,255,255) != rgb(247,247,247))
Comment 7•6 years ago
|
||
James, do you know what is blocking this from landing?
Comment 8•6 years ago
|
||
Syncing is currently blocked on figuring out why we suddenly started getting a lot of blank screenshots in reftests e.g. https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/VFoS_nw5R56dODTC8E3i9w/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1
Comment 9•6 years ago
|
||
Hi, James,
Do we have any progress on this bug? Because there are lots of WebVTT wpt tests need this fuzzy feature.
Thank you!
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
There isn't a more recent try run, but I expect this to land this week.
Comment 12•6 years ago
|
||
Sorry to poke on this bug again, just want to know is there any good progress we got for landing this one?
Thank you!
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
bugherder |
Comment 15•6 years ago
|
||
Is there a way to use fuzzy matching with platform selection like used here https://searchfox.org/mozilla-central/rev/14dc5b7d8a6da1854b2f9f33f1da77a97368cd54/testing/web-platform/meta/css/css-backgrounds/child-move-reveals-parent-background.html.ini ?
Comment 16•6 years ago
|
||
Yes, you can.
Platform selection via the is/expression syntax is a generic feature not tied to any specific field.
For general docs on the fuzziness specification see https://searchfox.org/mozilla-central/source/testing/web-platform/tests/infrastructure/metadata/infrastructure/reftest/reftest_fuzzy.html.ini#2 for an example or the documentation [1], [2].
Bit generally you should be able to do something like:
fuzzy:
if os == "linux": 10;1-20
if os == "mac": 5;10
or with whatever values are appropriate.
No doubt the docs could be improved, so let me know what problems you run into.
[1] https://searchfox.org/mozilla-central/source/testing/web-platform/tests/tools/wptrunner/docs/expectation.rst#203-214
[2] https://web-platform-tests.org/writing-tests/reftests.html#fuzzy-matching
Comment 17•6 years ago
|
||
I think it would be a good idea to post a PSA about this feature in dev.platform.
Comment 18•6 years ago
|
||
Hi, James,
I've added the fuzzy
keyword on some wpts, but it seems not work at all [1]. Is there any thing I miss?
Thank you.
Comment 19•6 years ago
•
|
||
(In reply to Alastor Wu [:alwu] from comment #18)
I've added the
fuzzy
keyword on some wpts, but it seems not work at all [1]. Is there any thing I miss?
One guess: it looks like in your fuzzy annotations, you're repeating the test name, like here in your try commit:
--- /dev/null
+++ b/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/align_center.html.ini
@@ -0,0 +1,2 @@
+[align_center.html]
+ fuzzy: align_center.html:maxDifference=2;totalPixels=5000
^^^^^^^^^^^^^^^^^----(I think this is the problem)
I think you're supposed to use the reference name in the fuzzy annotation. (The test name is already present in the brackets, so it'd be redundant to list it again.)
I think (?) the idea is that tests can have multiple references (though they don't often), so to handle that correctly, you have to clarify which reference you're referring to in the fuzzy annotation. Or something like that. You don't have to clarify which testcase you're referring to, because the testcase has already been mentioned.
Comment 20•6 years ago
|
||
(Sorry I often miss comments on these bugs because for [reasons] I get bugmail for all PRs we're syncing and so it tends to get filtered away).
Yeah, so if you just don't put any filename then the annotation should get applied to all comparisons in that test. In the typical case that's fine because there's only one comparison. However wpt reftests are complex because tests can have multiple allowed renderings and you can build up chains of references for a single test. So for those complex cases it can be necessary to specify which part of the chain the fuzziness applies to. In that case, if the ref is only used once or the fuzziness applies every time it's used, you can simply name the ref (as a relative path from the test) using the <key>:<fuzzy> syntax you used above. In the most complex case where you want to identify a specific comparison you can use the full <lhs><reftype><rhs>:<fuzzy> form, where <lhs> and <rhs> are the relative paths from the initial test to the files being compared and <reftype> is either == or !=.
The tl;dr summary of all of that is that for your case you probably just want to write maxDifference=2;totalPixels=5000
, but dholbert is also correct that for more precision you need to specify the ref not the test.
There is a proposal to reform the way that complex reftests work in wpt which might hekp avoid some of this complexity; see [1] if you would like to give feedback on that.
I also noticed that there was a bug in the code comment explaining this; apologies if that caused the confusion.
Description
•