]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Report tests results whenever possible
authorDavid Cramer <cramer@dropbox.com>
Mon, 17 Nov 2014 23:25:48 +0000 (15:25 -0800)
committerepriestley <git@epriestley.com>
Mon, 17 Nov 2014 23:25:48 +0000 (15:25 -0800)
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

index b104d8fc17962e09c4dccfee50cb092d598e2ed2..8d3891b9f254d57290fb7702221449844ca3c498 100644 (file)
@@ -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);