Parallelize Playwright accessibility tests and isolate functional suite - #2786
Parallelize Playwright accessibility tests and isolate functional suite#2786abn wants to merge 1 commit into
Conversation
fl0rianr
left a comment
There was a problem hiding this comment.
Thanks for the optimization work — splitting the accessibility and functional suites makes sense, and the runtime improvement is valuable.
I found two issues that should be addressed before merging:
- The new
npm testscript breaks argument forwarding:
"test": "npx playwright test --project=a11y && npx playwright test --project=functional"Arguments passed via commands such as:
npm test -- --grep "Model Tuning"are appended only to the second command. This means filters, --list, --last-failed, debugging options, snapshot updates, and similar arguments affect only the functional suite, while the complete accessibility suite always runs.
A small Node runner that invokes both projects with the same forwarded arguments would avoid this regression.
- The intended isolation applies only to
npm test.
npm run test:headed and direct npx playwright test calls still start both projects in the same Playwright run. workers: 1 limits the functional project itself, but does not guarantee that it cannot overlap with the accessibility project.
All supported test entry points should use the same ordered runner, or it should be demonstrated that concurrent execution of the two projects is safe.
There is also a smaller artifact issue: both sequential Playwright invocations use the same outputDir. The second invocation clears test-results, so screenshots and other artifacts from the accessibility run are removed.
Regarding the currently failing check: this is not a docs-generation failure. The app-regression-tests job fails before reaching Playwright because npm run typecheck was missing after the old GUI2 workflow was merged. Commit 5f40d5f from #2783 adds that script and has now been merged into GUI3_merging, so this PR needs to be updated or re-run against the new base.
Also note that the current CI workflow still does not execute the Playwright regression suite; its regression-test step only prints that GUI3 tests are skipped.
6346e0d to
a46e265
Compare
|
Thanks for the feedback!
|
fl0rianr
left a comment
There was a problem hiding this comment.
Thanks for the update — the project split, sequential runner, separate output directories, and route interception fixes all move the PR in the right direction.
There is still one blocking issue in run-playwright-tests.mjs:
spawnSync('npx', ['playwright', 'test', ...args], {
stdio: 'inherit',
shell: true,
});Using shell: true breaks reliable argument forwarding because arguments containing spaces can be split again by the shell. For example:
npm test -- --grep "Model Tuning"may reach Playwright as separate Model and Tuning arguments instead of one grep value. It also introduces unnecessary shell interpretation.
Please invoke the platform-specific executable directly and disable the shell, for example:
const npxCommand = process.platform === 'win32' ? 'npx.cmd' : 'npx';
const result = spawnSync(
npxCommand,
['playwright', 'test', ...args],
{
stdio: 'inherit',
shell: false,
},
);The runner should also treat process startup failures as failures. Currently, these paths can return success when status is null:
process.exit(result.status ?? 0);
process.exit(functionalResult.status ?? 0);Please check result.error and use a non-zero fallback such as status ?? 1.
One smaller clarification remains: direct npx playwright test still runs both projects in the same Playwright invocation, so the strict ordering applies only to the npm runner scripts. Either ensure direct full-suite execution is safe or document npm test and npm run test:headed as the supported isolated entry points.
a46e265 to
ae42313
Compare
|
I've updated the PR to address these points:
|
fl0rianr
left a comment
There was a problem hiding this comment.
Just a minor topic that if started with a non existent test all are passed green. But normally we use the wohle suite anyway.
Parallelizes accessibility (a11y) tests and configures functional tests to run sequentially, preventing shared state collisions. Adds a Node script runner to forward CLI arguments, separates project output directories, and corrects route wildcards.
ae42313 to
fe8e852
Compare
Summary
src/app/tests/a11y.spec.ts.a11y(parallelized) andfunctional(isolated sequential execution to avoid shared local storage/server state collisions) test projects inplaywright.config.ts.src/app/package.jsontestscript to run--project=a11y && --project=functional, accelerating full suite runtime from ~9 minutes to ~60 seconds.