free-claude-code/scripts
Ali Khokhar 4007c87eb1
patch: add configurable pytest and Playwright CI shards (#2068)
## Why

Pytest and Playwright each run their whole suite in one job per OS.
Splitting each suite across configurable jobs lets CI run more tests
concurrently while retaining Linux, Windows, and macOS coverage.

Windows browser traces also showed successful UI updates arriving just
after Playwright's five-second assertion deadline. A provider-save test
separately treated a disabled Save button as proof of completion even
while its request was running.

## How

- Generate matrices from separate `CI_PYTEST_SHARDS` and
`CI_PLAYWRIGHT_SHARDS` workflow values, defaulting to two pytest shards
and three Playwright shards per OS. That produces 15 test jobs total,
including five macOS jobs. Reject invalid counts before starting the
matrices.
- Use `pytest-split` with `least_duration` and equal default weights to
assign collected items to shards. Retain automatic xdist workers and
work stealing within each shard. Test counts are balanced, but test
runtimes and repeated setup costs can differ.
- Add stable `pytest` and `playwright` summaries that pass only when
preparation and every corresponding shard succeed. Include shard
position in browser failure artifact names.
- Keep full local suite commands available and allow shard replay
through `PYTEST_ADDOPTS`. Cover matrix generation, complete
partitioning, xdist execution, platform coverage, and summary failure
behavior with contract tests.
- Give browser assertions up to ten seconds to observe completed UI
updates. Wait for the provider's second save response and Saved state
before checking its retained credentials.

The repository ruleset now requires the two suite summaries in place of
the six OS-specific test checks. All other protection settings are
preserved.


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=79593373"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-impact-verdict --> No identified issue blocks merging.

<details open><summary><h3>Summary</h3></summary>

This PR splits pytest and Playwright across configurable jobs while
keeping Linux, Windows, and macOS coverage.
- Pytest and Playwright run in configurable shards on all three systems.
- Pytest and Playwright each report one stable CI check.
- Browser checks wait longer and confirm provider saves finish.

The changes since the previous review affect browser waits and the
provider-save test. No actionable issue was found.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (2) · Last reviewed commit: ["Allow browser readiness
delays and
await..."](27712336b3)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_expert&utm_medium=github&utm_campaign=code_reviews&utm_content=alishahryar1/free-claude-code)</sub>

<!-- /greptile_comment -->
2026-10-12 21:23:29 -07:00
..
update patch: Check FCC version before running updates (#1917) 2026-09-26 18:34:11 -07:00
check_version_policy.py patch: Automate release versions and GitHub Releases (#1903) 2026-09-25 14:21:55 -07:00
ci.ps1 Parallelize browser CI and fix chat scroll reset after Stop (#1687) 2026-09-06 00:40:54 -07:00
ci.sh Parallelize browser CI and fix chat scroll reset after Stop (#1687) 2026-09-06 00:40:54 -07:00
ci_shards.py patch: add configurable pytest and Playwright CI shards (#2068) 2026-10-12 21:23:29 -07:00
install-muse.ps1 Fix Windows Muse installation with empty PATH entries (#1729) 2026-09-08 22:50:06 -07:00
install.ps1 minor: Bundle RTK and Headroom and fix lock acquisition (#2042) 2026-10-10 18:56:33 -07:00
install.sh minor: Bundle RTK and Headroom and fix lock acquisition (#2042) 2026-10-10 18:56:33 -07:00
publish_release.py patch: Fix post-merge release lookup race (#1904) 2026-09-25 14:39:40 -07:00
uninstall-muse.ps1 Fix Windows Muse installation with empty PATH entries (#1729) 2026-09-08 22:50:06 -07:00
uninstall.ps1 patch: Add fcc-doctor and simplify bug reports (#1906) 2026-09-25 21:00:15 -07:00
uninstall.sh patch: Add fcc-doctor and simplify bug reports (#1906) 2026-09-25 21:00:15 -07:00
validate_release.py patch: Automate release versions and GitHub Releases (#1903) 2026-09-25 14:21:55 -07:00