Page MenuHomePhabricator

D7848.id17757.diff
No OneTemporary

D7848.id17757.diff

Index: src/unit/engine/PhpunitResultParser.php
===================================================================
--- src/unit/engine/PhpunitResultParser.php
+++ src/unit/engine/PhpunitResultParser.php
@@ -32,9 +32,18 @@
}
$results = array();
+ $finished = array();
foreach ($report as $event) {
- if ('test' != $event->event) {
- continue;
+ switch ($event->event) {
+ case 'test':
+ break;
+ case 'testStart':
+ if (!isset($finished[$event->test])) {
+ $finished[$event->test] = false;
+ }
+ // fall through
+ default:
+ continue 2; // switch + loop
}
$status = ArcanistUnitTestResult::RESULT_PASS;
@@ -72,8 +81,14 @@
$result->setUserData($user_data);
$results[] = $result;
+ $finished[$event->test] = true;
}
+ foreach ($finished as $name => $didFinish) {
+ if (!$didFinish) {
+ throw new Exception("Test $name did not finish");
+ }
+ }
return $results;
}
Index: src/unit/engine/PhpunitTestEngine.php
===================================================================
--- src/unit/engine/PhpunitTestEngine.php
+++ src/unit/engine/PhpunitTestEngine.php
@@ -71,8 +71,10 @@
$config = $this->configFile ? csprintf('-c %s', $this->configFile) : null;
- $futures[$test_path] = new ExecFuture('%C %C --log-json %s %C %s',
- $this->phpunitBinary, $config, $json_tmp, $clover, $test_path);
+ $stderr = "-d display_errors=stderr";
+
+ $futures[$test_path] = new ExecFuture('%C %C %C --log-json %s %C %s',
+ $this->phpunitBinary, $config, $stderr, $json_tmp, $clover, $test_path);
$tmpfiles[$test_path] = array(
'json' => $json_tmp,
'clover' => $clover_tmp,
@@ -86,10 +88,18 @@
list($err, $stdout, $stderr) = $future->resolve();
- $results[] = $this->parseTestResults(
- $test,
- $tmpfiles[$test]['json'],
- $tmpfiles[$test]['clover']);
+ try {
+ $results[] = $this->parseTestResults(
+ $test,
+ $tmpfiles[$test]['json'],
+ $tmpfiles[$test]['clover']);
+ } catch (Exception $e) {
+ if ($stderr) {
+ $msg = "The test '$test' crashed with the following output:\n$stderr";
+ throw new Exception($msg, 0, $e);
+ }
+ throw $e; // rethrow original
+ }
}
return array_mergev($results);

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 10, 5:07 PM (3 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7732282
Default Alt Text
D7848.id17757.diff (2 KB)

Event Timeline