From e82b54d59b79959b75e609690ac4430017113832 Mon Sep 17 00:00:00 2001 From: jonawals Date: Thu, 27 May 2021 14:04:16 +0100 Subject: [PATCH] Address PR comments --- .../Enumeration/TestImpactTestEnumerator.cpp | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp index eacf73efef..58ffb85cb3 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp @@ -112,12 +112,49 @@ namespace TestImpact } else { - // This job has no cache read policy so place in job queue + // This job has no cache read policy so delete the cache and place in job queue DeleteFile(jobInfo->GetCache()->m_file); jobQueue.emplace_back(*jobInfo); } } + /* As per comment on PR51, this suggestion will be explored once the test coverage code for this subsystem is revisited + bool aborted = false; + for (const auto& jobInfo : jobInfos) + { + if (!jobInfo->GetCache().has_value() || + jobInfo->GetCache()->m_policy != JobData::CachePolicy::Read) + { + DeleteFile(jobInfo->GetCache()->m_file); + jobQueue.emplace_back(*jobInfo); + continue; + } + + ... // try catch part + if (!enumeration.has_value()) + { + jobQueue.emplace_back(*jobInfo); + continue; + } + + // Cache read successfully, this job will not be placed in the job queue + cachedJobs.emplace_back(Job(*jobInfo, AZStd::move(meta), AZStd::move(enumeration))); + + if (m_clientJobCallback.has_value() && (*m_clientJobCallback)(*jobInfo, meta) == ProcessCallbackResult::Abort) + { + aborted = true; // catch the index too + break; + } + } + + if (aborted) + { + // do the abortion part + + return { ProcessSchedulerResult::UserAborted, jobs }; + } + */ + const auto payloadGenerator = [this](const JobDataMap& jobDataMap) { PayloadMap enumerations;