1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Add $projectRoot to PytestTestEngine

Summary:
Fixes T8912. Property `$project_root` was missing in `PytestTestEngine` class, resulting in
broken py.test wrapper. Also renaming the property so the linter is happy.

Test Plan: `arc unit --everything`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: kparal, epriestley, Korvin

Maniphest Tasks: T8912

Differential Revision: https://secure.phabricator.com/D13698
This commit is contained in:
Lukas Sparrow 2015-07-24 05:11:32 -07:00 committed by epriestley
parent bd1da9da6c
commit 5fcf7b5a3b

View file

@ -5,9 +5,11 @@
*/ */
final class PytestTestEngine extends ArcanistUnitTestEngine { final class PytestTestEngine extends ArcanistUnitTestEngine {
private $projectRoot;
public function run() { public function run() {
$working_copy = $this->getWorkingCopy(); $working_copy = $this->getWorkingCopy();
$this->project_root = $working_copy->getProjectRoot(); $this->projectRoot = $working_copy->getProjectRoot();
$junit_tmp = new TempFile(); $junit_tmp = new TempFile();
$cover_tmp = new TempFile(); $cover_tmp = new TempFile();
@ -25,7 +27,7 @@ final class PytestTestEngine extends ArcanistUnitTestEngine {
} }
$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->projectRoot);
$future->resolvex(); $future->resolvex();
return $this->parseTestResults($junit_tmp, $cover_tmp); return $this->parseTestResults($junit_tmp, $cover_tmp);
@ -39,7 +41,7 @@ final class PytestTestEngine extends ArcanistUnitTestEngine {
if ($this->getEnableCoverage() !== false) { if ($this->getEnableCoverage() !== false) {
$cmd_line = csprintf( $cmd_line = csprintf(
'coverage run --source %s -m %C', 'coverage run --source %s -m %C',
$this->project_root, $this->projectRoot,
$cmd_line); $cmd_line);
} }