mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-22 20:51:09 +01:00
Provide more information when unit tests fail with exceptions
Summary: When a unit test throws an exception, provide more data (type, trace) in the test failure message. Previously, we would show only the message itself, which may not be very useful in debugging test failures. Test Plan: Ran "arc unit" on a test which throws, got a stack trace. Reviewers: edward, btrahan, jungejason, nh, tuomaspelkonen, aran Reviewed By: nh CC: aran, nh Differential Revision: 1123
This commit is contained in:
parent
4ea0541aeb
commit
a8b4231244
1 changed files with 5 additions and 1 deletions
|
@ -231,7 +231,11 @@ abstract class ArcanistPhutilTestCase {
|
|||
} catch (ArcanistPhutilTestTerminatedException $ex) {
|
||||
// Continue with the next test.
|
||||
} catch (Exception $ex) {
|
||||
$this->failTest($ex->getMessage());
|
||||
$ex_class = get_class($ex);
|
||||
$ex_message = $ex->getMessage();
|
||||
$ex_trace = $ex->getTraceAsString();
|
||||
$message = "EXCEPTION ({$ex_class}): {$ex_message}\n{$ex_trace}";
|
||||
$this->failTest($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue