[webkit-dev] WPT first test policy proposal

Ryosuke Niwa rniwa at webkit.org
Tue Nov 23 15:18:40 PST 2021


On Fri, Nov 19, 2021 at 1:06 PM Tim Nguyen via webkit-dev <
webkit-dev at lists.webkit.org> wrote:

> Hello everyone,
>
> I would like to start a discussion on a policy to enforce WPT usage as a
> first choice, that would be enforced via check-webkit-style on Changelog
> files.
>
> *Why use WPT?*
>
> Contributing to WPT has many benefits:
>
>    - interoperability/compatibility issues with WPT we write may be
>    detected by other browser vendors and we would get faster feedback and
>    turnaround to fix them
>    - creates/encourages discussion in case of disagreement with other
>    browser vendors
>    - WebKit greatly benefits from WPT coverage, it is time to provide our
>    own coverage to other browsers
>    - Improves WebKit’s score generally for WPT (which has tests mostly
>    contributed by Chromium, Firefox at the moment)
>
>
> *Are there reasons to not use WPT?*
>
> Common reasons for not writing WPT that have been mentioned are:
>
>    - "WPTs are less pleasant to write.”
>
> This is not true imo, the WPT harness is documented (
> https://web-platform-tests.org/writing-tests/index.html), unlike WebKit
> internals, making it easier for new contributors to figure out things.
>

This is absolutely still the case for me. WPT harness require so much
boilerplate even today.

I absolutely hate having to describe what I'm testing when the test code
speaks for itself. This is akin to our WebKit coding style of not adding
comments that repeat the code.

I also absolutely hate having to start a HTTP server just to test some DOM
Node API. There is absolutely no reason why we need to do that.

Also, why do we need to call setup or done just to avoid a single test()
function call? The harness should be automatically detecting that.

I can go on and on about all other issues I have with WPT.

>
>    - “When you actually move a regression test to WPT proper, commit
>    history is lost, and you don't know what kind of user facing problem it's
>    preventing any more.”
>
> Use `<link rel=“help” href=“…”>` with a reference to the webkit bug.
> Ensure you actually export the WPT and merge the WPT PR as well!
>

This is yet another thing we have to do. We shouldn't be making writing
WebKit tests harder.

*Here is my current proposal:*
>
> Every LayoutTests/ changelog adding new test files would contain:
>

I'm opposed to introducing a policy like this in general. WebKit project
avoids adding new policies wherever possible.

To me, we make the experience of writing WPT tests so much better & so much
more pleasant that people would prefer writing them over js-test.js tests
on their own, not forced upon by a policy.

- R. Niwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20211123/7726235d/attachment.htm>


More information about the webkit-dev mailing list