mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
icingacli test php unit: pass through phpunit exit code
so that GHA knows if something failed. (cherry picked from commit 522d041505ecb92ee66395a3d7c647c3926f8e06)
This commit is contained in:
parent
933a9c80d4
commit
60647eb038
@ -80,22 +80,20 @@ class PhpCommand extends Command
|
|||||||
. " -c {$temp->resolvePath('phpunit.xml')}"
|
. " -c {$temp->resolvePath('phpunit.xml')}"
|
||||||
. ' ' . join(' ', array_merge($options, $this->params->getAllStandalone()));
|
. ' ' . join(' ', array_merge($options, $this->params->getAllStandalone()));
|
||||||
|
|
||||||
if ($this->isVerbose) {
|
exec($command, $output, $resultCode);
|
||||||
$res = `$command`;
|
|
||||||
foreach (preg_split('/\n/', $res) as $line) {
|
foreach ($output as $line) {
|
||||||
if (preg_match('~\s+\[([x\s])\]\s~', $line, $m)) {
|
if ($this->isVerbose && preg_match('~\s+\[([x\s])\]\s~', $line, $m)) {
|
||||||
if ($m[1] === 'x') {
|
echo $this->screen->colorize($line, $m[1] === 'x' ? 'green' : 'red');
|
||||||
echo $this->screen->colorize($line, 'green') . "\n";
|
} else {
|
||||||
} else {
|
echo $line;
|
||||||
echo $this->screen->colorize($line, 'red') . "\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo $line . "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
passthru($command);
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$temp = null;
|
||||||
|
exit($resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user