Merge pull request #6117 from aws-lumberyard-dev/jckand/LinuxCrashTest

Handling crash.log for Editor crashes during Linux tests
This commit is contained in:
Chris Galvan
2021-12-06 10:58:17 -06:00
committed by GitHub
6 changed files with 33 additions and 2 deletions
@@ -24,6 +24,7 @@ def CreatePrefab_WithSingleEntity():
# Creates a prefab from the new entity
Prefab.create_prefab(car_prefab_entities, CAR_PREFAB_FILE_NAME)
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(CreatePrefab_WithSingleEntity)
@@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
import os
import logging
import subprocess
import sys
import pytest
import time
@@ -128,7 +128,8 @@ class TestAutomationBase:
errors.append(TestRunError("FAILED TEST", error_str))
if return_code and return_code != TestAutomationBase.TEST_FAIL_RETCODE: # Crashed
crash_info = "-- No crash log available --"
crash_log = os.path.join(workspace.paths.project_log(), 'error.log')
crash_log = workspace.paths.crash_log()
try:
waiter.wait_for(lambda: os.path.exists(crash_log), timeout=TestAutomationBase.WAIT_FOR_CRASH_LOG)
except AssertionError:
@@ -384,3 +384,14 @@ class AbstractResourceLocator(object):
"editor_log() is not implemented on the base AbstractResourceLocator() class. "
"It must be defined by the inheriting class - "
"i.e. _WindowsResourceLocator(AbstractResourceLocator).editor_log()")
@abstractmethod
def crash_log(self):
"""
Return path to the project's crash log dir using the builds project and platform
:return: path to error.log/crash.log
"""
raise NotImplementedError(
"crash_log() is not implemented on the base AbstractResourceLocator() class. "
"It must be defined by the inheriting class - "
"i.e. _WindowsResourceLocator(AbstractResourceLocator).crash_log()")
@@ -53,6 +53,12 @@ class _LinuxResourceManager(AbstractResourceLocator):
"""
return os.path.join(self.project_log(), "Editor.log")
def crash_log(self):
"""
Return path to the project's crash log dir using the builds project and platform
:return: path to Crash.log
"""
return os.path.join(self.project_log(), "crash.log")
class LinuxWorkspaceManager(AbstractWorkspaceManager):
"""
@@ -62,6 +62,12 @@ class _MacResourceLocator(AbstractResourceLocator):
"""
return os.path.join(self.project_log(), "Editor.log")
def crash_log(self):
"""
Return path to the project's crash log dir using the builds project and platform
:return: path to crash.log
"""
return os.path.join(self.project_log(), "crash.log")
class MacWorkspaceManager(AbstractWorkspaceManager):
"""
@@ -68,6 +68,12 @@ class _WindowsResourceLocator(AbstractResourceLocator):
"""
return os.path.join(self.project_log(), "Editor.log")
def crash_log(self):
"""
Return path to the project's crash log dir using the builds project and platform
:return: path to Error.log
"""
return os.path.join(self.project_log(), "error.log")
class WindowsWorkspaceManager(AbstractWorkspaceManager):
"""