ci: local TIA test runs; simplify e2e (drop sharding + e2e-gate) (#262)

* ci: name e2e shards descriptively and add time-balanced sharding

- e2e job now shows as "e2e (shard 1/2)" / "e2e (shard 2/2)" in checks
  instead of the unlabeled matrix "(1)" / "(2)" suffix
- add scheduled/manual "Update Shards" workflow that generates and
  commits tests/.pest/shards.json so Pest balances the two e2e shards
  by real execution time instead of file count

* ci: enable Pest TIA for local test runs

Scoped to local via locally() so CI keeps running the full suite on
every commit. Add composer test:tia script using herd coverage, since
Herd bundles Xdebug but doesn't load it by default.

* ci: drop Herd-specific prefix from test:tia composer script

trypost is open-source and self-hosted; not every contributor runs
Herd. The script now just needs a coverage driver (Xdebug/PCOV)
active however the environment provides it — Herd users can run it
via "herd coverage composer test:tia".

* ci: revert e2e sharding, drop Update Shards workflow

Sharding across 2 runners added complexity (unbalanced shards without
timing data, plus an Update Shards workflow that can't push straight
to main under branch protection) that isn't worth it here. e2e now
runs tests/Browser as a single job again; e2e-gate stays as a
pass-through so the required branch protection check name is
unchanged.

* ci: drop redundant e2e-gate job

e2e-gate only mirrored e2e's own result once sharding was removed.
Updated main's branch protection required_status_checks to require
"e2e" directly instead of "e2e-gate".
This commit is contained in:
Paulo Castellano 2026-08-09 11:24:10 -04:00 committed by GitHub
parent 4be33d00d2
commit 80888641e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 15 deletions

View file

@ -64,11 +64,6 @@ jobs:
e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2]
services:
postgres:
image: postgres:16
@ -115,21 +110,13 @@ jobs:
env:
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
run: php artisan test tests/Browser --compact --shard=${{ matrix.shard }}/2
run: php artisan test tests/Browser --compact
- name: Upload Playwright artifacts
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-artifacts-${{ matrix.shard }}
name: playwright-artifacts
path: tests/Browser/Screenshots
if-no-files-found: ignore
retention-days: 7
e2e-gate:
if: always()
needs: e2e
runs-on: ubuntu-latest
steps:
- name: Require all e2e shards to pass
run: '[ "${{ needs.e2e.result }}" = "success" ] || exit 1'

View file

@ -125,6 +125,9 @@
"@test",
"@php artisan test tests/Browser"
],
"test:tia": [
"vendor/bin/pest --parallel --tia"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"

View file

@ -33,6 +33,19 @@
->use(RefreshDatabase::class)
->in('Browser');
/*
|--------------------------------------------------------------------------
| Test Impact Analysis
|--------------------------------------------------------------------------
|
| Only re-run tests affected by local changes, replaying cached results for
| the rest. Scoped to local runs via "locally()" automatically skipped on
| CI (or when the "--ci" flag is passed), which always runs the full suite.
|
*/
pest()->tia()->locally();
/*
|--------------------------------------------------------------------------
| Expectations