Commit Graph

1867 Commits

Author SHA1 Message Date
Daniel Polito 89cdbd5bc9 Support --profile when running tests in parallel (#1795)
* feat: support profiling parallel tests

* test: preserve success snapshot totals

* test: preserve visual suite snapshot

* fix: stabilize checks on pull requests

* fix: align TIA fixture branch resolution

* chore: keep parallel profile changes scoped

* fix: align TIA fixture branch resolution

* Revert unrelated TIA branch fallback change

---------

Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-14 21:33:34 +05:30
Tiago Santos a6b81dbd73 fix: check each target in negated toUse (#1933)
* fix: check each target in negated toUse

A skipped class in expect([...]) made the positive rule fail,
so the negation passed even when another class used the dependency.

Fixes #1751

* test: update snapshots for notToUse

Negated toUse coverage adds 6 tests and 24 assertions,
so the success snapshot and parallel totals were stale.

---------

Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-14 16:13:29 +05:30
Sonali dudhia 9aed110ba0 fix: run pest()->afterAll() hooks by flushing statics after tearDownAfterClass() (#1753)
* fix: run `pest()->afterAll()` hooks by flushing statics after `tearDownAfterClass()`

Fixes #1694

Testable::tearDown()'s finally block flushed the afterAll static after
every test via TestCaseMethodFactory::tearDown(), so by the time PHPUnit
called tearDownAfterClass() (which runs after the last test's tearDown())
the hook had already been nulled out. The per-test flush was redundant:
TestCaseMethodFactory::setUp() already flushes statics before re-applying
proxies for the next test. Move the flush into tearDownAfterClass()'s
finally block instead, so it happens after the hook actually runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test: assert `afterAll` hooks run via isolated fixture suite

Runs a fixture suite in a subprocess and asserts both the
`pest()->afterAll()` and file-level `afterAll()` hooks ran once,
in order. Fails on unpatched 5.x (only `afterAll` is recorded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style: remove comment from afterAll hook test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix afterAll test style and refresh snapshots

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-14 15:13:25 +05:30
Caleb White 207a542547 fix(tia): find GitLab baselines beyond the last 100 jobs (#1912)
The GitLab baseline lookup listed the project's 100 most recent
successful jobs and filtered them client-side by name and ref. GitLab's
jobs endpoint has no server-side ref or name filter, so that single page
is the entire search space -- and on a busy project it covers very little
wall-clock time. On a self-hosted instance the window measured 82
minutes, while baselines were published roughly once a day. The lookup
therefore returned null almost always, and every developer silently fell
back to recording a local baseline.

Query pipelines instead, which does filter by ref and status server-side,
then walk the default branch's successful pipelines newest-first until
one contains a successful job with the configured name.

This also aligns the lookup with what the download actually resolves.
`glab job artifact <ref> <job>` reads from the latest successful
*pipeline* for the ref, so a successful job inside a failed pipeline was
never downloadable even when the old lookup returned it.
2026-11-13 21:31:45 +05:30
Ademola Emmanuel 65796f4939 Fix TIA fingerprinting inside linked git worktrees (#1813)
* fix(tia): fingerprint structural files inside linked git worktrees

* Update fingerprint regression snapshots

---------

Co-authored-by: Ademola Emmanuel <19527203+ademola-emmanuel@users.noreply.github.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-13 21:06:01 +05:30
Mohannad Elemary 98e96a8f5c fix(tia): report git errors instead of a missing dependency (#1987)
* fix(tia): show git's error instead of asking to install git when it fails

* fix(tia): detect a missing git binary with ExecutableFinder

Only report MissingDependency when git can't be found on PATH or there
is no repository. Any other failure shows git's error output, or the
exit code when git printed nothing.

---------

Co-authored-by: Mohannad Elemary <20709195+MohannadElemary@users.noreply.github.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-13 20:43:41 +05:30
Cy(rod) John 1fbd63dbb3 fix(tia): detect renames in both porcelain status columns (#2017)
* fix(tia): detect renames in both porcelain status columns

git status --porcelain emits worktree renames as " R new\0old". The parser only checked the first status column, so the paired source path was read as a standalone record and truncated by substr(3). The broken path then made git check-ignore exit 128, which surfaced as MissingDependency("Tia mode", "git").

* Fix worktree rename test style

---------

Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-13 20:18:16 +05:30
Mikko 8e3f467d8a fix(sharding): strip --runner from the --list-tests sub-process (#2004)
* 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>
2026-11-13 19:36:20 +05:30
Lazizbek Ergashev 4765bdb8d0 fix(tia): list the whole suite with --list-tests (#1973)
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-13 18:21:51 +05:30
Lazizbek Ergashev cf20587575 fix: support brianium/paratest 7.28 grouped test files (#2025) 2026-11-13 18:03:05 +05:30
nuno maduro e3c59e00d0 chore: fix types 2026-11-05 18:15:45 +00:00
Vincent Borgers e107ac707c Add default failure messages to the remaining string expectations (#1948)
* Add default failure messages to the remaining string expectations

* test: update parallel snapshot count for the new default-message cases

---------

Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-03 22:12:45 +05:30
Adil Khan b3baf7e210 fix: accept --no-results and the --do-not-* test run history options with --parallel (#1982)
* fix: accept `--no-results` and the `--do-not-*` test run history options with `--parallel`

* Update success snapshot count

---------

Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-03 21:41:05 +05:30
ChrisAbner 9a77ff6b96 fix: let extensions register event subscribers in --parallel mode (#2002)
Co-authored-by: Aleksandr Štšepelin <as@jp.ee>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-03 21:21:33 +05:30
Mozex e5906a50cf fix(tia): match test files under wildcard suite directories (#1980)
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-03 20:38:16 +05:30
Tiago Santos 09a36c97f3 fix(tia): drop the coverage cache on structural drift (#1996)
* fix(tia): drop the coverage cache on structural drift

A coverage run cannot rebuild the graph, so a composer.lock change left the previous coverage.bin.gz in place and the next merge failed.

* style(tests): satisfy rector dry-run

* style: remove the source comment

Repository instructions prohibit source comments.

---------

Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
2026-11-03 20:34:22 +05:30
Tiago Santos 960756e594 fix(tia): write the merged coverage report in chunks (#1997)
* 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>
2026-11-03 20:09:40 +05:30
Tiago Santos 58570721c7 fix(tia): drop cached coverage of tests that no longer exist (#2000)
* 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>
2026-11-03 19:32:39 +05:30
Lazizbek Ergashev 0224b4238b fix(tia): drop the results of every branch on environment drift (#2011)
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-03 18:39:26 +05:30
Lazizbek Ergashev ceef9806c2 fix(tia): keep pcov.enabled when the pcov restarter re-runs pest (#2015)
* 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>
2026-11-03 18:26:37 +05:30
Lazizbek Ergashev c6761c4bc1 fix(tia): keep a failure when the same test is also risky (#2014) 2026-11-03 18:16:08 +05:30
Tiago Santos 8eb2892f69 fix(tia): skip locally() when the process is on CI (#1999)
* 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>
2026-11-02 17:26:12 +05:30
Tiago Santos e7a1b483f0 fix(tia): drop coverage lines the current file no longer has (#2001)
* 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>
2026-11-01 01:07:56 +05:30
Jhon Farias f66a8e9e93 fix: skip the frames of Pest by its own directory, not by the name of the checkout (#1913)
`Backtrace::backtrace()` skipped a frame when its path held `pest/src`, so
a checkout of this repository in a directory with any other name, such as
`pest5`, returned `src/Support/Backtrace.php` as the file of the caller and
`tests/Unit/Support/Backtrace.php` failed. The frame check now compares
against the directory that holds this file, which is the same directory
whether Pest runs from its own checkout or from `vendor/pestphp/pest`, and
the global that marked the internal test suite has no reader left.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
2026-11-01 00:10:56 +05:30
nuno maduro 4cfe8ecc42 release: 5.3.5 2026-10-31 15:13:09 +00:00
Manuk 3b51856354 fix(tia): stop a replay when the baseline commit cannot be reached (#1951)
A fetched baseline can be recorded at a commit that the local clone does not have, or that the current branch does not contain. The changed files cannot be listed then, and the replay treated the changed set as empty: every test was replayed as passed.

Stop with an error that names the commit and says how to recover.
2026-10-31 14:47:26 +00:00
Lazizbek Ergashev 228c627b64 fix(tia): record new dependencies of known tests on coverage runs (#1955)
* fix(tia): record new dependencies of known tests on coverage runs

* chore(tia): drop the keepExisting docblock line
2026-10-31 14:47:06 +00:00
cyppe 85d24777b5 fix(tia): let JS modules no Inertia page imports fall back to the watch patterns (#1936) 2026-10-31 14:46:43 +00:00
Augusto Soto 52ee93b3c4 fix(tia): use jq equality in GitHub artifact size lookup (#1930)
`GitHubRemote::artifactSize()` passes `select(.name === "…")` to
`gh api --jq`. jq has no `===` operator: gh's embedded jq rejects the
filter ("unexpected token"), so the lookup always fails and the baseline
download never shows its size.

The filter used `==` while it lived in `BaselineSync`, which the strict
arch preset ignores. #1841 moved it into `GitHubRemote`, where the preset
flags the `==` inside the jq string. Restore `==` and ignore
`GitHubRemote` in the strict preset, as `BaselineSync` already is.
2026-10-31 14:46:21 +00:00
Alexandru Punga a9d66a0ebe Update docblock for toThrow method parameters to satisfy the actual pest's behaviour (#2008)
Signed-off-by: Alexandru Punga <45293316+Sanchous98@users.noreply.github.com>
2026-10-31 14:45:57 +00:00
cyppe 7cff286ac8 fix(tia): do not stamp a commit that lands during the run as the baseline (#1925)
Co-authored-by: nunomaduro <enunomaduro@gmail.com>
2026-10-31 14:07:10 +00:00
nuno maduro 159514bace release: 5.3.4 2026-10-27 11:04:36 +00:00
cyppe 415419a251 fix(tia): preserve numeric table dependencies across graph round trips (#1990)
Co-authored-by: nuno maduro <enunomaduro@gmail.com>
2026-10-27 10:39:18 +00:00
Tiago Santos 7abf68e706 fix: allow --init without a tests directory (#1939)
* fix: allow --init without a tests directory

Boot aborted before TIA state was registered, and shutdown then
tried to construct the plugin. That hid the real error behind
"State cannot be resolved" on a fresh install.

Closes #1934

* fix: detect --init anywhere in the arguments

Flags before --init were still treated as a normal run and failed when tests/ did not exist.

* fix: drop duplicate Kernel::$booted and share --init check

5.3.1 already gates plugin termination on boot, so the rebase must
not declare $booted again. --init and --init=value now share
HandleArguments::hasArgument, and the success snapshot includes
the new init tests.

* test: fix init suite expectations

Parallel total omitted the four --init tests, which
failed the success snapshot. Rector requires toBeFile().

---------

Co-authored-by: Tiago Santos <tsantos@lynixt.pt>
2026-10-26 16:21:56 +05:30
Owen Voke d534cb2c40 fix: avoid passing an object when invoking static methods via reflection (#1988)
* 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
2026-10-23 22:05:56 +05:30
Gustavo Meireles 1b3ca5ba41 feat: restore coversNothing() (#1981) 2026-10-18 21:53:51 +01:00
nuno maduro c947def97e release: 5.3.3 2026-10-18 12:51:10 +01:00
nuno maduro 3e5a2410b7 fix: phpunit classes not being inlcuded on sharding 2026-10-18 12:28:03 +01:00
Pushpak Chhajed e9fa0f50c5 perf: O(1) test method lookup 2026-10-16 22:20:38 +05:30
Pushpak Chhajed b6dddcc821 perf: stop spawning stty for every test when output is not a TTY 2026-10-16 22:20:30 +05:30
Muhammed Alkhudiry 3a5a14b6a6 fix: reduce parallel worker polling interval to 1 ms (#1967)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:19:33 +05:30
nuno maduro 73fe04f8c3 fix: support with paratest 2026-10-12 21:28:57 +04:00
Punyapal Shah 5b98dc7df2 fix(sharding): prevent shard filters from matching classes outside their partition (#1884)
* fix(sharding): prevent shard filters from matching classes outside their partition

* lint

* test: update snapshots for the shard filter boundary cases
2026-10-12 00:09:04 +05:30
Morten Harders 5f3d0f2124 fix: support brianium/paratest 7.26.1 worker tmp dir (#1959)
paratest 7.26.1 added a required $tmpDir argument to WrapperWorker and
keeps worker files in a private per-run directory. Create that 0700
directory per run, pass it to each worker and remove it on completion.
Require paratest ^7.26.1.
2026-10-11 22:42:40 +05:30
nuno maduro 9714c8553f release: 5.3.1 2026-10-07 23:02:36 +04:00
nuno maduro 14a3efd918 release: 5.3.0 2026-10-01 17:58:48 +01:00
Daniel Polito 8b6607e344 fix(tia): reuse baselines across replacement CI merge commits (#1923)
* perf(tia): reuse baselines across replacement CI merge commits

* style: apply Rector rules to merge baseline validation
2026-09-18 14:30:59 +05:30
nunomaduro 94f4f1ff48 release: 5.2.1 2026-09-17 12:41:10 +01:00
Sergio Peris 4b4474dd77 Regression: Command gh not found on Windows - #1895 (#1922)
* fixes regression

* Update BaseRemote.php

Signed-off-by: Sergio Peris <22801379+sertxudev@users.noreply.github.com>

---------

Signed-off-by: Sergio Peris <22801379+sertxudev@users.noreply.github.com>
2026-09-17 11:49:34 +01:00
nuno maduro 942d6aead1 chore: ci fixes 2026-09-14 15:41:18 +01:00