Bug 1761559 [wpt PR 33373] - Support metadata properties outside wptrunner, a=testonly
commita1601d7f74f290e3520a25dd41cfb006a35550a9
authorJames Graham <james@hoppipolla.co.uk>
Sat, 3 Sep 2022 06:54:01 +0000 (3 06:54 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 4 Sep 2022 17:57:47 +0000 (4 17:57 +0000)
treed154f5d67ce4195fce6e5b8b15a5ef4c43828d0e
parentfba5debb255ada412d577278a7a22fd33626198c
Bug 1761559 [wpt PR 33373] - Support metadata properties outside wptrunner, a=testonly

Automatic update from web-platform-tests
Support metadata properties outside wptrunner

For each CI system we run in there's a set of metadata properties
required to distinguish different configurations. For example on
GitHub when running infrastructure tests, that's the browser product
name, whereas in vendor CI it's typically different platform
configurations.

Until now the properties used when updating the metadata have been
stored in the browser product definition in wptrunner. But given they
vary per system that doesn't make much sense. Instead it should be
possible to pass in the properties relevant to the metadata being
updated.

To do that this PR adds the concept of a "metadata properties"
file. That's a JSON file of the form

{
 "property": ["name"],
 "dependent": {"name": ["other"]}
}

which specifies which properties can be used for update (this matches
the data format of the `update_properties` functions in wptrunner
products).

By default a file name `update_properties.json` in the root metadata
will be used to specify the properties. This makes sense since it puts
the properties together with the relevant metadata on the filesystem.

For now reading the properties from wptrunner is still supported,
because users need time to transition to the new format. But the
intent is to remove that later.

--
Update documentation for test metadata

This brings it more into line with the current reality, rather than
the situation when it was first implemented.

--

wpt-commits: 64082e7b0d5f34648dd227b14de68966ba1943aad12bd16e292ef8ac9f52707d1af4490e9748c7a4
wpt-pr: 33373
testing/web-platform/tests/infrastructure/metadata/update_properties.json [new file with mode: 0644]
testing/web-platform/tests/tools/wpt/tests/test_update_expectations.py
testing/web-platform/tests/tools/wpt/update.py
testing/web-platform/tests/tools/wptrunner/docs/expectation.rst
testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_metadata.py [new file with mode: 0644]
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py