* fix(tia): support a Pest project nested in a git repository
Tia refused to run whenever the Pest project was not the git repository
root, because git prints and addresses paths relative to the repository
root while the dependency graph is keyed on project-relative paths.
Translate at every git boundary instead of guarding against the mismatch.
`Git::pathPrefix()` resolves the directory of the project inside the
repository, and `ChangedFiles` strips that prefix off the paths git prints,
drops the paths of sibling packages, and prepends it to `git show`. Both
diffs read `-z` records, because `core.quotePath` C-quotes a path outside
ASCII, and `--no-relative` holds the frame when a user sets `diff.relative`.
Three places read `<projectRoot>/.git` directly, which is absent in a
nested project and in a worktree, and now ask git: `BaseRemote`, `Storage`
and `Fingerprint::isTrackedByGit()`. `Storage` folds the prefix into the
state key so two projects in one repository do not share a graph, and the
fingerprint carries the prefix so a baseline published by a sibling project
is rejected. A project at the repository root keeps the key and the
fingerprint it had.
`git check-ignore` runs without `--no-index`, so a tracked file that an
ignore rule matches counts as part of the project on both sides of the
boundary.
Changes outside the project are dropped and reported by count in the run
summary, so a nested project does not look idle when the repository around
it moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(tia): keep whitespace at the edge of the paths git returns
* fix(tia): run the full suite when a PHP file outside a nested project changes
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): free the ReadCapture wrapper each time it steps aside
stream_wrapper_restore() takes a user wrapper out of the wrapper table
but does not free it, so every filesystem call made while a test records
kept one until the process ended. Unregistering it first frees it.
* fix(tia): skip the unregister when file:// is already gone
A test can unregister file:// itself. stream_wrapper_unregister() then
warns, where stream_wrapper_restore() alone did not, so check first.
Also run the per-test memory check over 5,000 tests and update the
snapshot and parallel totals for the new tests.
* Use fopen() in the memory regression test
---------
Co-authored-by: Mohannad Elemary <20709195+MohannadElemary@users.noreply.github.com>
* feat: let a shard unit bundle several test classes
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix: own unknown shard units in every shard and clean up worker timings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix: drop removed test classes from shard units and consume coverage option values
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix: preserve empty shard units and consume more option values in discovery
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* Stat once in ReadCapture url_stat
* Keep quiet url_stat probes away from error handlers
---------
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): fingerprint the configuration file the run uses
* fix(tia): tell --no-configuration and identical copies of the configuration apart
* test(tia): cover the gitignore check with composer.lock, as the active configuration is fingerprinted tracked or not
* fix(tia): parse SFC entries when building the JS module graph
rolldown has no SFC handling, so every .vue/.svelte page failed to parse at the
first byte of <script> and the JS graph came back empty. Reduce the component to
its script blocks before rolldown sees it, which is enough for import specifiers.
Closes#1918
* fix(tia): keep template-only TS imports and stub CSS as JS
TypeScript elision dropped imports used only in a <template>, so lang="ts" pages lost those edges. Newer rolldown also rejects asset stubs without an explicit moduleType, failing the build on any CSS import.
* fix(tia): ignore comments when detecting default export
* Refresh SFC module graph regression snapshots
---------
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
* feat(tia): make default watch fallbacks configurable
* test(tia): cover driverless fallback and update suite snapshots
* fix: align help types and coverage guards with PHPStan
---------
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): link files a test reads as text, not only files it executes
* fix(tia): report dangling symlinks as links while reads are captured
`is_link()` stats with STREAM_URL_STAT_LINK | STREAM_URL_STAT_QUIET.
The `file_exists()` precheck in `ReadCapture::url_stat()` follows the
link, so a dangling symlink returned false before reaching `lstat()`,
and `is_link()` reported false while a test recorded.
Handle STREAM_URL_STAT_LINK first and always answer it through
`lstat()`. A quiet stat of a path that is neither a link nor a file
still returns false without a warning.
The regression test covers a link to an existing file and a dangling
link.
* test(tia): skip the read-capture feature tests without a coverage driver
The fixture runs record a graph from coverage, so with CI's
`coverage: none` all five cases failed. Skip them when
`Coverage::isAvailable()` is false, as CoveragePiggyback does.
* chore: style
* Refresh read capture test snapshots
---------
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(sharding): strip `--runner` from the `--list-tests` sub-process
* fix(sharding): strip a space-separated `--runner` value too
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test: count the two new shard tests in the visual suite totals
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Apa <mikko@apaiko.fi>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(tia): write the merged coverage report in chunks
var_export() of the serialized coverage held a second escaped copy of the payload and exhausted memory after a large suite.
* test: count the chunked coverage report in visual snapshots
The two CoverageReport tests add two passes and four assertions to the suite totals.
* test: separate coverage report files in the success snapshot
Pest prints a blank line between files, so the snapshot was not a substring of the suite output.
---------
Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): drop cached coverage of tests that no longer exist
A deleted or renamed test never runs again, so its hits stayed in
coverage.bin.gz and --min passed on a real coverage drop.
Fixes#1957
* Update deleted coverage success snapshot
---------
Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): keep pcov.enabled when the pcov restarter re-runs pest
* test: cover pcov.enabled in the pcov restarter command
---------
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): skip locally() when the process is on CI
locally() only looked at --ci, so a CI job that followed the docs and
ran plain pest replayed cached results.
Fixes#1970
* test(tia): clear CI variables so the local assertion passes on CI
* test: update snapshots for TIA CI detection
---------
Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix(tia): drop coverage lines the current file no longer has
An edited file left the previous line numbers in the cache as uncovered,
and a revert did not remove them.
Fixes#1954
* test: update snapshots for skipped stale coverage regression
---------
Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* test(shard): cover module test classes outside the tests directory
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore: refresh the snapshot counts
---------
Co-authored-by: Paul Sochiera <paul.sochiera@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
* fix: avoid passing an object when invoking static methods via reflection
PHP 8.6 deprecates passing an object to `ReflectionMethod::invoke()` for
static methods, which breaks higher-order assertions such as
`it('...')->assertTrue(true)` since `Assert::assertTrue()` is static.
* test: update visual snapshots for new reflection tests
* fix: key Tia worker partials per process to survive batch recycling
* test(tia): refresh visual snapshots for the worker token test
---------
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
* feat: allow configuring the TIA directory
* refactor: simplify TIA directory resolution
* fix: bootstrap TIA state after configuration
* chore: apply Rector to TIA storage test
* fix: stabilize checks on pull requests
* fix: align TIA fixture branch resolution
* fix: preserve success snapshot formatting
* fix: order TIA storage snapshot
* chore: keep TIA directory changes scoped
PHP coerces numeric-string array keys to ints, so collecting table names in
$tables[$name] and returning array_keys() can yield ints. That breaks the
declared list<string> and throws a TypeError in Recorder::linkTable(string).
Standard SQL like substring(x FROM 1 FOR 10) is enough to trigger it, since
the numeric operand matches the FROM pattern.
Closes#1793
Co-authored-by: Danny de Wit <d.dewit@fenceweb.com>
The result cache was keyed `Class::method` on both sides, so every row of a
`->with()` test shared one entry and the last writer won. On replay that single
status was handed to every row.
`TestMethod::id()` already appends `#dataSetName`, and `TestCase` reaches the
same value object through `valueObjectForEvents()`, so both sides can use it.
- keep table/Inertia/database link-tracking alive in piggyback-coverage
recording, and merge link-only edges into the piggybacked edge set
- route migration changes through the watch-pattern fallback when the
graph has no recorded table usage
- re-run cached failures whose test file cannot be located, downgrading
filtered runs to full replay instead of silently skipping them
- align non-filtered replay with the failOn*/displayDetailsOn* rerun policy
- resolve anonymous index Blade components (<x-card> from card/index.blade.php)
and stop swallowing components whose static usage walk selected no tests
- parse CTE/REPLACE queries and schema-qualified identifiers in TableExtractor
- scope-filter the xdebug recording path like pcov
- ignore in-flight .tmp files in FileState::keysWithPrefix and delete
unreadable worker partials
- vite deps helper: resolve rolldown through rolldown-vite installs and
degrade gracefully, honour vite.config resolve.alias (incl. the
laravel-vite-plugin '@' default), resolve .vue/.svelte/.mts/.cts
extensions, and stop memoizing cycle-tainted transitive sets
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>