From bc903f22cd020cfa60bf0730114996bf722b0b12 Mon Sep 17 00:00:00 2001 From: sweeneys Date: Tue, 30 Nov 2021 18:23:36 -0800 Subject: [PATCH 1/3] Remove remote console flag suppressing game logs in GameLauncher and ServerLauncher apps Signed-off-by: sweeneys --- .../launchers/platforms/linux/launcher.py | 6 +++--- .../launchers/platforms/win/launcher.py | 16 ---------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py index 112629b349..e8931ba07f 100644 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py @@ -179,20 +179,20 @@ class LinuxLauncher(Launcher): class DedicatedLinuxLauncher(LinuxLauncher): - def setup(self, backupFiles=True, launch_ap=False): + def setup(self, backupFiles=True, launch_ap=False, configure_settings=True): """ Perform setup of this launcher, must be called before launching. Subclasses should call its parent's setup() before calling its own code, unless it changes configuration files :param backupFiles: Bool to backup setup files - :param lauch_ap: Bool to lauch the asset processor + :param launch_ap: Bool to launch the asset processor :return: None """ # Base setup defaults to None if launch_ap is None: launch_ap = False - super(DedicatedLinuxLauncher, self).setup(backupFiles, launch_ap) + super(DedicatedLinuxLauncher, self).setup(backupFiles, launch_ap, configure_settings) def binary_path(self): """ diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py index d18431ba82..ec2b3b966c 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py @@ -169,7 +169,6 @@ class WinLauncher(Launcher): host_ip = '127.0.0.1' self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/project_path={self.workspace.paths.project()}"') self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/remote_ip={host_ip}"') - self.args.append('--regset="/Amazon/AzCore/Bootstrap/wait_for_connect=1"') self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/allowed_list={host_ip}"') self.workspace.settings.modify_platform_setting("log_RemoteConsoleAllowedAddresses", host_ip) @@ -177,21 +176,6 @@ class WinLauncher(Launcher): class DedicatedWinLauncher(WinLauncher): - def setup(self, backupFiles=True, launch_ap=False): - """ - Perform setup of this launcher, must be called before launching. - Subclasses should call its parent's setup() before calling its own code, unless it changes configuration files - - :param backupFiles: Bool to backup setup files - :param lauch_ap: Bool to lauch the asset processor - :return: None - """ - # Base setup defaults to None - if launch_ap is None: - launch_ap = False - - super(DedicatedWinLauncher, self).setup(backupFiles, launch_ap) - def binary_path(self): """ Return full path to the dedicated server launcher for the build directory. From a5cb5b7f802ca93c093f448557b2f8767dd63b17 Mon Sep 17 00:00:00 2001 From: sweeneys Date: Tue, 30 Nov 2021 23:07:29 -0800 Subject: [PATCH 2/3] Make different launchers handle args the same way, fix missing docstrings Signed-off-by: sweeneys --- .../launchers/platforms/android/launcher.py | 20 ++++++++++++++++--- .../ly_test_tools/launchers/platforms/base.py | 2 ++ .../launchers/platforms/linux/launcher.py | 10 +++++++--- .../launchers/platforms/win/launcher.py | 7 ++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py index 75eaa65e94..7c3efd9e9d 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py @@ -163,9 +163,23 @@ class AndroidLauncher(Launcher): return True - def setup(self): + def setup(self, backupFiles=True, launch_ap=True, configure_settings=True): + """ + Perform setup of this launcher, must be called before launching. + Subclasses should call its parent's setup() before calling its own code, unless it changes configuration files + + :param backupFiles: Bool to backup setup files + :param launch_ap: Bool to launch the asset processor + :param configure_settings: Bool to update settings caches + :return: None + """ # Backup - self.backup_settings() + if backupFiles: + self.backup_settings() + + # Base setup defaults to None + if launch_ap is None: + launch_ap = True # Enable Android capabilities and verify environment is setup before continuing. self._is_valid_android_environment() @@ -174,7 +188,7 @@ class AndroidLauncher(Launcher): # Modify and re-configure self.configure_settings() self.workspace.shader_compiler.start() - super(AndroidLauncher, self).setup() + super(AndroidLauncher, self).setup(backupFiles, launch_ap, configure_settings) def teardown(self): ly_test_tools.mobile.android.undo_tcp_port_changes(self._device_id) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py index c9458899b4..e1b5dab1b6 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py @@ -75,6 +75,8 @@ class Launcher(object): ~/ly_test_tools/devices.ini (a.k.a. %USERPROFILE%/ly_test_tools/devices.ini) :param backupFiles: Bool to backup setup files + :param launch_ap: Bool to launch the asset processor + :param configure_settings: Bool to update settings caches :return: None """ # Remove existing logs and dmp files before launching for self.save_project_log_files() diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py index e8931ba07f..96e827069e 100644 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py @@ -162,7 +162,7 @@ class LinuxLauncher(Launcher): def configure_settings(self): """ - Configures system level settings and syncs the launcher to the targeted console IP. + Configures system level settings :return: None """ @@ -170,7 +170,6 @@ class LinuxLauncher(Launcher): host_ip = '127.0.0.1' self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/project_path={self.workspace.paths.project()}"') self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/remote_ip={host_ip}"') - self.args.append('--regset="/Amazon/AzCore/Bootstrap/wait_for_connect=1"') self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/allowed_list={host_ip}"') self.workspace.settings.modify_platform_setting("r_ShaderCompilerServer", host_ip) @@ -186,11 +185,16 @@ class DedicatedLinuxLauncher(LinuxLauncher): :param backupFiles: Bool to backup setup files :param launch_ap: Bool to launch the asset processor + :param configure_settings: Bool to update settings caches :return: None """ + # Backup + if backupFiles: + self.backup_settings() + # Base setup defaults to None if launch_ap is None: - launch_ap = False + launch_ap = True super(DedicatedLinuxLauncher, self).setup(backupFiles, launch_ap, configure_settings) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py index ec2b3b966c..f989f7bd19 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py @@ -44,7 +44,8 @@ class WinLauncher(Launcher): Subclasses should call its parent's setup() before calling its own code, unless it changes configuration files :param backupFiles: Bool to backup setup files - :param lauch_ap: Bool to lauch the asset processor + :param launch_ap: Bool to lauch the asset processor + :param configure_settings: Bool to update settings caches :return: None """ # Backup @@ -58,7 +59,7 @@ class WinLauncher(Launcher): # Modify and re-configure if configure_settings: self.configure_settings() - super(WinLauncher, self).setup(backupFiles, launch_ap) + super(WinLauncher, self).setup(backupFiles, launch_ap, configure_settings) def launch(self): """ @@ -161,7 +162,7 @@ class WinLauncher(Launcher): def configure_settings(self): """ - Configures system level settings and syncs the launcher to the targeted console IP. + Configures system level settings :return: None """ From fd45a37c7b2504522f5faa63f70d0e6dbf36fa3f Mon Sep 17 00:00:00 2001 From: sweeneys Date: Wed, 1 Dec 2021 14:13:13 -0800 Subject: [PATCH 3/3] Restore defaults, clarify comment Signed-off-by: sweeneys --- .../launchers/platforms/android/launcher.py | 2 +- .../launchers/platforms/linux/launcher.py | 6 ++--- .../launchers/platforms/win/launcher.py | 22 ++++++++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py index 7c3efd9e9d..9433f426b5 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/android/launcher.py @@ -177,7 +177,7 @@ class AndroidLauncher(Launcher): if backupFiles: self.backup_settings() - # Base setup defaults to None + # None reverts to function default if launch_ap is None: launch_ap = True diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py index 96e827069e..377121f2e0 100644 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/linux/launcher.py @@ -52,7 +52,7 @@ class LinuxLauncher(Launcher): if backupFiles: self.backup_settings() - # Base setup defaults to None + # None reverts to function default if launch_ap is None: launch_ap = True @@ -192,9 +192,9 @@ class DedicatedLinuxLauncher(LinuxLauncher): if backupFiles: self.backup_settings() - # Base setup defaults to None + # None reverts to function default if launch_ap is None: - launch_ap = True + launch_ap = False super(DedicatedLinuxLauncher, self).setup(backupFiles, launch_ap, configure_settings) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py index f989f7bd19..c29aa7b10b 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/win/launcher.py @@ -52,7 +52,7 @@ class WinLauncher(Launcher): if backupFiles: self.backup_settings() - # Base setup defaults to None + # None reverts to function default if launch_ap is None: launch_ap = True @@ -177,6 +177,26 @@ class WinLauncher(Launcher): class DedicatedWinLauncher(WinLauncher): + def setup(self, backupFiles=True, launch_ap=False, configure_settings=True): + """ + Perform setup of this launcher, must be called before launching. + Subclasses should call its parent's setup() before calling its own code, unless it changes configuration files + + :param backupFiles: Bool to backup setup files + :param launch_ap: Bool to launch the asset processor + :param configure_settings: Bool to update settings caches + :return: None + """ + # Backup + if backupFiles: + self.backup_settings() + + # None reverts to function default + if launch_ap is None: + launch_ap = False + + super(DedicatedWinLauncher, self).setup(backupFiles, launch_ap, configure_settings) + def binary_path(self): """ Return full path to the dedicated server launcher for the build directory.