From 7a4cedab88655babea04f5265e258763b9cbbadd Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Thu, 12 Oct 2023 15:01:44 -0700 Subject: [PATCH] Fix with RuntimeSupport integ tests where Xunit attempts to run the test from the base class and fails. --- .../CustomRuntimeTests.cs | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/CustomRuntimeTests.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/CustomRuntimeTests.cs index b4488ef9f..c0bc21727 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/CustomRuntimeTests.cs +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/CustomRuntimeTests.cs @@ -36,6 +36,16 @@ public CustomRuntimeNET6Tests() : base("CustomRuntimeNET6FunctionTest-" + DateTime.Now.Ticks, "CustomRuntimeFunctionTest.zip", @"CustomRuntimeFunctionTest\bin\Release\net6.0\CustomRuntimeFunctionTest.zip", "CustomRuntimeFunctionTest", TargetFramework.NET6) { } + +#if SKIP_RUNTIME_SUPPORT_INTEG_TESTS + [Fact(Skip = "Skipped intentionally by setting the SkipRuntimeSupportIntegTests build parameter.")] +#else + [Fact] +#endif + public async Task TestAllNET6HandlersAsync() + { + await base.TestAllHandlersAsync(); + } } public class CustomRuntimeNET8Tests : CustomRuntimeTests @@ -44,6 +54,16 @@ public CustomRuntimeNET8Tests() : base("CustomRuntimeNET8FunctionTest-" + DateTime.Now.Ticks, "CustomRuntimeFunctionTest.zip", @"CustomRuntimeFunctionTest\bin\Release\net8.0\CustomRuntimeFunctionTest.zip", "CustomRuntimeFunctionTest", TargetFramework.NET8) { } + +#if SKIP_RUNTIME_SUPPORT_INTEG_TESTS + [Fact(Skip = "Skipped intentionally by setting the SkipRuntimeSupportIntegTests build parameter.")] +#else + [Fact] +#endif + public async Task TestAllNET8HandlersAsync() + { + await base.TestAllHandlersAsync(); + } } public class CustomRuntimeTests : BaseCustomRuntimeTest @@ -58,12 +78,7 @@ public CustomRuntimeTests(string functionName, string deploymentZipKey, string d _targetFramework = targetFramework; } -#if SKIP_RUNTIME_SUPPORT_INTEG_TESTS - [Fact(Skip = "Skipped intentionally by setting the SkipRuntimeSupportIntegTests build parameter.")] -#else - [Fact] -#endif - public async Task TestAllHandlersAsync() + protected virtual async Task TestAllHandlersAsync() { // run all test cases in one test to ensure they run serially using (var lambdaClient = new AmazonLambdaClient(TestRegion))