From 0ef519d11d5b7d7fd6d3924a88f469afd0088dea Mon Sep 17 00:00:00 2001 From: jonawals Date: Tue, 25 May 2021 12:55:11 +0100 Subject: [PATCH] Address PR comments --- .../Runtime/Code/Source/TestEngine/TestImpactTestEngine.h | 6 +++--- .../TestEngine/TestImpactTestEngineInstrumentedRun.cpp | 8 ++++---- .../TestEngine/TestImpactTestEngineInstrumentedRun.h | 1 + .../Code/Source/TestEngine/TestImpactTestEngineJob.h | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngine.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngine.h index f6fb6cec11..c67a10aa4c 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngine.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngine.h @@ -67,7 +67,7 @@ namespace TestImpact //! @param globalTimeout The maximum duration the enumeration sequence may run before being forcefully terminated (infinite if empty). //! @param callback The client callback function to handle completed test target enumerations. //! @ returns The sequence result and the enumerations for the target that were enumerated. - AZStd::pair < TestSequenceResult, AZStd::vector> UpdateEnumerationCache( + AZStd::pair> UpdateEnumerationCache( const AZStd::vector& testTargets, Policy::ExecutionFailure executionFailurePolicy, AZStd::optional testTargetTimeout, @@ -84,7 +84,7 @@ namespace TestImpact //! @param globalTimeout The maximum duration the enumeration sequence may run before being forcefully terminated (infinite if empty). //! @param callback The client callback function to handle completed test target runs. //! @ returns The sequence result and the test run results for the test targets that were run. - [[nodiscard]]AZStd::pair> RegularRun( + [[nodiscard]] AZStd::pair> RegularRun( const AZStd::vector& testTargets, Policy::TestSharding testShardingPolicy, Policy::ExecutionFailure executionFailurePolicy, @@ -105,7 +105,7 @@ namespace TestImpact //! @param globalTimeout The maximum duration the enumeration sequence may run before being forcefully terminated (infinite if empty). //! @param callback The client callback function to handle completed test target runs. //! @ returns The sequence result and the test run results and test coverages for the test targets that were run. - [[nodiscard]]AZStd::pair> InstrumentedRun( + [[nodiscard]] AZStd::pair> InstrumentedRun( const AZStd::vector& testTargets, Policy::TestSharding testShardingPolicy, Policy::ExecutionFailure executionFailurePolicy, diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.cpp index b19ec723d1..20c80c5f5f 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.cpp @@ -18,7 +18,7 @@ namespace TestImpact { namespace { - AZStd::optional ReleaseTestRun(AZStd::optional>&& testRunAndCoverage) + AZStd::optional ReleaseTestRun(AZStd::optional>& testRunAndCoverage) { if (testRunAndCoverage.has_value()) { @@ -28,7 +28,7 @@ namespace TestImpact return AZStd::nullopt; } - AZStd::optional ReleaseTestCoverage(AZStd::optional>&& testRunAndCoverage) + AZStd::optional ReleaseTestCoverage(AZStd::optional>& testRunAndCoverage) { if (testRunAndCoverage.has_value()) { @@ -40,8 +40,8 @@ namespace TestImpact } TestEngineInstrumentedRun::TestEngineInstrumentedRun(TestEngineJob&& testJob, AZStd::optional>&& testRunAndCoverage) - : TestEngineRegularRun(AZStd::move(testJob), ReleaseTestRun(AZStd::move(testRunAndCoverage))) - , m_testCoverage(ReleaseTestCoverage(AZStd::move(testRunAndCoverage))) + : TestEngineRegularRun(AZStd::move(testJob), ReleaseTestRun(testRunAndCoverage)) + , m_testCoverage(ReleaseTestCoverage(testRunAndCoverage)) { } diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.h index b1edd943a4..efecebcbd4 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineInstrumentedRun.h @@ -26,6 +26,7 @@ namespace TestImpact //! Returns the test coverage payload for this job (if any). const AZStd::optional& GetTestCoverge() const; + private: AZStd::optional m_testCoverage; }; diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineJob.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineJob.h index 00d0c7d099..753a4cd494 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineJob.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/TestImpactTestEngineJob.h @@ -33,6 +33,7 @@ namespace TestImpact //! Returns the command string that was used to execute this job. const AZStd::string& GetCommandString() const; + private: const TestTarget* m_testTarget; AZStd::string m_commandString;