Files
supabase/e2e/docs/scripts/run-e2e-docs.ts
T
alexisintech 490fa2f2e1 ci(docs): scan only the guides production serves in the daily accessibility scan
The scan reads its page list from master, so a guide merged since the last
production deploy returned 404 and failed it. When DOCS_E2E_SITEMAP_URL is
set, e2e:docs:all keeps only the guides that are also in that sitemap, and
lists the rest as not on production yet. The run fails when the sitemap
can't be read, lists no guides, or is missing more than a tenth of them.
2026-12-02 17:01:20 -07:00

26 lines
917 B
JavaScript

#!/usr/bin/env node
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { runSuite } from '../../shared/run-suite.ts'
import { onlyProductionPages } from '../utils/production-pages.ts'
import { resolveAllDocsPages, resolveDocsScope } from '../utils/resolve-docs-scope.ts'
runSuite({
root: join(dirname(fileURLToPath(import.meta.url)), '..'),
label: 'docs',
devCommand: 'pnpm dev:docs',
pagePathsEnv: 'DOCS_E2E_PAGE_PATHS',
baseRefEnv: 'DOCS_E2E_BASE_REF',
defaultBaseUrl: 'http://localhost:3001',
resolveScope: resolveDocsScope,
resolveAllPages: async (repoRoot) => {
const pages = await resolveAllDocsPages(repoRoot)
const sitemapUrl = process.env.DOCS_E2E_SITEMAP_URL
return sitemapUrl ? onlyProductionPages(pages, sitemapUrl) : pages
},
}).catch((error) => {
console.error(error instanceof Error ? error.message : error)
process.exit(1)
})