From 10d69abb4e0d3d492c0c4613effb7ac13801fd75 Mon Sep 17 00:00:00 2001 From: June Rhodes Date: Sat, 23 Nov 2024 18:32:23 +1100 Subject: [PATCH] Add support for predefining tests and using them in `uet test` (#56) --- .../Plugin/Custom/CustomPluginTestProvider.cs | 1 - .../BuildGraphGeneratorTests.cs | 1 + .../DynamicBuildGraphIncludeTests.cs | 1 + .../BuildGraph/BuildGraph_Plugin.xml | 7 +- .../DefaultDynamicBuildGraphIncludeWriter.cs | 58 +++- .../IDynamicBuildGraphIncludeWriter.cs | 2 + .../BuildConfigSourceGenerationContext.cs | 1 + .../Dynamic/BuildConfigDynamic.cs | 1 + .../Dynamic/BuildConfigDynamicConverter.cs | 166 ++-------- .../BuildConfigDynamicConverterHelpers.cs | 208 ++++++++++++ .../Dynamic/BuildConfigPredefinedDynamic.cs | 25 ++ .../BuildConfigPredefinedDynamicConverter.cs | 95 ++++++ .../BuildConfigTestPredefinedConverter.cs | 13 + .../Plugin/BuildConfigPlugin.cs | 8 + ...dConfigPluginPredefinedTestDependencies.cs | 28 ++ UET/uet/Commands/Build/BuildCommand.cs | 4 +- .../DefaultBuildSpecificationGenerator.cs | 11 +- .../Build/IBuildSpecificationGenerator.cs | 4 +- .../DefaultJsonSchemaGenerator.cs | 35 ++ UET/uet/Commands/Test/TestCommand.cs | 312 ++++++++++++------ 20 files changed, 728 insertions(+), 253 deletions(-) create mode 100644 UET/Redpoint.Uet.Configuration/Dynamic/BuildConfigDynamicConverterHelpers.cs create mode 100644 UET/Redpoint.Uet.Configuration/Dynamic/BuildConfigPredefinedDynamic.cs create mode 100644 UET/Redpoint.Uet.Configuration/Dynamic/BuildConfigPredefinedDynamicConverter.cs create mode 100644 UET/Redpoint.Uet.Configuration/Dynamic/BuildConfigTestPredefinedConverter.cs create mode 100644 UET/Redpoint.Uet.Configuration/Plugin/BuildConfigPluginPredefinedTestDependencies.cs diff --git a/UET/Redpoint.Uet.BuildPipeline.Providers.Test/Plugin/Custom/CustomPluginTestProvider.cs b/UET/Redpoint.Uet.BuildPipeline.Providers.Test/Plugin/Custom/CustomPluginTestProvider.cs index dbbb3c5e..9ad10d23 100644 --- a/UET/Redpoint.Uet.BuildPipeline.Providers.Test/Plugin/Custom/CustomPluginTestProvider.cs +++ b/UET/Redpoint.Uet.BuildPipeline.Providers.Test/Plugin/Custom/CustomPluginTestProvider.cs @@ -22,7 +22,6 @@ public CustomPluginTestProvider( public IRuntimeJson DynamicSettings { get; } = new TestProviderRuntimeJson(TestProviderSourceGenerationContext.WithStringEnum).BuildConfigPluginTestCustom; - public async Task WriteBuildGraphNodesAsync( IBuildGraphEmitContext context, XmlWriter writer, diff --git a/UET/Redpoint.Uet.BuildPipeline.Tests/BuildGraphGeneratorTests.cs b/UET/Redpoint.Uet.BuildPipeline.Tests/BuildGraphGeneratorTests.cs index 6d919d54..137b45b5 100644 --- a/UET/Redpoint.Uet.BuildPipeline.Tests/BuildGraphGeneratorTests.cs +++ b/UET/Redpoint.Uet.BuildPipeline.Tests/BuildGraphGeneratorTests.cs @@ -128,6 +128,7 @@ public async void CanGenerateBuildGraphForPlugin() { $"Allow2019", $"false" }, { $"EnginePrefix", $"Unreal" }, { $"ExecutePackage", $"false" }, + { $"ExecuteZip", $"false" }, { $"VersionNumber", $"10000" }, { $"VersionName", $"2023.05.17" }, { $"PackageName", $"Packaged" }, diff --git a/UET/Redpoint.Uet.BuildPipeline.Tests/DynamicBuildGraphIncludeTests.cs b/UET/Redpoint.Uet.BuildPipeline.Tests/DynamicBuildGraphIncludeTests.cs index b2594674..6318be65 100644 --- a/UET/Redpoint.Uet.BuildPipeline.Tests/DynamicBuildGraphIncludeTests.cs +++ b/UET/Redpoint.Uet.BuildPipeline.Tests/DynamicBuildGraphIncludeTests.cs @@ -52,6 +52,7 @@ public async Task TestPluginTests() await writer.WriteBuildGraphNodeInclude( memory, false, + new BuildConfigPlugin(), new BuildConfigPluginDistribution { Name = "Test", diff --git a/UET/Redpoint.Uet.BuildPipeline/BuildGraph/BuildGraph_Plugin.xml b/UET/Redpoint.Uet.BuildPipeline/BuildGraph/BuildGraph_Plugin.xml index 9da5e5f3..f68d99a9 100644 --- a/UET/Redpoint.Uet.BuildPipeline/BuildGraph/BuildGraph_Plugin.xml +++ b/UET/Redpoint.Uet.BuildPipeline/BuildGraph/BuildGraph_Plugin.xml @@ -34,6 +34,7 @@