mirror of
https://github.com/pestphp/pest.git
synced 2026-04-21 22:47:27 +02:00
fix: enhance support for --parallel and --teamcity arguments by restoring --teamcity for ParaTest and fixing teamcity output concurrency
This commit is contained in:
@ -127,7 +127,9 @@ final class Parallel implements HandlesArguments
|
|||||||
$arguments
|
$arguments
|
||||||
);
|
);
|
||||||
|
|
||||||
$exitCode = $this->paratestCommand()->run(new ArgvInput($filteredArguments), new CleanConsoleOutput);
|
$filteredArguments = $this->processTeamcityArguments($filteredArguments);
|
||||||
|
|
||||||
|
$exitCode = $this->paratestCommand()->run(new ArgvInput(array_values($filteredArguments)), new CleanConsoleOutput);
|
||||||
|
|
||||||
return CallsAddsOutput::execute($exitCode);
|
return CallsAddsOutput::execute($exitCode);
|
||||||
}
|
}
|
||||||
@ -197,4 +199,18 @@ final class Parallel implements HandlesArguments
|
|||||||
|
|
||||||
return $this->popArgument('-p', $arguments);
|
return $this->popArgument('-p', $arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $arguments
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function processTeamcityArguments(array $arguments): array
|
||||||
|
{
|
||||||
|
$argv = new ArgvInput;
|
||||||
|
if ($argv->hasParameterOption('--teamcity')) {
|
||||||
|
$arguments[] = '--teamcity';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arguments;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,14 +92,13 @@ final class ResultPrinter
|
|||||||
$this->teamcityLogFileHandle = $teamcityLogFileHandle;
|
$this->teamcityLogFileHandle = $teamcityLogFileHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param list<SplFileInfo> $teamcityFiles */
|
|
||||||
public function printFeedback(
|
public function printFeedback(
|
||||||
SplFileInfo $progressFile,
|
SplFileInfo $progressFile,
|
||||||
SplFileInfo $outputFile,
|
SplFileInfo $outputFile,
|
||||||
array $teamcityFiles
|
?SplFileInfo $teamcityFile,
|
||||||
): void {
|
): void {
|
||||||
if ($this->options->needsTeamcity) {
|
if ($this->options->needsTeamcity && $teamcityFile instanceof SplFileInfo) {
|
||||||
$teamcityProgress = $this->tailMultiple($teamcityFiles);
|
$teamcityProgress = $this->tailMultiple([$teamcityFile]);
|
||||||
|
|
||||||
if ($this->teamcityLogFileHandle !== null) {
|
if ($this->teamcityLogFileHandle !== null) {
|
||||||
fwrite($this->teamcityLogFileHandle, $teamcityProgress);
|
fwrite($this->teamcityLogFileHandle, $teamcityProgress);
|
||||||
|
|||||||
@ -225,7 +225,7 @@ final class WrapperRunner implements RunnerInterface
|
|||||||
$this->printer->printFeedback(
|
$this->printer->printFeedback(
|
||||||
$worker->progressFile,
|
$worker->progressFile,
|
||||||
$worker->unexpectedOutputFile,
|
$worker->unexpectedOutputFile,
|
||||||
$this->teamcityFiles,
|
$worker->teamcityFile ?? null,
|
||||||
);
|
);
|
||||||
$worker->reset();
|
$worker->reset();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user