Better exception logging for tests with multiple time-moments.
This commit is contained in:
parent
a1ec187919
commit
8d7a7b4d1b
|
@ -126,10 +126,11 @@ namespace ContinuousTests
|
||||||
|
|
||||||
private void ThrowFailTest()
|
private void ThrowFailTest()
|
||||||
{
|
{
|
||||||
var ex = UnpackException(exceptions.First());
|
var exs = UnpackExceptions(exceptions);
|
||||||
Log(ex.ToString());
|
var exceptionsMessage = GetCombinedExceptionsMessage(exs);
|
||||||
OverviewLog($" > Test failed {FuturesInfo()}: " + ex.Message);
|
Log(exceptionsMessage);
|
||||||
throw ex;
|
OverviewLog($" > Test failed {FuturesInfo()}: " + exceptionsMessage);
|
||||||
|
throw new Exception(exceptionsMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string FuturesInfo()
|
private string FuturesInfo()
|
||||||
|
@ -152,6 +153,16 @@ namespace ContinuousTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetCombinedExceptionsMessage(Exception[] exceptions)
|
||||||
|
{
|
||||||
|
return string.Join(Environment.NewLine, exceptions.Select(ex => ex.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Exception[] UnpackExceptions(List<Exception> exceptions)
|
||||||
|
{
|
||||||
|
return exceptions.Select(UnpackException).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
private Exception UnpackException(Exception exception)
|
private Exception UnpackException(Exception exception)
|
||||||
{
|
{
|
||||||
if (exception is AggregateException a)
|
if (exception is AggregateException a)
|
||||||
|
|
Loading…
Reference in New Issue