Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/PhpunitTestEngine.php
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | foreach ($this->affectedTests as $class_path => $test_path) { | ||||
$this->phpunitBinary, $config, $stderr, $json_tmp, $clover, $test_path); | $this->phpunitBinary, $config, $stderr, $json_tmp, $clover, $test_path); | ||||
$tmpfiles[$test_path] = array( | $tmpfiles[$test_path] = array( | ||||
'json' => $json_tmp, | 'json' => $json_tmp, | ||||
'clover' => $clover_tmp, | 'clover' => $clover_tmp, | ||||
); | ); | ||||
} | } | ||||
$results = array(); | $results = array(); | ||||
$futures = id(new FutureIterator($futures)) | $futures = (new FutureIterator($futures)) | ||||
->limit(4); | ->limit(4); | ||||
foreach ($futures as $test => $future) { | foreach ($futures as $test => $future) { | ||||
list($err, $stdout, $stderr) = $future->resolve(); | list($err, $stdout, $stderr) = $future->resolve(); | ||||
$results[] = $this->parseTestResults( | $results[] = $this->parseTestResults( | ||||
$test, | $test, | ||||
$tmpfiles[$test]['json'], | $tmpfiles[$test]['json'], | ||||
Show All 11 Lines | final class PhpunitTestEngine extends ArcanistUnitTestEngine { | ||||
* @param string $json_tmp Path to phpunit json report | * @param string $json_tmp Path to phpunit json report | ||||
* @param string $clover_tmp Path to phpunit clover report | * @param string $clover_tmp Path to phpunit clover report | ||||
* @param string $stderr Data written to stderr | * @param string $stderr Data written to stderr | ||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
private function parseTestResults($path, $json_tmp, $clover_tmp, $stderr) { | private function parseTestResults($path, $json_tmp, $clover_tmp, $stderr) { | ||||
$test_results = Filesystem::readFile($json_tmp); | $test_results = Filesystem::readFile($json_tmp); | ||||
return id(new ArcanistPhpunitTestResultParser()) | return (new ArcanistPhpunitTestResultParser()) | ||||
->setEnableCoverage($this->getEnableCoverage()) | ->setEnableCoverage($this->getEnableCoverage()) | ||||
->setProjectRoot($this->projectRoot) | ->setProjectRoot($this->projectRoot) | ||||
->setCoverageFile($clover_tmp) | ->setCoverageFile($clover_tmp) | ||||
->setAffectedTests($this->affectedTests) | ->setAffectedTests($this->affectedTests) | ||||
->setStderr($stderr) | ->setStderr($stderr) | ||||
->parseTestResults($path, $test_results); | ->parseTestResults($path, $test_results); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0