Skip to content

TIA: the fingerprint ignores the config actually in use (-c / --configuration) #1858

Description

@studioycm

Fingerprint::compute() hashes hardcoded paths:

// src/Plugins/Tia/Fingerprint.php:36-37
'phpunit_xml'      => self::trackedHash($projectRoot, 'phpunit.xml'),
'phpunit_xml_dist' => self::trackedHash($projectRoot, 'phpunit.xml.dist'),

Nothing consults the -c / --configuration path in use. configuration, argv, PHPUNIT_ and getopt each appear 0 times in that file.

Effect: pest --tia and pest --tia -c alternate.xml share one graph, although the two configs can declare different testsuites, different excluded groups, different bootstrap and different source roots. Switching config does not invalidate the graph.

Second gap, same helper: trackedHash() returns null for anything not tracked by git (:255-262, isTrackedByGit() at :264), so an untracked local phpunit.xml gets no fingerprint coverage at all.

Fix: hash the resolved active config path, and hash it whether or not it is tracked.

v5.1.0.

Related, same root cause — the fingerprint's input set being incomplete: #1856 (git HEAD not covered) and #1857 (php_minor holds the major version). Three independent gaps found in one sitting, which may argue for widening the input set rather than patching the fields.

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