From: David Cramer Date: Mon, 17 Nov 2014 23:25:48 +0000 (-0800) Subject: Report tests results whenever possible X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6a36584ae1d6d1d59aa7886b972d3efe215b886c;p=arcanist.git Report tests results whenever possible Summary: This adjusts the behavior of PytestTestEngine so that it correctly reports test failures natively, rather than throwing a command error. Test Plan: Yeah right Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D10866 --- diff --git a/src/unit/engine/PytestTestEngine.php b/src/unit/engine/PytestTestEngine.php index b104d8fc..8d3891b9 100644 --- a/src/unit/engine/PytestTestEngine.php +++ b/src/unit/engine/PytestTestEngine.php @@ -13,7 +13,16 @@ final class PytestTestEngine extends ArcanistUnitTestEngine { $cover_tmp = new TempFile(); $future = $this->buildTestFuture($junit_tmp, $cover_tmp); - $future->resolvex(); + list($err, $stdout, $stderr) = $future->resolve(); + + if (!Filesystem::pathExists($junit_tmp)) { + throw new CommandException( + "Command failed with error #{$err}!", + $future->getCommand(), + $err, + $stdout, + $stderr); + } $future = new ExecFuture('coverage xml -o %s', $cover_tmp); $future->setCWD($this->project_root);