[xharness] 'Skipped' really meant 'DeviceNotFound', so rename things to avoid confusion. (#6066)

This commit is contained in:
Rolf Bjarne Kvinge 2019-05-17 08:59:33 -07:00 коммит произвёл GitHub
Родитель a1c19733d8
Коммит d84c3a0892
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -1187,7 +1187,7 @@ namespace xharness
}
Task.WaitAll (tasks.ToArray ());
GenerateReport ();
return Tasks.Any ((v) => v.Failed || v.Skipped) ? 1 : 0;
return Tasks.Any ((v) => v.Failed || v.DeviceNotFound) ? 1 : 0;
} catch (Exception ex) {
MainLog.WriteLine ("Unexpected exception: {0}", ex);
Console.WriteLine ("Unexpected exception: {0}", ex);
@ -1562,7 +1562,7 @@ namespace xharness
return "black";
else if (tests.Any ((v) => v.Ignored))
return "gray";
else if (tests.Any ((v) => v.Skipped))
else if (tests.Any ((v) => v.DeviceNotFound))
return "orangered";
else if (tests.All ((v) => v.BuildSucceeded))
return "lightgreen";
@ -1603,7 +1603,7 @@ namespace xharness
return "gray";
} else if (test.Waiting) {
return "darkgray";
} else if (test.Skipped) {
} else if (test.DeviceNotFound) {
return "orangered";
} else {
return "pink";
@ -1714,7 +1714,7 @@ namespace xharness
}
var failedTests = allTasks.Where ((v) => v.Failed);
var skippedTests = allTasks.Where ((v) => v.Skipped);
var deviceNotFound = allTasks.Where ((v) => v.DeviceNotFound);
var unfinishedTests = allTasks.Where ((v) => !v.Finished);
var passedTests = allTasks.Where ((v) => v.Succeeded);
var runningTests = allTasks.Where ((v) => v.Running && !v.Waiting);
@ -1740,9 +1740,9 @@ namespace xharness
markdown_summary.Write ($"# Test run in progress: ");
markdown_summary.Write (string.Join (", ", list));
} else if (failedTests.Any ()) {
markdown_summary.Write ($"{failedTests.Count ()} tests failed, {skippedTests.Count ()} tests skipped, {passedTests.Count ()} tests passed.");
} else if (skippedTests.Any ()) {
markdown_summary.Write ($"{skippedTests.Count ()} tests skipped, {passedTests.Count ()} tests passed.");
markdown_summary.Write ($"{failedTests.Count ()} tests failed, {deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed.");
} else if (deviceNotFound.Any ()) {
markdown_summary.Write ($"{deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed.");
} else if (passedTests.Any ()) {
markdown_summary.Write ($"# All {passedTests.Count ()} tests passed");
} else {
@ -1803,7 +1803,7 @@ namespace xharness
; // default
} else if (failedTests.Any ()) {
headerColor = "red";
} else if (skippedTests.Any ()) {
} else if (deviceNotFound.Any ()) {
headerColor = "orange";
} else if (passedTests.Any ()) {
headerColor = "green";
@ -1824,9 +1824,9 @@ namespace xharness
writer.Write (string.Join (", ", list));
writer.Write (")");
} else if (failedTests.Any ()) {
writer.Write ($"{failedTests.Count ()} tests failed, {skippedTests.Count ()} tests skipped, {passedTests.Count ()} tests passed");
} else if (skippedTests.Any ()) {
writer.Write ($"{skippedTests.Count ()} tests skipped, {passedTests.Count ()} tests passed");
writer.Write ($"{failedTests.Count ()} tests failed, {deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed");
} else if (deviceNotFound.Any ()) {
writer.Write ($"{deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed");
} else if (passedTests.Any ()) {
writer.Write ($"All {passedTests.Count ()} tests passed");
} else {
@ -2421,7 +2421,7 @@ namespace xharness
ExecutionResult = value ? TestExecutingResult.Ignored : TestExecutingResult.NotStarted;
}
}
public bool Skipped { get { return ExecutionResult == TestExecutingResult.Skipped; } }
public bool DeviceNotFound { get { return ExecutionResult == TestExecutingResult.DeviceNotFound; } }
public bool Crashed { get { return (ExecutionResult & TestExecutingResult.Crashed) == TestExecutingResult.Crashed; } }
public bool TimedOut { get { return (ExecutionResult & TestExecutingResult.TimedOut) == TestExecutingResult.TimedOut; } }
@ -3570,7 +3570,7 @@ namespace xharness
if (asyncEnumerable != null)
await asyncEnumerable.ReadyTask;
if (!enumerable.Any ()) {
ExecutionResult = TestExecutingResult.Skipped;
ExecutionResult = TestExecutingResult.DeviceNotFound;
FailureMessage = "No applicable devices found.";
}
}
@ -3790,7 +3790,7 @@ namespace xharness
await asyncEnumerable.ReadyTask;
if (!Candidates.Any ()) {
ExecutionResult = TestExecutingResult.Skipped;
ExecutionResult = TestExecutingResult.DeviceNotFound;
FailureMessage = "No applicable devices found.";
} else {
Device = Candidates.First ();
@ -4148,7 +4148,7 @@ namespace xharness
Succeeded = 0x100 + Finished,
Failed = 0x200 + Finished,
Ignored = 0x400 + Finished,
Skipped = 0x800 + Finished,
DeviceNotFound = 0x800 + Finished,
// Finished & Failed results
Crashed = 0x1000 + Failed,