Skip to content
Agentmart
Submit a tool

laravel-pest5-upgrade

Upgrade a PHP/Laravel repo from Pest 4 to Pest 5 and turn on Test Impact Analysis (TIA) so local full runs only re-execute the tests a change can reach.

Skill by bravros

IndexedMIT★ 3
Write a review

Chalk Labs

Need help deploying laravel-pest5-upgrade?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/bravros-laravel-pest5-upgrade

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Upgrade a PHP/Laravel repo from Pest 4 to Pest 5 and turn on Test Impact Analysis (TIA) so local full runs only re-execute the tests a change can reach. Use this whenever someone mentions upgrading Pest, moving to Pest 5, `pestphp/pest ^5`, Test Impact Analysis, `--tia`, "why is my test suite so slow", speeding up a slow PHP test suite, `Tia mode requires Pest tests`, `WorkerCrashedException` after enabling TIA, converting PHPUnit class-style tests to Pest, or setting up a TIA baseline — even if they don't say "Pest 5" outright. Also use it when a Pest/PHPUnit dependency bump has broken tests and they need help attributing the fallout.

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/laravel-pest5-upgrade

What's inside

Skill name
laravel-pest5-upgrade
Description
Upgrade a PHP/Laravel repo from Pest 4 to Pest 5 and turn on Test Impact Analysis (TIA) so local full runs only re-execute the tests a change can reach. Use this whenever someone mentions upgrading Pest, moving to Pest 5, `pestphp/pest ^5`, Test Impact Analysis, `--tia`, "why is my test suite so slow", speeding up a slow PHP test suite, `Tia mode requires Pest tests`, `WorkerCrashedException` after enabling TIA, converting PHPUnit class-style tests to Pest, or setting up a TIA baseline — even if they don't say "Pest 5" outright. Also use it when a Pest/PHPUnit dependency bump has broken tests and they need help attributing the fallout.
License
MIT
Instructions
122 lines in SKILL.md · view on GitHub

Files (7)

  • SKILL.md
  • ci-baseline.md · references/
  • conversion.md · references/
  • flakes.md · references/
  • pest5-features.md · references/
  • tia-internals.md · references/
  • skill.yaml

SKILL.md (first lines)

# Pest 4 → 5 + Test Impact Analysis

Turn a full local run into one that executes only the tests the current diff can reach. Measured
on a real 18,594-test Laravel suite: **655 s cold → 5.83 s** for a one-file change.

The version bump is nearly free. Almost all the work is step 2, and almost all the pain is traps
that surface as unrelated failures. Work in order — each checkpoint is what makes the next step
diagnosable.

**Scope: local adoption.** CI baseline sharing (`->baselined()` plus a workflow publishing the
graph) is out of scope — it was attempted, three bugs were found in the upstream recipe, and it
was parked. If asked for it, read `references/ci-baseline.md` first.

## 1. Preconditions

Needs PHP 8.4+ (`pest@5` requires `^8.4`, pulls `phpunit ^13.3`), a **coverage driver** (pcov or
Xdebug — TIA records its graph through it and cannot run without one; prefer pcov, several times
faster), and a **green full suite** to attribute fallout against.

Then count the real work, because it sets the schedule — two class-style tests is an afternoon,
fifty is a different project:

```bash
grep -rln --include='*Test.php' -E '^\s*(final\s+)?(abstract\s+)?class\s+\w+Test\b' tests/
```

## 2. Upgrade

```bash
composer update pestphp/pest --with-all-dependencies   # narrow, not a bare `composer update`
```

**Expect unrelated fallout.** Even the narrow form moves transitive dependencies. When a test
fails after the bump, diff **`composer.lock`**, not `composer.json`, and check whether the failing
subsystem's package moved — assuming "Pest 5 broke it" sends you hunting in the wrong codebase. On
the reference migration a docs package moved one patch version and its new route silently shadowed
one the app already served, producing a failure ~200 lines from its cause.

**Checkpoint:** `vendor/bin/pest --version` reports 5.x.

