From 6a36584ae1d6d1d59aa7886b972d3efe215b886c Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 17 Nov 2014 15:25:48 -0800 Subject: [PATCH] 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 --- src/unit/engine/PytestTestEngine.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 2.43.0