From e27067ab30fb1635489bb895d2892fb77e36579a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 3 Jun 2019 16:47:41 -0400 Subject: [PATCH] [d16-2] [xharness] Don't report tests whose device were not found if there were no such tests. (#6169) --- tests/xharness/Jenkins.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index cae69c99b5..b7ed23614a 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1721,7 +1721,10 @@ 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, {deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed."); + markdown_summary.Write ($"{failedTests.Count ()} tests failed, "); + if (deviceNotFound.Any ()) + markdown_summary.Write ($"{deviceNotFound.Count ()} tests' device not found, "); + markdown_summary.Write ($"{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 ()) { @@ -1805,7 +1808,10 @@ namespace xharness writer.Write (string.Join (", ", list)); writer.Write (")"); } else if (failedTests.Any ()) { - writer.Write ($"{failedTests.Count ()} tests failed, {deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed"); + writer.Write ($"{failedTests.Count ()} tests failed, "); + if (deviceNotFound.Any ()) + writer.Write ($"{deviceNotFound.Count ()} tests' device not found, "); + writer.Write ($"{passedTests.Count ()} tests passed"); } else if (deviceNotFound.Any ()) { writer.Write ($"{deviceNotFound.Count ()} tests' device not found, {passedTests.Count ()} tests passed"); } else if (passedTests.Any ()) {