From 71781f31a779d8fd515cdb9304c2c975bbe58328 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:06:48 +0300 Subject: [PATCH 1/7] test: name SNS region scenario by its expected outcome --- .../Scenarios/SNS/BaseSnsScenario.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/LocalStack.Client.Functional.Tests/Scenarios/SNS/BaseSnsScenario.cs b/tests/LocalStack.Client.Functional.Tests/Scenarios/SNS/BaseSnsScenario.cs index 43d8f0e..9a2e39b 100644 --- a/tests/LocalStack.Client.Functional.Tests/Scenarios/SNS/BaseSnsScenario.cs +++ b/tests/LocalStack.Client.Functional.Tests/Scenarios/SNS/BaseSnsScenario.cs @@ -74,7 +74,7 @@ public async Task SnsService_Should_Send_Publish_A_Message_Async() [Theory, InlineData("eu-central-1"), InlineData("us-west-1"), InlineData("af-south-1"), InlineData("ap-southeast-1"), InlineData("ca-central-1"), InlineData("eu-west-2"), InlineData("sa-east-1")] - public virtual async Task Multi_Region_Tests_Async(string systemName) + public virtual async Task SnsService_Should_Create_A_Sns_Topic_In_The_Configured_Region_Async(string systemName) { var sessionReflection = ServiceProvider.GetRequiredService(); var amazonSimpleNotificationService = ServiceProvider.GetRequiredService(); From 18bd5ab2d5cd541e0b6a327452d4edcfcf92805a Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:07:02 +0300 Subject: [PATCH 2/7] build: reuse framework property in package version condition --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3c8e08f..c5b974a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -186,7 +186,7 @@ runtime; build; native; contentfiles; analyzers - + From 59662d960f7195d5f5f0abefa98a18ff80fd74d7 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:07:14 +0300 Subject: [PATCH 3/7] build: read framework test target from MSBuild --- build/LocalStack.Build/BuildContext.cs | 4 ++++ build/LocalStack.Build/CakeTasks/TestTask.cs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build/LocalStack.Build/BuildContext.cs b/build/LocalStack.Build/BuildContext.cs index 5c77e89..fe84ffe 100644 --- a/build/LocalStack.Build/BuildContext.cs +++ b/build/LocalStack.Build/BuildContext.cs @@ -117,6 +117,9 @@ public BuildContext(ICakeContext context) : base(context) public ConvertableFilePath LocalStackClientExtProjFile { get; } + public string LocalStackNetFrameworkTargetFramework => + GetProjectProperties(LocalStackClientProjFile.ToString(), NetFrameworkTargetFrameworkProperty)[NetFrameworkTargetFrameworkProperty]; + /// /// Gets the effective package version for LocalStack.Client package. /// This value is cached to ensure consistency across pack and publish operations. @@ -389,6 +392,7 @@ private static string ToPreReleaseIdentifier(string identifier) // Test projects that set this property are published and run as native executables by CI, not by 'dotnet test'. private const string RunsAsPublishedExecutableProperty = "LocalStackTestRunsAsPublishedExecutable"; + private const string NetFrameworkTargetFrameworkProperty = "LocalStackNetFrameworkTargetFramework"; private static string[] GetProjectTargetFrameworks(string csprojPath) => SplitTargetFrameworks(GetProjectProperties(csprojPath, "TargetFrameworks", "TargetFramework")); diff --git a/build/LocalStack.Build/CakeTasks/TestTask.cs b/build/LocalStack.Build/CakeTasks/TestTask.cs index bb2a501..983b2e4 100644 --- a/build/LocalStack.Build/CakeTasks/TestTask.cs +++ b/build/LocalStack.Build/CakeTasks/TestTask.cs @@ -17,6 +17,7 @@ public override void Run(BuildContext context) }; IEnumerable projMetadata = context.GetProjMetadata(); + string netFrameworkTargetFramework = context.LocalStackNetFrameworkTargetFramework; foreach (ProjMetadata testProj in projMetadata) { @@ -56,7 +57,7 @@ public override void Run(BuildContext context) } // The .NET 11 SDK's test platform runs .NET Framework tests on Windows only; Mono is no longer supported. - if (targetFramework == "net472" && !context.IsRunningOnWindows()) + if (targetFramework == netFrameworkTargetFramework && !context.IsRunningOnWindows()) { ConsoleHelper.WriteWarning($"Skipping {targetFramework} tests for {testProj.AssemblyName}: .NET Framework tests run on Windows only"); From cc7c7b21ea7c788ea97183ce9ecc0485504883e5 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:07:48 +0300 Subject: [PATCH 4/7] build: centralize framework property query names --- build/LocalStack.Build/BuildContext.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/LocalStack.Build/BuildContext.cs b/build/LocalStack.Build/BuildContext.cs index fe84ffe..156d19c 100644 --- a/build/LocalStack.Build/BuildContext.cs +++ b/build/LocalStack.Build/BuildContext.cs @@ -177,7 +177,7 @@ public IEnumerable GetProjMetadata() { string csProjPath = csProj.FullPath; - Dictionary properties = GetProjectProperties(csProjPath, "TargetFrameworks", "TargetFramework", RunsAsPublishedExecutableProperty); + Dictionary properties = GetProjectProperties(csProjPath, TargetFrameworksProperty, TargetFrameworkProperty, RunsAsPublishedExecutableProperty); IEnumerable targetFrameworks = SplitTargetFrameworks(properties); string directoryPath = csProj.GetDirectory().FullPath; string assemblyName = GetAssemblyName(csProjPath); @@ -392,14 +392,16 @@ private static string ToPreReleaseIdentifier(string identifier) // Test projects that set this property are published and run as native executables by CI, not by 'dotnet test'. private const string RunsAsPublishedExecutableProperty = "LocalStackTestRunsAsPublishedExecutable"; + private const string TargetFrameworksProperty = "TargetFrameworks"; + private const string TargetFrameworkProperty = "TargetFramework"; private const string NetFrameworkTargetFrameworkProperty = "LocalStackNetFrameworkTargetFramework"; private static string[] GetProjectTargetFrameworks(string csprojPath) => - SplitTargetFrameworks(GetProjectProperties(csprojPath, "TargetFrameworks", "TargetFramework")); + SplitTargetFrameworks(GetProjectProperties(csprojPath, TargetFrameworksProperty, TargetFrameworkProperty)); private static string[] SplitTargetFrameworks(Dictionary properties) { - string frameworks = string.IsNullOrWhiteSpace(properties["TargetFrameworks"]) ? properties["TargetFramework"] : properties["TargetFrameworks"]; + string frameworks = string.IsNullOrWhiteSpace(properties[TargetFrameworksProperty]) ? properties[TargetFrameworkProperty] : properties[TargetFrameworksProperty]; return frameworks.Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); } From 56f552976e67d350138ec75c63b90a159842e4e7 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:08:01 +0300 Subject: [PATCH 5/7] build: centralize source generator target framework --- Directory.Build.props | 2 ++ .../LocalStack.Client.Generators.csproj | 2 +- src/LocalStack.Client/LocalStack.Client.csproj | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 73428ad..f07a433 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -46,6 +46,8 @@ net10.0 $(LocalStackModernMinimumTargetFramework);net11.0 netstandard2.0 + + netstandard2.0 net472 $(LocalStackNetStandardTargetFramework);$(LocalStackNetFrameworkTargetFramework);$(LocalStackModernTargetFrameworks) diff --git a/src/LocalStack.Client.Generators/LocalStack.Client.Generators.csproj b/src/LocalStack.Client.Generators/LocalStack.Client.Generators.csproj index a93a653..26b7f71 100644 --- a/src/LocalStack.Client.Generators/LocalStack.Client.Generators.csproj +++ b/src/LocalStack.Client.Generators/LocalStack.Client.Generators.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + $(LocalStackAnalyzerTargetFramework) false true false diff --git a/src/LocalStack.Client/LocalStack.Client.csproj b/src/LocalStack.Client/LocalStack.Client.csproj index de13740..5a66bc2 100644 --- a/src/LocalStack.Client/LocalStack.Client.csproj +++ b/src/LocalStack.Client/LocalStack.Client.csproj @@ -34,7 +34,7 @@ - From 447726da36dc955290ce035260bdec8815de09c8 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:08:54 +0300 Subject: [PATCH 6/7] refactor: use catalog service ID for S3 path style --- src/LocalStack.Client/Utils/S3ForcePathStyle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LocalStack.Client/Utils/S3ForcePathStyle.cs b/src/LocalStack.Client/Utils/S3ForcePathStyle.cs index 083d561..b769f66 100644 --- a/src/LocalStack.Client/Utils/S3ForcePathStyle.cs +++ b/src/LocalStack.Client/Utils/S3ForcePathStyle.cs @@ -10,7 +10,7 @@ internal static class S3ForcePathStyle internal static bool TrySet(ClientConfig clientConfig, bool value) { - if (string.Equals(clientConfig.ServiceId, "S3", StringComparison.Ordinal)) + if (string.Equals(clientConfig.ServiceId, AwsServiceEndpointMetadata.S3.ServiceId, StringComparison.Ordinal)) { SetForcePathStyle(clientConfig, value); return true; From 3866954022f79b416701cfd27ca81271c7211224 Mon Sep 17 00:00:00 2001 From: Blind-Striker Date: Fri, 23 Oct 2026 23:09:57 +0300 Subject: [PATCH 7/7] test: expand session reflection callback blocks --- .../SessionTests/SessionReflectionTests.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/LocalStack.Client.Tests/SessionTests/SessionReflectionTests.cs b/tests/LocalStack.Client.Tests/SessionTests/SessionReflectionTests.cs index 5cbffb3..3a5c30c 100644 --- a/tests/LocalStack.Client.Tests/SessionTests/SessionReflectionTests.cs +++ b/tests/LocalStack.Client.Tests/SessionTests/SessionReflectionTests.cs @@ -41,11 +41,24 @@ public void CreateClientByInterface_Should_Keep_Injected_Config_Identity_And_Err var reflection = new Mock(MockBehavior.Strict); Type expectedType = typeof(MockAmazonServiceClient); reflection.Setup(helper => helper.ExtractServiceMetadata(expectedType)) - .Returns(() => { calls.Add("metadata"); return metadata.Object; }); + .Returns(() => + { + calls.Add("metadata"); + return metadata.Object; + }); reflection.Setup(helper => helper.CreateClientConfig(expectedType)) - .Returns(() => { calls.Add("config"); return config; }); + .Returns(() => + { + calls.Add("config"); + return config; + }); reflection.Setup(helper => helper.SetForcePathStyle(config, true)) - .Returns(() => { calls.Add("style"); config.ForcePathStyle = true; return true; }); + .Returns(() => + { + calls.Add("style"); + config.ForcePathStyle = true; + return true; + }); var session = new Session(new SessionOptions(regionName: "eu-west-2"), new Config(new ConfigOptions()), reflection.Object); using AmazonServiceClient client = byInterface ? session.CreateClientByInterface()