Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci(a11y): pass contract file filters before --project (#7453)

Cindy Zhanga4ad9fd0335e
diff --git a/.github/scripts/release-check-workflow.test.mjs b/.github/scripts/release-check-workflow.test.mjs
index f610f1c3e8..78073444f4 100644
--- a/.github/scripts/release-check-workflow.test.mjs
+++ b/.github/scripts/release-check-workflow.test.mjs
@@ -19,6 +19,9 @@ const workflow = yaml.parse(
);
const jobs = workflow.jobs;
const step = (job, name) => jobs[job].steps.find(item => item.name === name);
+const packageJson = JSON.parse(
+ fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf8'),
+);
const releaseJobs = [
'check-scope',
'check-components',
@@ -713,7 +716,13 @@ describe('full release scope without PR metadata or maintenance writes', () => {
expect(contracts.run).toContain(
'a11y-contract-shard.mjs --shard "${{ matrix.shard }}/${{ strategy.job-total }}"',
);
- expect(contracts.run).toContain('pnpm test:a11y-contract "${FILES[@]}"');
+ // File filters must precede `--project`, which is variadic.
+ expect(contracts.run).toContain(
+ 'pnpm exec playwright test "${FILES[@]}" --config playwright.config.ts --project chromium',
+ );
+ expect(packageJson.scripts['test:a11y-contract']).toBe(
+ 'playwright test --config playwright.config.ts --project chromium',
+ );
expect(contracts.run).toContain('set -euo pipefail');
expect(contracts.env.A11Y_CONTRACT_WORKERS).toBe(4);
// Shard legs that run four pages or workers get four cores.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dc4da90540..63490e8a8f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2007,7 +2007,9 @@ jobs:
set -euo pipefail
node .github/scripts/a11y-contract-shard.mjs --shard "${{ matrix.shard }}/${{ strategy.job-total }}" > contract-files.txt
mapfile -t FILES < contract-files.txt
- pnpm test:a11y-contract "${FILES[@]}"
+ # The filters come before the options: `--project` takes every
+ # value after it, so filters placed after it read as project names.
+ pnpm exec playwright test "${FILES[@]}" --config playwright.config.ts --project chromium
- name: Upload pressed-state pixel evidence
if: always() && github.event_name == 'workflow_dispatch' && inputs.operation == 'release-check'