|
@@ -40,13 +40,13 @@ namespace TestImpact
|
|
|
template<>
|
|
|
struct TestJobRunnerTrait<PythonTestRunner>
|
|
|
{
|
|
|
- using TestEngineJobType = TestEngineInstrumentedRun<typename PythonTestEngine::TestTargetType, typename PythonTestEngine::TestCaseCoverageType>;
|
|
|
+ using TestEngineJobType = TestEngineInstrumentedRun<PythonTestTarget, TestCoverage>;
|
|
|
};
|
|
|
|
|
|
template<>
|
|
|
struct TestJobRunnerTrait<PythonNullTestRunner>
|
|
|
{
|
|
|
- using TestEngineJobType = TestEngineInstrumentedRun<typename PythonTestEngine::TestTargetType, typename PythonTestEngine::TestCaseCoverageType>;
|
|
|
+ using TestEngineJobType = TestEngineInstrumentedRun<PythonTestTarget, TestCoverage>;
|
|
|
};
|
|
|
|
|
|
PythonTestEngine::PythonTestEngine(
|
|
@@ -71,39 +71,18 @@ namespace TestImpact
|
|
|
DeleteFiles(m_artifactDir.m_coverageArtifactDirectory, "*.pycoverage");
|
|
|
}
|
|
|
|
|
|
- TestEngineInstrumentedRunResult<typename PythonTestEngine::TestTargetType, typename PythonTestEngine::TestCaseCoverageType>
|
|
|
+ TestEngineInstrumentedRunResult<PythonTestTarget, TestCoverage>
|
|
|
PythonTestEngine::
|
|
|
InstrumentedRun(
|
|
|
- [[maybe_unused]] const AZStd::vector<const PythonTestTarget*>& testTargets,
|
|
|
- [[maybe_unused]] Policy::ExecutionFailure executionFailurePolicy,
|
|
|
- [[maybe_unused]] Policy::IntegrityFailure integrityFailurePolicy,
|
|
|
- [[maybe_unused]] Policy::TestFailure testFailurePolicy,
|
|
|
- [[maybe_unused]] Policy::TargetOutputCapture targetOutputCapture,
|
|
|
- [[maybe_unused]] AZStd::optional<AZStd::chrono::milliseconds> testTargetTimeout,
|
|
|
- [[maybe_unused]] AZStd::optional<AZStd::chrono::milliseconds> globalTimeout,
|
|
|
- [[maybe_unused]] AZStd::optional<TestEngineJobCompleteCallback<PythonTestTarget>> callback) const
|
|
|
+ const AZStd::vector<const PythonTestTarget*>& testTargets,
|
|
|
+ Policy::ExecutionFailure executionFailurePolicy,
|
|
|
+ Policy::IntegrityFailure integrityFailurePolicy,
|
|
|
+ Policy::TestFailure testFailurePolicy,
|
|
|
+ Policy::TargetOutputCapture targetOutputCapture,
|
|
|
+ AZStd::optional<AZStd::chrono::milliseconds> testTargetTimeout,
|
|
|
+ AZStd::optional<AZStd::chrono::milliseconds> globalTimeout,
|
|
|
+ AZStd::optional<TestEngineJobCompleteCallback<PythonTestTarget>> callback) const
|
|
|
{
|
|
|
- // We currently don't have a std out/error callback for the test engine users so output the Python
|
|
|
- // error and output here for the time being
|
|
|
- const auto stdPrint = []([[maybe_unused]] const typename PythonNullTestRunner::JobInfo& jobInfo,
|
|
|
- [[maybe_unused]] const AZStd::string& stdOutput,
|
|
|
- [[maybe_unused]] const AZStd::string& stdError,
|
|
|
- AZStd::string&& stdOutDelta,
|
|
|
- [[maybe_unused]] AZStd::string&& stdErrDelta)
|
|
|
- {
|
|
|
- if (!stdOutDelta.empty())
|
|
|
- {
|
|
|
- std::cout << stdOutDelta.c_str() << "\n";
|
|
|
- }
|
|
|
-
|
|
|
- if (!stdErrDelta.empty())
|
|
|
- {
|
|
|
- std::cout << stdErrDelta.c_str() << "\n";
|
|
|
- }
|
|
|
-
|
|
|
- return TestImpact::ProcessCallbackResult::Continue;
|
|
|
- };
|
|
|
-
|
|
|
if (m_testRunnerPolicy == Policy::TestRunner::UseNullTestRunner)
|
|
|
{
|
|
|
// We don't delete the artifacts as they have been left by another test runner (e.g. ctest)
|
|
@@ -119,7 +98,7 @@ namespace TestImpact
|
|
|
testTargetTimeout,
|
|
|
globalTimeout,
|
|
|
callback,
|
|
|
- stdPrint),
|
|
|
+ std::nullopt), // For real-time stdout/err output of test targets
|
|
|
integrityFailurePolicy);
|
|
|
}
|
|
|
else
|
|
@@ -137,7 +116,7 @@ namespace TestImpact
|
|
|
testTargetTimeout,
|
|
|
globalTimeout,
|
|
|
callback,
|
|
|
- stdPrint),
|
|
|
+ std::nullopt), // For real-time stdout/err output of test targets
|
|
|
integrityFailurePolicy);
|
|
|
}
|
|
|
}
|