diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/CMakeLists.txt b/Code/Tools/TestImpactFramework/Frontend/Console/CMakeLists.txt new file mode 100644 index 0000000000..a25d506156 --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +add_subdirectory(Executable) +add_subdirectory(Static) \ No newline at end of file diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Executable/CMakeLists.txt b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/CMakeLists.txt new file mode 100644 index 0000000000..8298bb7123 --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +add_subdirectory(Code) \ No newline at end of file diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/CMakeLists.txt b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/CMakeLists.txt new file mode 100644 index 0000000000..88da472e1e --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +ly_add_target( + NAME TestImpact.Frontend.Console EXECUTABLE + OUTPUT_NAME tiaf + NAMESPACE AZ + FILES_CMAKE + testimpactframework_frontend_console_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::TestImpact.Frontend.Console.Static +) + diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/testimpactframework_frontend_console_files.cmake b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/testimpactframework_frontend_console_files.cmake new file mode 100644 index 0000000000..19e99649a7 --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/testimpactframework_frontend_console_files.cmake @@ -0,0 +1,14 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES + Source/TestImpactConsole.cpp +) diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/testimpactframework_frontend_console_tests_files.cmake b/Code/Tools/TestImpactFramework/Frontend/Console/Executable/Code/testimpactframework_frontend_console_tests_files.cmake new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Static/CMakeLists.txt b/Code/Tools/TestImpactFramework/Frontend/Console/Static/CMakeLists.txt new file mode 100644 index 0000000000..8298bb7123 --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Static/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +add_subdirectory(Code) \ No newline at end of file diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/CMakeLists.txt b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/CMakeLists.txt new file mode 100644 index 0000000000..2302cb5484 --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/CMakeLists.txt @@ -0,0 +1,50 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +ly_add_target( + NAME TestImpact.Frontend.Console.Static STATIC + NAMESPACE AZ + FILES_CMAKE + testimpactframework_frontend_console_static_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Include + PRIVATE + Source + BUILD_DEPENDENCIES + PUBLIC + AZ::TestImpact.Runtime.Static +) + +################################################################################ +# Tests +################################################################################ + +ly_add_target( + NAME TestImpact.Frontend.Console.Static.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE AZ + FILES_CMAKE + testimpactframework_frontend_console_static_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Include + Source + Tests + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTestShared + AZ::AzTest + AZ::TestImpact.Frontend.Console.Static +) + +ly_add_googletest( + NAME AZ::TestImpact.Frontend.Console.Static.Tests +) diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_files.cmake b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_files.cmake new file mode 100644 index 0000000000..97081dc08c --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_files.cmake @@ -0,0 +1,26 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES + Include/TestImpactFramework/TestImpactConsoleMain.h + Source/TestImpactCommandLineOptions.h + Source/TestImpactCommandLineOptions.cpp + Source/TestImpactCommandLineOptionsUtils.cpp + Source/TestImpactCommandLineOptionsUtils.h + Source/TestImpactCommandLineOptionsException.h + Source/TestImpactRuntimeConfigurationFactory.h + Source/TestImpactRuntimeConfigurationFactory.cpp + Source/TestImpactConsoleMain.cpp + Source/TestImpactConsoleTestSequenceEventHandler.cpp + Source/TestImpactConsoleTestSequenceEventHandler.h + Source/TestImpactConsoleUtils.cpp + Source/TestImpactConsoleUtils.h +) diff --git a/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_tests_files.cmake b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_tests_files.cmake new file mode 100644 index 0000000000..4e45f540ad --- /dev/null +++ b/Code/Tools/TestImpactFramework/Frontend/Console/Static/Code/testimpactframework_frontend_console_static_tests_files.cmake @@ -0,0 +1,14 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES + +) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake index 2053a1ea5e..250894464b 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake +++ b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake @@ -35,8 +35,6 @@ set(FILES Source/Artifact/Factory/TestImpactTestTargetMetaMapFactory.h Source/Artifact/Factory/TestImpactModuleCoverageFactory.cpp Source/Artifact/Factory/TestImpactModuleCoverageFactory.h - Source/Artifact/Factory/TestImpactDependencyGraphDataFactory.cpp - Source/Artifact/Factory/TestImpactDependencyGraphDataFactory.h Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp Source/Artifact/Static/TestImpactBuildTargetDescriptor.h Source/Artifact/Static/TestImpactTargetDescriptorCompiler.cpp diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_tests_files.cmake b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_tests_files.cmake new file mode 100644 index 0000000000..5714be5dfb --- /dev/null +++ b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_tests_files.cmake @@ -0,0 +1,13 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES +) diff --git a/cmake/TestImpactFramework/ConsoleFrontendConfig.in b/cmake/TestImpactFramework/ConsoleFrontendConfig.in index 357499771c..9338672fbd 100644 --- a/cmake/TestImpactFramework/ConsoleFrontendConfig.in +++ b/cmake/TestImpactFramework/ConsoleFrontendConfig.in @@ -3,6 +3,13 @@ "platform": "${platform}", "timestamp": "${timestamp}" }, + "jenkins": { + "pipeline_of_truth" : [ + "nightly-incremental", + "nightly-clean" + ], + "use_test_impact_analysis": ${use_tiaf} + }, "repo": { "root": "${repo_dir}", "tiaf_bin": "${tiaf_bin}" diff --git a/cmake/TestImpactFramework/LYTestImpactFramework.cmake b/cmake/TestImpactFramework/LYTestImpactFramework.cmake index 54dadbd8ad..661a066477 100644 --- a/cmake/TestImpactFramework/LYTestImpactFramework.cmake +++ b/cmake/TestImpactFramework/LYTestImpactFramework.cmake @@ -344,9 +344,14 @@ function(ly_test_impact_write_config_file CONFIG_TEMPLATE_FILE PERSISTENT_DATA_D # Instrumentation binary if(NOT LY_TEST_IMPACT_INSTRUMENTATION_BIN) - message(FATAL_ERROR "No test impact framework instrumentation binary was specified, please provide the path with option LY_TEST_IMPACT_INSTRUMENTATION_BIN") + # No binary specified is not an error, it just means that the test impact analysis part of the framework is disabled + message("No test impact framework instrumentation binary was specified, test impact analysis framework will fall back to regular test sequences instead") + set(use_tiaf false) + set(instrumentation_bin "") + else() + set(use_tiaf true) + file(TO_CMAKE_PATH ${LY_TEST_IMPACT_INSTRUMENTATION_BIN} instrumentation_bin) endif() - file(TO_CMAKE_PATH ${LY_TEST_IMPACT_INSTRUMENTATION_BIN} instrumentation_bin) # Testrunner binary set(test_runner_bin $) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 2f6be2b060..5c11efe5a8 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -447,7 +447,7 @@ try { // repositoryName is the full repository name repositoryName = (repositoryUrl =~ /https:\/\/github.com\/(.*)\.git/)[0][1] (projectName, pipelineName) = GetRunningPipelineName(env.JOB_NAME) // env.JOB_NAME is the name of the job given by Jenkins - + env.PIPELINE_NAME = pipelineName if(env.BRANCH_NAME) { branchName = env.BRANCH_NAME } else { diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index 5dede68d92..be729c2b7f 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -22,16 +22,17 @@ ], "steps": [ "debug_vs2019", - "test_impact_seed", "test_debug_vs2019" ] }, "profile_vs2019_pipe": { "TAGS": [ - "default" + "default", + "nightly-incremental", + "nightly-clean" ], "steps": [ - "profile_vs2019", + "profile_vs2019", "test_impact_analysis", "asset_profile_vs2019", "test_cpu_profile_vs2019" @@ -81,22 +82,13 @@ "SCRIPT_PARAMETERS": "--platform 3rdParty --type 3rdParty_all" } }, - "test_impact_seed": { - "TAGS": [ - ], - "COMMAND": "python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/TestImpactAnalysis/tiaf_driver.py", - "SCRIPT_PARAMETERS": "--sequenceType seed --config \"build\\windows_vs2019\\bin\\TestImpactFramework\\persistent\\tiaf.debug.json\"" - } - }, "test_impact_analysis": { "TAGS": [ ], "COMMAND": "python_windows.cmd", "PARAMETERS": { "SCRIPT_PATH": "scripts/build/TestImpactAnalysis/tiaf_driver.py", - "SCRIPT_PARAMETERS": "--sequenceType tia --destCommit !CHANGE_ID! --config \"build\\windows_vs2019\\bin\\TestImpactFramework\\persistent\\tiaf.profile.json\"" + "SCRIPT_PARAMETERS": "--safeMode --suite main --pipeline !PIPELINE_NAME! --destCommit !CHANGE_ID! --config \"build\\windows_vs2019\\bin\\TestImpactFramework\\persistent\\tiaf.profile.json\"" } }, "debug_vs2019": { @@ -107,7 +99,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE -DLY_TEST_IMPACT_ACTIVE=1 -DLY_TEST_IMPACT_INSTRUMENTATION_BIN=\"c:\\ly\\3rdParty\\ackages\\OpenCppCoverage\\Binary\\windows-x64\\OpenCppCoverage.exe\"", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -139,7 +131,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_TEST_IMPACT_ACTIVE=1 -DLY_TEST_IMPACT_INSTRUMENTATION_BIN=\"c:\\ly\\3rdParty\\ackages\\OpenCppCoverage\\Binary\\windows-x64\\OpenCppCoverage.exe\"", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_TEST_IMPACT_ACTIVE=1 -DLY_TEST_IMPACT_INSTRUMENTATION_BIN=!TEST_IMPACT_WIN_BINARY!", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"