Skip to content

Adds new lint rule to detect test overlap in web feature files#58827

Draft
ChrisC wants to merge 3 commits intoweb-platform-tests:masterfrom
bocoup:webfeatures-overlapping-tests
Draft

Adds new lint rule to detect test overlap in web feature files#58827
ChrisC wants to merge 3 commits intoweb-platform-tests:masterfrom
bocoup:webfeatures-overlapping-tests

Conversation

@ChrisC
Copy link
Copy Markdown
Contributor

@ChrisC ChrisC commented Mar 27, 2026

Adds a new OVERLAPPING-WEB-FEATURES-FILE lint rule that detects when the same test file is mapped to multiple features within a single WEB_FEATURES.yml file. (Overlap detection is file-based, not pattern-based: patterns are resolved to actual filenames first, so intentional exclusion patterns do not accidentally trigger the error.)

Error message design

Errors are grouped one per overlapping feature pair rather than one per overlapping file. This keeps output manageable in cases where many files are shared between two features. The message lists up to the first 5 overlapping filenames, followed by "and N more" for larger overlaps. Example:

OVERLAPPING-WEB-FEATURES-FILE: Features 'view-transitions' and 'view-transition-class'
share 17 overlapping test files: class-specificity.html, pseudo-with-classes-entry.html,
pseudo-with-classes-exit.html, pseudo-with-classes-match-ident.html,
pseudo-with-classes-match-multiple-wildcard.html, and 12 more

Silencing intentional overlaps

Authors who intentionally map the same test to multiple features (e.g. a test of two closely related features) can suppress this error using the existing lint.ignore mechanism:

OVERLAPPING-WEB-FEATURES-FILE: path/to/WEB_FEATURES.yml

(One downside of this approach is that it will be hard to selectively ignore specific overlaps within a single WEB_FEATURE.yml. It's possible that some future updates to the WEB_FEATURES.yml schema could more expressively address situations where overlap is intended.)

Existing overlaps

Currently, there are 57 WEB_FEATURES.yml files in the repo that already have overlapping mappings. For simplicity, I'm just assuming those are all intentional for now, and have added them to lint.ignore. So this PR introduces no new lint failures. Happy to revisit this added IGNORE list either in this PR or in a follow-up PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant