Skip to content

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

Description

@studioycm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions