From 1c13b301fe2a48df8896702a26139859688f5c76 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 23 Apr 2021 09:43:11 -0700 Subject: [PATCH] SPEC-5070 Move ctest_scripts to scripts/ctest * removing unused function and moving ctest_scripts to scripts/ctest * Re-adding ebp-test * Fixing typo that is making this test run in parallel with other tests * Fixing hang when parameters are passed * passing absolute path as a project * small tweak to not print out during Python execution * Moving the timeout to be in the build step * Disable ebo_sanity_smoke_no_gpu Co-authored-by: jackalbe <23512001+jackalbe@users.noreply.github.com> --- CMakeLists.txt | 3 --- Code/CryEngine/CrySystem/CmdLine.cpp | 1 + .../Code/Source/PythonSystemComponent.cpp | 2 +- cmake/LYTestWrappers.cmake | 14 ++++++++------ cmake/cmake_files.cmake | 1 + scripts/CMakeLists.txt | 1 + {ctest_scripts => scripts/ctest}/CMakeLists.txt | 13 +++++++++++++ {ctest_scripts => scripts/ctest}/ctest_driver.py | 0 .../ctest}/ctest_driver_test.py | 0 .../ctest}/ctest_entrypoint.cmd | 0 .../ctest}/ctest_entrypoint.sh | 0 .../ctest}/epb_sanity_test.py | 0 .../ctest}/result_processing/__init__.py | 0 .../ctest}/result_processing/result_processing.py | 0 {ctest_scripts => scripts/ctest}/sanity_test.py | 0 15 files changed, 25 insertions(+), 10 deletions(-) rename {ctest_scripts => scripts/ctest}/CMakeLists.txt (85%) rename {ctest_scripts => scripts/ctest}/ctest_driver.py (100%) rename {ctest_scripts => scripts/ctest}/ctest_driver_test.py (100%) rename {ctest_scripts => scripts/ctest}/ctest_entrypoint.cmd (100%) rename {ctest_scripts => scripts/ctest}/ctest_entrypoint.sh (100%) rename {ctest_scripts => scripts/ctest}/epb_sanity_test.py (100%) rename {ctest_scripts => scripts/ctest}/result_processing/__init__.py (100%) rename {ctest_scripts => scripts/ctest}/result_processing/result_processing.py (100%) rename {ctest_scripts => scripts/ctest}/sanity_test.py (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18fb86ff09..91cea3f0bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,9 +74,6 @@ foreach(restricted_platform ${PAL_RESTRICTED_PLATFORMS}) endif() endforeach() -# Recurse into directory of general python test scripts -add_subdirectory(ctest_scripts) - add_subdirectory(scripts) # SPEC-1417 will investigate and fix this diff --git a/Code/CryEngine/CrySystem/CmdLine.cpp b/Code/CryEngine/CrySystem/CmdLine.cpp index 15e655ddcb..07fbf6aa15 100644 --- a/Code/CryEngine/CrySystem/CmdLine.cpp +++ b/Code/CryEngine/CrySystem/CmdLine.cpp @@ -185,6 +185,7 @@ string CCmdLine::Next(char*& src) return string(org, src - 1); case ' ': + ch = *src++; continue; default: org = src - 1; diff --git a/Gems/EditorPythonBindings/Code/Source/PythonSystemComponent.cpp b/Gems/EditorPythonBindings/Code/Source/PythonSystemComponent.cpp index 11ac32cede..d2d119a02d 100644 --- a/Gems/EditorPythonBindings/Code/Source/PythonSystemComponent.cpp +++ b/Gems/EditorPythonBindings/Code/Source/PythonSystemComponent.cpp @@ -550,7 +550,7 @@ namespace EditorPythonBindings } if (appended) { - ExecuteByString(pathAppend.c_str(), true); + ExecuteByString(pathAppend.c_str(), false); return true; } return false; diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 73a212ee0b..6bd809ec41 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -337,22 +337,24 @@ function(ly_add_editor_python_test) message(FATAL_ERROR "Must supply a value for TEST_SUITE") endif() + file(REAL_PATH ${ly_add_editor_python_test_TEST_PROJECT} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER}) + # Run test via the run_epbtest.cmake script. # Parameters used are explained in run_epbtest.cmake. ly_add_test( NAME ${ly_add_editor_python_test_NAME} TEST_REQUIRES ${ly_add_editor_python_test_TEST_REQUIRES} TEST_COMMAND ${CMAKE_COMMAND} - -DCMD_ARG_TEST_PROJECT=${ly_add_editor_python_test_TEST_PROJECT} + -DCMD_ARG_TEST_PROJECT=${project_real_path} -DCMD_ARG_EDITOR=$ -DCMD_ARG_PYTHON_SCRIPT=${ly_add_editor_python_test_PATH} -DPLATFORM=${PAL_PLATFORM_NAME} -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/run_epbtest.cmake RUNTIME_DEPENDENCIES - ${ly_add_editor_python_test_RUNTIME_DEPENDENCIES} - Gem::EditorPythonBindings.Editor - Legacy::CryRenderNULL - Legacy::Editor + ${ly_add_editor_python_test_RUNTIME_DEPENDENCIES} + Gem::EditorPythonBindings.Editor + Legacy::CryRenderNULL + Legacy::Editor TEST_SUITE ${ly_add_editor_python_test_TEST_SUITE} LABELS FRAMEWORK_pytest TEST_LIBRARY pytest_editor @@ -360,7 +362,7 @@ function(ly_add_editor_python_test) COMPONENT ${ly_add_editor_python_test_COMPONENT} ) - set_tests_properties(${LY_ADDED_TEST_NAME} PROPERTIES RUN_SERIAL "${ly_add_pytest_TEST_SERIAL}") + set_tests_properties(${LY_ADDED_TEST_NAME} PROPERTIES RUN_SERIAL "${ly_add_editor_python_test_TEST_SERIAL}") set_property(GLOBAL APPEND PROPERTY LY_ALL_TESTS_${LY_ADDED_TEST_NAME}_SCRIPT_PATH ${ly_add_editor_python_test_PATH}) endfunction() diff --git a/cmake/cmake_files.cmake b/cmake/cmake_files.cmake index 2b0f65ca99..b0277e96f5 100644 --- a/cmake/cmake_files.cmake +++ b/cmake/cmake_files.cmake @@ -29,6 +29,7 @@ set(FILES PAL.cmake PALTools.cmake Projects.cmake + run_epbtest.cmake RuntimeDependencies.cmake SettingsRegistry.cmake UnitTest.cmake diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8413456ba2..d2843a9013 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -12,3 +12,4 @@ add_subdirectory(detect_file_changes) add_subdirectory(commit_validation) add_subdirectory(project_manager) +add_subdirectory(ctest) diff --git a/ctest_scripts/CMakeLists.txt b/scripts/ctest/CMakeLists.txt similarity index 85% rename from ctest_scripts/CMakeLists.txt rename to scripts/ctest/CMakeLists.txt index e1979dba6e..f9824889e3 100644 --- a/ctest_scripts/CMakeLists.txt +++ b/scripts/ctest/CMakeLists.txt @@ -64,6 +64,19 @@ foreach(suite_name ${LY_TEST_GLOBAL_KNOWN_SUITE_NAMES}) ) endforeach() +# EPB Sanity test is being registered here to validate that the ly_add_editor_python_test function works. +#if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedTesting IN_LIST LY_PROJECTS_TARGET_NAME) +# ly_add_editor_python_test( +# NAME epb_sanity_smoke_no_gpu +# TEST_PROJECT AutomatedTesting +# PATH ${CMAKE_CURRENT_LIST_DIR}/epb_sanity_test.py +# TEST_SUITE smoke +# TEST_SERIAL TRUE +# RUNTIME_DEPENDENCIES +# AutomatedTesting.Assets +# ) +#endif() + # add a custom test which makes sure that the test filtering works! ly_add_test( diff --git a/ctest_scripts/ctest_driver.py b/scripts/ctest/ctest_driver.py similarity index 100% rename from ctest_scripts/ctest_driver.py rename to scripts/ctest/ctest_driver.py diff --git a/ctest_scripts/ctest_driver_test.py b/scripts/ctest/ctest_driver_test.py similarity index 100% rename from ctest_scripts/ctest_driver_test.py rename to scripts/ctest/ctest_driver_test.py diff --git a/ctest_scripts/ctest_entrypoint.cmd b/scripts/ctest/ctest_entrypoint.cmd similarity index 100% rename from ctest_scripts/ctest_entrypoint.cmd rename to scripts/ctest/ctest_entrypoint.cmd diff --git a/ctest_scripts/ctest_entrypoint.sh b/scripts/ctest/ctest_entrypoint.sh similarity index 100% rename from ctest_scripts/ctest_entrypoint.sh rename to scripts/ctest/ctest_entrypoint.sh diff --git a/ctest_scripts/epb_sanity_test.py b/scripts/ctest/epb_sanity_test.py similarity index 100% rename from ctest_scripts/epb_sanity_test.py rename to scripts/ctest/epb_sanity_test.py diff --git a/ctest_scripts/result_processing/__init__.py b/scripts/ctest/result_processing/__init__.py similarity index 100% rename from ctest_scripts/result_processing/__init__.py rename to scripts/ctest/result_processing/__init__.py diff --git a/ctest_scripts/result_processing/result_processing.py b/scripts/ctest/result_processing/result_processing.py similarity index 100% rename from ctest_scripts/result_processing/result_processing.py rename to scripts/ctest/result_processing/result_processing.py diff --git a/ctest_scripts/sanity_test.py b/scripts/ctest/sanity_test.py similarity index 100% rename from ctest_scripts/sanity_test.py rename to scripts/ctest/sanity_test.py