pestphp / pestphp/pest

TIA: runs without --tia write to the machine-global TIA state

Open Beginner friendly
#1,859 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

addOutput() (src/Plugins/Tia.php:661) has no check for whether TIA is enabled. Its only write-suppressor is $writesSuppressed, which is set for mutation-testing runs only:

// src/Plugins/Tia.php:491-493
if (getenv(self::ENV_MUTATION_TESTING) !== false) {
    $this->writesSuppressed = true;
}

So a plain pest run — no --tia — reaches snapshotTestResults() at :692 and writes into ~/.pest/tia/<key>/.

Observed: a plain non-TIA run wrote 2,025 → 2,027 results into machine-global TIA state, in a run that never requested TIA.

Effects: state accumulates for users who never opted in, and a run cannot be told from its own behaviour whether it is contributing to TIA's state.

Fix: return early from addOutput() when TIA was not requested.

v5.1.0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Plugins/Tia.php at addOutput() around line 661, then read how TIA request state is tracked before snapshotTestResults() at line 692. Add the requested-state guard described in the issue and verify that a plain pest run does not write to ~/.pest/tia// while TIA runs still record results.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.