test(docs): run the fixed reference checks on harness-only changes

A pull request touching only e2e/docs resolved to no pages and skipped
Playwright entirely, so changes to the suite were never exercised by it.
reference-pages.spec.ts uses a fixed page list and has something to run
for those changes, so treat the harness and the workflow as in scope.
This commit is contained in:
Ali Waseem committed 2026-07-31 14:35:27 -06:00
1 parent 63a6addd4f
commit cd0c7863be
2 files changed
+10 -6

No files matched your search

+2 -1
View File
@@ -73,7 +73,8 @@ jobs:
node-version-file: '.nvmrc'
# Map changed owned content (guides, troubleshooting, partials) to page
# URLs. Harness-only PRs resolve to skip=true and exit before Playwright.
# URLs. Reference and harness changes resolve to no pages but still run,
# for the fixed set in reference-pages.spec.ts.
- name: Resolve docs E2E scope
id: scope
env:
+8 -5
View File
@@ -96,15 +96,18 @@ function isHiddenMdx(filePath: string): boolean {
}
/**
* Files behind the pages features/reference-pages.spec.ts loads. It uses a
* fixed list, so a change here runs Playwright even with no guide pages.
* Changes that should run Playwright even when no guide pages resolve, since
* features/reference-pages.spec.ts uses a fixed page list: the sources behind
* the reference pages, and the harness that loads them.
*/
function isReferenceRelevantFile(filePath: string): boolean {
function runsFixedChecks(filePath: string): boolean {
const path = normalizeRepoPath(filePath)
return (
path.startsWith('apps/docs/spec/') ||
path.startsWith('apps/docs/features/docs/Reference') ||
path === 'apps/docs/middleware.ts'
path === 'apps/docs/middleware.ts' ||
path.startsWith('e2e/docs/') ||
path === '.github/workflows/docs-e2e.yml'
)
}
@@ -320,7 +323,7 @@ export async function resolveDocsScope(
return {
pages: sorted.slice(0, maxPages),
skip: sorted.length === 0 && !options.changedFiles.some(isReferenceRelevantFile),
skip: sorted.length === 0 && !options.changedFiles.some(runsFixedChecks),
}
}