Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test type detection code and document does not match #45268

Open
WeizhongX opened this issue Mar 22, 2024 · 4 comments
Open

Test type detection code and document does not match #45268

WeizhongX opened this issue Mar 22, 2024 · 4 comments

Comments

@WeizhongX
Copy link
Contributor

WeizhongX commented Mar 22, 2024

In the document (https://web-platform-tests.org/writing-tests/file-names.html) it says:
[1] (for test type)These flags must be the last element in the filename before the extension e.g. foo-manual.html will indicate a manual test, but foo-manual-other.html will not.
[2] (for test feature) These flags are preceded by a . in the filename, and must themselves precede any test type flag, but are otherwise unordered.

So according to this, for a manual tentative test, we should write ".tentative-manual.html", but we have plenty of tests named in the reverse order, e.g. "permissions-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html", "payment-method-basic-card/empty-data-manual.https.html".

In the code [3], it basically only fetch the type flag from the first component after "-".

if "-" in name:
type_flag = name.rsplit("-", 1)[1].split(".")[0]

@WeizhongX
Copy link
Contributor Author

Despite what the document says, looks like the common pattern ppl are using is "-(.)*.html", maybe because it will be more eye pleasing to put "-" always before ".", e.g. "vertical-scroll-main-frame-manual.tentative.html" is better than "vertical-scroll-main-frame.tentative-manual.html".

Should we update the document to accept this common practice?

@WeizhongX
Copy link
Contributor Author

@jgraham WDYT?

@gsnedders
Copy link
Member

This changed in cb4fb70; w3c/wpt-tools#123 / w3c/wpt-tools#124.

IMO, given it's been the behaviour for well over seven years, we should just change the docs.

@WeizhongX
Copy link
Contributor Author

Thanks, uploaded #45696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants