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
} 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);
}
}
}