Bug 186132 - export-w3c-test-changes can not export reftests
Summary: export-w3c-test-changes can not export reftests
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 167911
  Show dependency treegraph
 
Reported: 2018-05-31 02:14 PDT by Frédéric Wang (:fredw)
Modified: 2023-02-10 23:14 PST (History)
10 users (show)

See Also:


Attachments
Patch (6.91 KB, patch)
2018-05-31 08:41 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2018-05-31 02:14:39 PDT
In WebKit, reftests are

NAME.html
NAME-expected.html

Moreover, the <link rel="match"> points to the non-existing NAME-ref.html file.

When export-w3c-test-changes runs the lint tool, it complains about

1) NAME-expected.html being a support file in the wrong directory.
2) NAME.html pointing to non-existent ref file.

The support script should rename NAME-expected.html to NAME-ref.html before exporting in order to fix these errors.
Comment 1 Frédéric Wang (:fredw) 2018-05-31 08:41:00 PDT
Created attachment 341663 [details]
Patch
Comment 2 youenn fablet 2018-05-31 12:21:27 PDT
The issue with ref tests is that one ref file in WPT might be used for several test files, so I am not sure we can always update correctly all ref files.
In the simple one test/one ref case, this should work so maybe we could add a warning or add a check for this multi case
Comment 3 Frédéric Wang (:fredw) 2018-05-31 12:26:56 PDT
So you mean that when we have a single ref for multiple reftests, the import script will generate multiple -expected.html?

I guess it's a problem with the import / way WebKit handles reftest then. I saw a FIXME in the import script about that.
Comment 4 Frédéric Wang (:fredw) 2018-05-31 12:33:35 PDT
I suppose for new reftests, it's safe to just rename -expected => -ref.

For existing reftests using a single ref for multiple files or when upstream names are not of the form *-ref.html or similar (e.g. ./css/css-fill-stroke/reference/paint-order-001-ref.tentative.html) I guess the patch will just fail to apply.
Comment 5 Frédéric Wang (:fredw) 2018-07-11 06:21:56 PDT
Cancelling review since it seems we don't have a clear agreement on how we will handle the mismatch between WebKit / WPT formats...
Comment 6 Philip Jägenstedt 2019-11-05 06:25:00 PST
Is it Tools/Scripts/import-w3c-tests that renames references to -expected.html?
Comment 7 Frédéric Wang (:fredw) 2019-11-05 06:48:30 PST
(In reply to Philip Jägenstedt from comment #6)
> Is it Tools/Scripts/import-w3c-tests that renames references to
> -expected.html?

Yes it is.
Comment 8 Philip Jägenstedt 2019-11-07 15:34:50 PST
That'll definitely make it challenging to work effectively with reftests, and it looks like plenty of WebKit-specific failures in WPT are reftests.

Is there any possible fix here short of getting rid of the renaming, with all that would entail?
Comment 9 Radar WebKit Bug Importer 2023-02-10 04:59:19 PST
<rdar://problem/105269974>
Comment 10 Antoine Quint 2023-02-10 05:00:07 PST
Not sure the name of this Radar is completely correct. You can export reftests so long as you have both -expected.html and -ref.html files in your WebKit repository. It's far from ideal though.
Comment 11 Tim Nguyen (:ntim) 2023-02-10 23:14:39 PST
(In reply to Antoine Quint from comment #10)
> Not sure the name of this Radar is completely correct. You can export
> reftests so long as you have both -expected.html and -ref.html files in your
> WebKit repository. It's far from ideal though.

It wasn't possible before because we renamed the -ref.html file and deleted the original -ref.html.

Now we have duplicates, which allows exporting, but is far from ideal.