Improve test harness logging when there are no trace files (#7785)

* Log OldBinary even if there are no trace files

DeterminismCheck and OldBinary attributes don't actually depend on
information in the ProgramStart event, so we can add them
unconditionally.

* Add JoshuaSeed attribute to Test element in test harness

* Add NoTraceFilesFound event in test harness

There's already something similar: NoTraceFileGenerated. It appears that
the original author only wants to log that if the process exited 0
though. I'm not sure what the reason for that is so I think it's safer
to add a new event. This will make it more clear if say an old binary is
corrupt.
This commit is contained in:
Andrew Noyes 2022-08-03 17:14:33 -07:00 committed by GitHub
parent 1cda8a2fc1
commit da1ffebcb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 3 deletions

View File

@ -788,6 +788,13 @@ namespace SummarizeTest
string firstRetryableError = "";
int stderrSeverity = (int)Magnesium.Severity.SevError;
xout.Add(new XAttribute("DeterminismCheck", expectedUnseed != -1 ? "1" : "0"));
xout.Add(new XAttribute("OldBinary", Path.GetFileName(oldBinaryName)));
if (traceFiles.Length == 0) {
xout.Add(new XElement("NoTraceFilesFound"));
}
Dictionary<KeyValuePair<string, Magnesium.Severity>, Magnesium.Severity> severityMap = new Dictionary<KeyValuePair<string, Magnesium.Severity>, Magnesium.Severity>();
var codeCoverage = new Dictionary<Tuple<string, string, string>, bool>();
@ -824,9 +831,7 @@ namespace SummarizeTest
new XAttribute("RandomSeed", ev.Details.RandomSeed),
new XAttribute("SourceVersion", ev.Details.SourceVersion),
new XAttribute("Time", ev.Details.ActualTime),
new XAttribute("BuggifyEnabled", ev.Details.BuggifyEnabled),
new XAttribute("DeterminismCheck", expectedUnseed != -1 ? "1" : "0"),
new XAttribute("OldBinary", Path.GetFileName(oldBinaryName)));
new XAttribute("BuggifyEnabled", ev.Details.BuggifyEnabled));
testBeginFound = true;
if (ev.DDetails.ContainsKey("FaultInjectionEnabled"))
xout.Add(new XAttribute("FaultInjectionEnabled", ev.Details.FaultInjectionEnabled));
@ -959,6 +964,12 @@ namespace SummarizeTest
xout.Add(new XElement(externalError, new XAttribute("Severity", (int)Magnesium.Severity.SevError)));
}
string joshuaSeed = System.Environment.GetEnvironmentVariable("JOSHUA_SEED");
if (joshuaSeed != null) {
xout.Add(new XAttribute("JoshuaSeed", joshuaSeed));
}
foreach(var kv in codeCoverage)
{
var element = new XElement("CodeCoverage", new XAttribute("File", kv.Key.Item1), new XAttribute("Line", kv.Key.Item2));