From 8c849c5f406223974fed66dc7e0dbbbd2a0cc062 Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Mon, 20 Apr 2026 12:18:32 -0700 Subject: [PATCH] fix: missing warning --- src/Plugins/Tia.php | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index a6726f0d..388553e8 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -654,6 +654,20 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable */ private function enterRecordMode(string $projectRoot, array $arguments): array { + $recorder = $this->recorder; + + if (! $recorder->driverAvailable()) { + // Both series and parallel record require the coverage driver. + // Parallel also requires it because workers inherit the parent's + // PHP config — if the parent lacks the driver, workers will too + // and would silently produce no graph. Warn once, up-front, and + // continue running the suite without TIA so the user still gets + // their test results. + $this->emitCoverageDriverMissing(); + + return $arguments; + } + if (Parallel::isEnabled()) { // Parent driving `--parallel`: workers will do the actual // recording. We only advertise the intent through a global. @@ -671,21 +685,6 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable return $arguments; } - $recorder = $this->recorder; - - if (! $recorder->driverAvailable()) { - $this->output->writeln([ - '', - ' ERROR No coverage driver is available.', - '', - ' TIA requires ext-pcov or Xdebug with coverage mode enabled to', - ' record the dependency graph. Install one and rerun with `--tia`.', - '', - ]); - - exit(1); - } - $recorder->activate(); $this->output->writeln(sprintf( @@ -697,6 +696,18 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable return $arguments; } + private function emitCoverageDriverMissing(): void + { + $this->output->writeln([ + '', + ' WARNING No coverage driver is available — TIA skipped.', + '', + ' TIA needs ext-pcov or Xdebug with coverage mode enabled to record', + ' the dependency graph. Install or enable one and rerun with `--tia`.', + '', + ]); + } + /** * @param array> $perTest */