Adds involvedpods, error, and duration in seconds to status logs for continuous tests.
This commit is contained in:
parent
ee319a6d0f
commit
5996c0fa63
|
@ -98,7 +98,7 @@ namespace ContinuousTests
|
|||
|
||||
private void WaitUntilFinished(LogSplitter overviewLog, StatusLog statusLog, DateTime startTime, TestLoop[] testLoops)
|
||||
{
|
||||
var testDuration = Time.FormatDuration(DateTime.UtcNow - startTime);
|
||||
var testDuration = (DateTime.UtcNow - startTime).TotalSeconds.ToString();
|
||||
var testData = FormatTestRuns(testLoops);
|
||||
overviewLog.Log("Total duration: " + testDuration);
|
||||
|
||||
|
|
|
@ -191,6 +191,12 @@ namespace ContinuousTests
|
|||
result.Add("teststart", testStart.ToString("o"));
|
||||
result.Add("testname", testName);
|
||||
result.Add("message", message);
|
||||
result.Add("involvedpods", string.Join(",", nodes.Select(n => n.GetName())));
|
||||
|
||||
var error = message.Split(Environment.NewLine).First();
|
||||
if (error.Contains(":")) error = error.Substring(1 + error.LastIndexOf(":"));
|
||||
result.Add("error", error);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Utils;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DistTestCore.Logs
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace DistTestCore.Logs
|
|||
|
||||
public void ConcludeTest(string resultStatus, TimeSpan testDuration, Dictionary<string, string> data)
|
||||
{
|
||||
ConcludeTest(resultStatus, Time.FormatDuration(testDuration), data);
|
||||
ConcludeTest(resultStatus, testDuration.TotalSeconds.ToString(CultureInfo.InvariantCulture), data);
|
||||
}
|
||||
|
||||
public void ConcludeTest(string resultStatus, string testDuration, Dictionary<string, string> data)
|
||||
|
|
|
@ -58,10 +58,9 @@ namespace DistTestCore
|
|||
return entryPoint.GetPluginMetadata();
|
||||
}
|
||||
|
||||
public string GetTestDuration()
|
||||
public TimeSpan GetTestDuration()
|
||||
{
|
||||
var testDuration = DateTime.UtcNow - testStart;
|
||||
return Time.FormatDuration(testDuration);
|
||||
return DateTime.UtcNow - testStart;
|
||||
}
|
||||
|
||||
public void OnContainersStarted(RunningContainers rc)
|
||||
|
|
Loading…
Reference in New Issue