## 3. Convert every PHPUnit class-style test

TIA's hard prerequisite. It aborts the **entire run** on the first class-style test, and the
surfaced `WorkerCrashedException` names one arbitrary file while the real message hides inside:

```
ERROR  Tia mode requires Pest tests.
Encountered PHPUnit class Tests\Feature\...  (EnsureTiaIsRunningPestTestsOnly.php)
```

Anyone who hasn't seen this starts debugging a file that is fine.

**Checkpoint:** the step-1 grep returns nothing, and each converted file passes with the same
assertion count as before. Patterns, the helper-name collision trap, and dataset merges:
`references/conversion.md`.

## 4. Configure TIA

```php
pest()->tia()
    ->locally()                  // every local FULL run; no --tia flag needed
    ->filtered()                 // narrow PHPUnit to affected files -> real wall-time saving
    ->defaultBranch('homolog');  // omit when the repo's base really is main
```

- **`defaultBranch` is the one people get wrong.** TIA resolves the base from `origin/HEAD`,
  normally `main`. If feature branches are cut from a staging branch instead, every unpromoted
  commit counts as "changed" and TIA over-selects on every run. Check what branches are actually
  based on.
- **`locally()` is auto-skipped on CI.** Don't use `always()`.
- **No `->baselined()`** without the CI job — it's dead config that sends the next reader hunting
  for a workflow that never existed.
- **Keep default storage.** Don't set `directory()`; the reasoning, plus why worktrees silently
  behave differently, is in `references/tia-internals.md`.

**Checkpoint:** a targeted run prints *"TIA does not apply to partial runs"*; a second consecutive
full run prints `No affected tests found`.

Worth knowing: **a `--tia` run after a rebase is a full run** — the rebase invalidates the graph,
so it re-records everything and counts as a genuine gate.

## 5. Tell everyone the gate changed

The step most likely to be skipped, with the worst failure mode. **A full local run is now
impact-filtered**, so `--no-tia` is the real pre-PR gate — and mandatory after any dependency bump.

TIA selects off a *coverage* graph, so it cannot see reflection, string-resolved container
bindings, config/settings reads, or Blade. **A filtered green is evidence about the diff, not
about the suite.** Write this into the project's testing docs; left undocumented, someone ships on
a green run that never executed the relevant test.

## 6. Expect latent flakes

A filtered suite runs the same test many times per session, so factory randomness that hid behind
"one roll per run" starts surfacing. Treat a new intermittent failure as expected fallout, not as
evidence the upgrade broke something. Fix it in the **fixture**, not a shared factory used across
dozens of files.

Measure the rate rather than eyeballing one green run — `->repeat(100)` is the built-in tool.
Methodology, and why datasets are *not* a flake fix: `references/flakes.md`.

## 7. Adopt what Pest 5 adds

Refresh bundled agent testing guidance (packaged skills keep describing Pest 4 until
re-installed), consider the new validation expectations, and retire any "never use `describe()`"
rule. Details and the traps in each: `references/pest5-features.md`.

---

| Reference | Read when |
|---|---|
| `references/conversion.md` | Doing step 3 |
| `references/tia-internals.md` | Choosing storage, working in worktrees, or someone proposes committing the graph |
| `references/flakes.md` | A flake surfaces |
| `references/pest5-features.md` | Doing step 7 |
| `references/ci-baseline.md` | Someone asks for CI baseline sharing or `->baselined()` |

Every number here was measured on one real migration. When you hit something uncovered, prefer
reading the installed `vendor/pestphp/pest` source over the published docs — on that migration the

From bravros/bravros, MIT.

More from bravros/bravros

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Aug 22, 2026 (2 months ago)
Last release
Oct 1, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from bravros

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get laravel-pest5-upgrade running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying laravel-pest5-upgrade?

CallGet help
Cite this page

laravel-pest5-upgrade skill. Agent Mart. https://agentmart.dev/skills/bravros-laravel-pest5-upgrade (last updated 2026-10-24)