From f603b08d0542983c18c1b76cbed72aae88851f7f Mon Sep 17 00:00:00 2001 From: jonawals Date: Mon, 7 Jun 2021 18:37:20 +0100 Subject: [PATCH] Address PR comments --- .../Runtime/Code/Source/TestImpactRuntime.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp index 79f5269188..ef4bf5cd03 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp @@ -271,9 +271,15 @@ namespace TestImpact // Next we will update the coverage of test targets that completed (with or without failures), unless the failed test coverage // policy dictates we should instead discard the coverage of test targets with failing tests - if (const auto testResult = job.GetTestResult(); - testResult == Client::TestRunResult::AllTestsPass || - (m_failedTestCoveragePolicy == Policy::FailedTestCoverage::Keep && testResult == Client::TestRunResult::TestFailures)) + const auto testResult = job.GetTestResult(); + + if (m_failedTestCoveragePolicy == Policy::FailedTestCoverage::Discard && testResult == Client::TestRunResult::TestFailures) + { + // Discard the coverage for this job + continue; + } + + if (testResult == Client::TestRunResult::AllTestsPass || testResult == Client::TestRunResult::TestFailures) { if (testResult == Client::TestRunResult::AllTestsPass) {