Enable python-based tests in Linux AR
Signed-off-by: sweeneys <sweeneys@amazon.com>
This commit is contained in:
@@ -20,6 +20,7 @@ _PROCESS_OUTPUT_ENCODING = 'utf-8'
|
||||
|
||||
# Default list of processes names to kill
|
||||
LY_PROCESS_KILL_LIST = [
|
||||
'AssetBuilder', 'AssetProcessor', 'AssetProcessorBatch',
|
||||
'CrySCompileServer', 'Editor',
|
||||
'Profiler', 'RemoteConsole',
|
||||
'rc' # Resource Compiler
|
||||
@@ -376,18 +377,18 @@ def _safe_kill_processes(processes):
|
||||
logger.info(f"Terminating process '{proc.name()}' with id '{proc.pid}'")
|
||||
proc.kill()
|
||||
except psutil.AccessDenied:
|
||||
logger.warning("Termination failed, Access Denied", exc_info=True)
|
||||
logger.warning("Termination failed, Access Denied with stacktrace:", exc_info=True)
|
||||
except psutil.NoSuchProcess:
|
||||
logger.debug("Termination request ignored, process was already terminated during iteration", exc_info=True)
|
||||
logger.debug("Termination request ignored, process was already terminated during iteration with stacktrace:", exc_info=True)
|
||||
except Exception: # purposefully broad
|
||||
logger.warning("Unexpected exception ignored while terminating process", exc_info=True)
|
||||
logger.debug("Unexpected exception ignored while terminating process, with stacktrace:", exc_info=True)
|
||||
|
||||
def on_terminate(proc):
|
||||
logger.info(f"process '{proc.name()}' with id '{proc.pid}' terminated with exit code {proc.returncode}")
|
||||
try:
|
||||
psutil.wait_procs(processes, timeout=30, callback=on_terminate)
|
||||
except Exception: # purposefully broad
|
||||
logger.warning("Unexpected exception while waiting for processes to terminate", exc_info=True)
|
||||
logger.debug("Unexpected exception while waiting for processes to terminate, with stacktrace:", exc_info=True)
|
||||
|
||||
|
||||
def _terminate_and_confirm_dead(proc):
|
||||
|
||||
@@ -371,15 +371,15 @@ class TestProcessMatching(unittest.TestCase):
|
||||
mock_log_warn.assert_called()
|
||||
|
||||
@mock.patch('psutil.wait_procs')
|
||||
@mock.patch('logging.Logger.warning')
|
||||
def test_SafeKillProcList_RaisesError_NoRaiseAndLogsError(self, mock_log_warn, mock_wait_procs):
|
||||
@mock.patch('logging.Logger.debug')
|
||||
def test_SafeKillProcList_RaisesError_NoRaiseAndLogsError(self, mock_log, mock_wait_procs):
|
||||
mock_wait_procs.side_effect = psutil.PermissionError()
|
||||
proc_mock = mock.MagicMock()
|
||||
|
||||
process_utils._safe_kill_processes(proc_mock)
|
||||
|
||||
mock_wait_procs.assert_called()
|
||||
mock_log_warn.assert_called()
|
||||
mock_log.assert_called()
|
||||
|
||||
@mock.patch('psutil.process_iter')
|
||||
@mock.patch('logging.Logger.debug')
|
||||
|
||||
@@ -23,7 +23,7 @@ ly_set(PAL_TRAIT_PROF_PIX_SUPPORTED FALSE)
|
||||
# Test library support
|
||||
ly_set(PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_TEST_GOOGLE_BENCHMARK_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED FALSE)
|
||||
ly_set(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_TEST_PYTEST_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_TEST_TARGET_TYPE MODULE)
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
"CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DLY_PARALLEL_LINK_JOBS=4",
|
||||
"CMAKE_LY_PROJECTS": "AutomatedTesting",
|
||||
"CMAKE_TARGET": "all",
|
||||
"CTEST_OPTIONS": "-E Gem::EMotionFX.Editor.Tests -LE (SUITE_sandbox|SUITE_awsi) -L FRAMEWORK_googletest --no-tests=error",
|
||||
"CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::EMotionFX.Tests) -L (SUITE_smoke|SUITE_main) -LE (REQUIRES_gpu) --no-tests=error",
|
||||
"TEST_RESULTS": "True"
|
||||
}
|
||||
},
|
||||
@@ -96,7 +96,7 @@
|
||||
"CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4",
|
||||
"CMAKE_LY_PROJECTS": "AutomatedTesting",
|
||||
"CMAKE_TARGET": "all",
|
||||
"CTEST_OPTIONS": "-E Gem::EMotionFX.Editor.Tests -LE (SUITE_sandbox|SUITE_awsi) -L FRAMEWORK_googletest --no-tests=error",
|
||||
"CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::EMotionFX.Tests) -L (SUITE_smoke|SUITE_main) -LE (REQUIRES_gpu) --no-tests=error",
|
||||
"TEST_RESULTS": "True"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user