Adds test duration to status log
This commit is contained in:
parent
bbf66bb0f0
commit
344c004299
|
@ -200,8 +200,10 @@ namespace DistTestCore
|
|||
private void DisposeTestLifecycle()
|
||||
{
|
||||
var lifecycle = Get();
|
||||
fixtureLog.Log($"{GetCurrentTestName()} = {GetTestResult()} ({lifecycle.GetTestDuration()})");
|
||||
statusLog.ConcludeTest(GetTestResult());
|
||||
var testResult = GetTestResult();
|
||||
var testDuration = lifecycle.GetTestDuration();
|
||||
fixtureLog.Log($"{GetCurrentTestName()} = {testResult} ({testDuration})");
|
||||
statusLog.ConcludeTest(testResult, testDuration);
|
||||
Stopwatch.Measure(fixtureLog, $"Teardown for {GetCurrentTestName()}", () =>
|
||||
{
|
||||
lifecycle.Log.EndTest();
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Logging
|
|||
this.codexId = codexId;
|
||||
}
|
||||
|
||||
public void ConcludeTest(string resultStatus)
|
||||
public void ConcludeTest(string resultStatus, string testDuration)
|
||||
{
|
||||
Write(new StatusLogJson
|
||||
{
|
||||
|
@ -27,7 +27,8 @@ namespace Logging
|
|||
codexid = codexId,
|
||||
category = NameUtils.GetCategoryName(),
|
||||
fixturename = fixtureName,
|
||||
testname = NameUtils.GetTestMethodName()
|
||||
testname = NameUtils.GetTestMethodName(),
|
||||
testduration = testDuration
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -57,5 +58,6 @@ namespace Logging
|
|||
public string category { get; set; } = string.Empty;
|
||||
public string fixturename { get; set; } = string.Empty;
|
||||
public string testname { get; set; } = string.Empty;
|
||||
public string testduration { get; set;} = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue