Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/__tests__/ArcanistPytestTestEngine.php
- This file was copied from src/unit/engine/PytestTestEngine.php.
<?php | <?php | ||||
/** | /** | ||||
* Very basic 'py.test' unit test engine wrapper. | * Very basic 'py.test' unit test engine wrapper. | ||||
* | |||||
* @todo Should be final but isn't because of @{class:PytestTestEngine}. | |||||
*/ | */ | ||||
final class PytestTestEngine extends ArcanistUnitTestEngine { | class ArcanistPytestTestEngine extends ArcanistUnitTestEngine { | ||||
public function run() { | public function run() { | ||||
$working_copy = $this->getWorkingCopy(); | $working_copy = $this->getWorkingCopy(); | ||||
$this->project_root = $working_copy->getProjectRoot(); | $this->project_root = $working_copy->getProjectRoot(); | ||||
$junit_tmp = new TempFile(); | $junit_tmp = new TempFile(); | ||||
$cover_tmp = new TempFile(); | $cover_tmp = new TempFile(); | ||||
$future = $this->buildTestFuture($junit_tmp, $cover_tmp); | $future = $this->buildTestFuture($junit_tmp, $cover_tmp); | ||||
list($err, $stdout, $stderr) = $future->resolve(); | list($err, $stdout, $stderr) = $future->resolve(); | ||||
if (!Filesystem::pathExists($junit_tmp)) { | if (!Filesystem::pathExists($junit_tmp)) { | ||||
throw new CommandException( | throw new CommandException( | ||||
pht('Command failed with error #%s!', $err), | "Command failed with error #{$err}!", | ||||
$future->getCommand(), | $future->getCommand(), | ||||
$err, | $err, | ||||
$stdout, | $stdout, | ||||
$stderr); | $stderr); | ||||
} | } | ||||
$future = new ExecFuture('coverage xml -o %s', $cover_tmp); | $future = new ExecFuture('coverage xml -o %s', $cover_tmp); | ||||
$future->setCWD($this->project_root); | $future->setCWD($this->project_root); | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |