Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/Plugins/Parallel.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ private function runTestSuiteInParallel(array $arguments): int
$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);
}
Expand Down Expand Up @@ -197,4 +199,18 @@ private function runTestSuiteInSeries(array $arguments): array

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;
}
}
7 changes: 3 additions & 4 deletions src/Plugins/Parallel/Paratest/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ public function flush(): void {}
$this->teamcityLogFileHandle = $teamcityLogFileHandle;
}

/** @param list<SplFileInfo> $teamcityFiles */
public function printFeedback(
SplFileInfo $progressFile,
SplFileInfo $outputFile,
array $teamcityFiles
?SplFileInfo $teamcityFile,
): void {
if ($this->options->needsTeamcity) {
$teamcityProgress = $this->tailMultiple($teamcityFiles);
if ($this->options->needsTeamcity && $teamcityFile instanceof SplFileInfo) {
$teamcityProgress = $this->tailMultiple([$teamcityFile]);

if ($this->teamcityLogFileHandle !== null) {
fwrite($this->teamcityLogFileHandle, $teamcityProgress);
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Parallel/Paratest/WrapperRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private function flushWorker(WrapperWorker $worker): void
$this->printer->printFeedback(
$worker->progressFile,
$worker->unexpectedOutputFile,
$this->teamcityFiles,
$worker->teamcityFile ?? null,
);
$worker->reset();
}
Expand Down
Loading