From 0da739ef18c41ec1ecb29cb563b69d676ef5d7cd Mon Sep 17 00:00:00 2001 From: jonawals Date: Mon, 7 Jun 2021 09:05:29 +0100 Subject: [PATCH] Add curiously missing comments --- .../Runtime/Code/Source/TestImpactRuntime.cpp | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp index 44657dad21..d83976b488 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestImpactRuntime.cpp @@ -70,6 +70,7 @@ namespace TestImpact }; } + //! Utility for concatenating two vectors. template AZStd::vector ConcatenateVectors(const AZStd::vector& v1, const AZStd::vector& v2) { @@ -79,6 +80,7 @@ namespace TestImpact result.insert(result.end(), v2.begin(), v2.end()); return result; } + Runtime::Runtime( RuntimeConfig&& config, SuiteType suiteFilter, @@ -346,12 +348,20 @@ namespace TestImpact AZStd::optional testCompleteCallback) { Timer timer; + + // Draft in the test targets that have no coverage entries in the dynamic dependency map AZStd::vector draftedTestTargets = m_dynamicDependencyMap->GetNotCoveringTests(); + // The test targets that were selected for the change list by the dynamic dependency map and the test targets that were not auto [selectedTestTargets, discardedTestTargets] = SelectCoveringTestTargetsAndUpdateEnumerationCache(changeList, testPrioritizationPolicy); + + // The subset of selected test targets that are not on the configuration's exclude list and those that are auto [includedSelectedTestTargets, excludedSelectedTestTargets] = SelectTestTargetsByExcludeList(selectedTestTargets); + // We present to the client the included selected test targets and the drafted test targets as distinct sets but internally + // we consider the concatenated set of the two the actual set of tests to run AZStd::vector testTargetsToRun = ConcatenateVectors(includedSelectedTestTargets, draftedTestTargets); + if (testSequenceStartCallback.has_value()) { (*testSequenceStartCallback)( @@ -360,7 +370,6 @@ namespace TestImpact ExtractTestTargetNames(draftedTestTargets)); } - if (dynamicDependencyMapPolicy == Policy::DynamicDependencyMap::Update) { const auto [result, testJobs] = m_testEngine->InstrumentedRun( @@ -413,14 +422,24 @@ namespace TestImpact AZStd::optional testSequenceEndCallback, AZStd::optional testCompleteCallback) { - Timer timer; + Timer timer; + + // Draft in the test targets that have no coverage entries in the dynamic dependency map AZStd::vector draftedTestTargets = m_dynamicDependencyMap->GetNotCoveringTests(); + // The test targets that were selected for the change list by the dynamic dependency map and the test targets that were not auto [selectedTestTargets, discardedTestTargets] = SelectCoveringTestTargetsAndUpdateEnumerationCache(changeList, testPrioritizationPolicy); + + // The subset of selected test targets that are not on the configuration's exclude list and those that are auto [includedSelectedTestTargets, excludedSelectedTestTargets] = SelectTestTargetsByExcludeList(selectedTestTargets); + + // The subset of discarded test targets that are not on the configuration's exclude list and those that are auto [includedDiscardedTestTargets, excludedDiscardedTestTargets] = SelectTestTargetsByExcludeList(discardedTestTargets); + // We present to the client the included selected test targets and the drafted test targets as distinct sets but internally + // we consider the concatenated set of the two the actual set of tests to run AZStd::vector testTargetsToRun = ConcatenateVectors(includedSelectedTestTargets, draftedTestTargets); + if (testSequenceStartCallback.has_value()) { (*testSequenceStartCallback)( @@ -429,7 +448,6 @@ namespace TestImpact ExtractTestTargetNames(draftedTestTargets)); } - // Impact analysis run of the selected test targets const auto [selectedResult, selectedTestJobs] = m_testEngine->InstrumentedRun( testTargetsToRun,