From 54cd220dd126097bffb6f1b5a717583166167459 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Mon, 10 Feb 2025 14:36:18 -0800 Subject: [PATCH 1/7] initial commit --- Directory.Packages.props | 74 +++++++++++++++++++ nuget.config | 2 - .../AzureFunctionsApp.csproj | 10 +-- .../AzureFunctionsApp.Tests.csproj | 10 +-- samples/ConsoleApp/ConsoleApp.csproj | 2 +- .../ConsoleAppMinimal.csproj | 2 +- .../NetFxConsoleApp/NetFxConsoleApp.csproj | 6 +- samples/WebAPI/WebAPI.csproj | 6 +- src/Abstractions/Abstractions.csproj | 10 +-- src/Analyzers/Analyzers.csproj | 8 +- .../AzureManaged/Client.AzureManaged.csproj | 6 +- src/Client/Core/Client.csproj | 2 +- src/Client/Grpc/Client.Grpc.csproj | 4 +- src/Directory.Build.targets | 4 +- src/Generators/Generators.csproj | 5 +- src/Grpc/Grpc.csproj | 8 +- src/Shared/Shared.csproj | 6 +- .../AzureManaged/Worker.AzureManaged.csproj | 6 +- src/Worker/Core/Worker.csproj | 6 +- test/Analyzers.Tests/Analyzers.Tests.csproj | 6 +- test/Benchmarks/Benchmarks.csproj | 10 +-- .../Client.AzureManaged.Tests.csproj | 2 +- test/Client/Core.Tests/Client.Tests.csproj | 2 +- .../Grpc.Tests/Client.Grpc.Tests.csproj | 2 +- ...rchestrationServiceClientShim.Tests.csproj | 2 +- test/Directory.Build.targets | 20 ++--- test/Generators.Tests/Generators.Tests.csproj | 12 +-- .../Grpc.IntegrationTests.csproj | 4 +- .../Shared.AzureManaged.Tests.csproj | 4 +- test/TestHelpers/TestHelpers.csproj | 6 +- .../Worker.AzureManaged.Tests.csproj | 2 +- test/Worker/Core.Tests/Worker.Tests.csproj | 2 +- .../Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 33 files changed, 163 insertions(+), 90 deletions(-) create mode 100644 Directory.Packages.props diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..540594a3 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,74 @@ + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget.config b/nuget.config index 1dfe90ff..6f509391 100644 --- a/nuget.config +++ b/nuget.config @@ -2,8 +2,6 @@ - - \ No newline at end of file diff --git a/samples/AzureFunctionsApp/AzureFunctionsApp.csproj b/samples/AzureFunctionsApp/AzureFunctionsApp.csproj index b0563376..1e56f9fd 100644 --- a/samples/AzureFunctionsApp/AzureFunctionsApp.csproj +++ b/samples/AzureFunctionsApp/AzureFunctionsApp.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + diff --git a/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj b/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj index b818c269..9de0036d 100644 --- a/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj +++ b/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj @@ -10,11 +10,11 @@ - - - - - + + + + + diff --git a/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index 2434e53d..36bad25c 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -7,7 +7,7 @@ - + @@ -24,8 +25,8 @@ - - + + diff --git a/src/Grpc/Grpc.csproj b/src/Grpc/Grpc.csproj index 394b4787..4839af20 100644 --- a/src/Grpc/Grpc.csproj +++ b/src/Grpc/Grpc.csproj @@ -5,16 +5,16 @@ The gRPC Protobuf .NET services for Durable Task Framework. - - + + - + - + diff --git a/src/Shared/Shared.csproj b/src/Shared/Shared.csproj index b227c9f8..76b3bed6 100644 --- a/src/Shared/Shared.csproj +++ b/src/Shared/Shared.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/Worker/AzureManaged/Worker.AzureManaged.csproj b/src/Worker/AzureManaged/Worker.AzureManaged.csproj index 9f3b877d..4e7aefd6 100644 --- a/src/Worker/AzureManaged/Worker.AzureManaged.csproj +++ b/src/Worker/AzureManaged/Worker.AzureManaged.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/src/Worker/Core/Worker.csproj b/src/Worker/Core/Worker.csproj index b96e25b1..5791edf7 100644 --- a/src/Worker/Core/Worker.csproj +++ b/src/Worker/Core/Worker.csproj @@ -9,9 +9,9 @@ The worker is responsible for processing durable task work items. - - - + + + diff --git a/test/Analyzers.Tests/Analyzers.Tests.csproj b/test/Analyzers.Tests/Analyzers.Tests.csproj index ecb20528..5d61a544 100644 --- a/test/Analyzers.Tests/Analyzers.Tests.csproj +++ b/test/Analyzers.Tests/Analyzers.Tests.csproj @@ -1,9 +1,9 @@  - - - + + + diff --git a/test/Benchmarks/Benchmarks.csproj b/test/Benchmarks/Benchmarks.csproj index 9c134d6d..dab4ee1e 100644 --- a/test/Benchmarks/Benchmarks.csproj +++ b/test/Benchmarks/Benchmarks.csproj @@ -6,11 +6,11 @@ - - - - - + + + + + diff --git a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj index d7f4726c..22142fa2 100644 --- a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj +++ b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/Client/Core.Tests/Client.Tests.csproj b/test/Client/Core.Tests/Client.Tests.csproj index 359a46cb..719e8c7d 100644 --- a/test/Client/Core.Tests/Client.Tests.csproj +++ b/test/Client/Core.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj index 7f0e11ed..6d3dba79 100644 --- a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj +++ b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj b/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj index ba94969a..0ce8bb2a 100644 --- a/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj +++ b/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 1bd854ed..911567b5 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -4,22 +4,22 @@ Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, $(_DirectoryBuildTargetsFile)))' != '' " /> - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Generators.Tests/Generators.Tests.csproj b/test/Generators.Tests/Generators.Tests.csproj index e112e03a..79d9c0b2 100644 --- a/test/Generators.Tests/Generators.Tests.csproj +++ b/test/Generators.Tests/Generators.Tests.csproj @@ -1,15 +1,15 @@  - + - - - - - + + + + + diff --git a/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj b/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj index 2762089b..2e6fd37e 100644 --- a/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj +++ b/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj index a30522af..849b655f 100644 --- a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj +++ b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/TestHelpers/TestHelpers.csproj b/test/TestHelpers/TestHelpers.csproj index 6ad0bad4..55514082 100644 --- a/test/TestHelpers/TestHelpers.csproj +++ b/test/TestHelpers/TestHelpers.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj index c22ad3f9..4a5a7cc1 100644 --- a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj +++ b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/Worker/Core.Tests/Worker.Tests.csproj b/test/Worker/Core.Tests/Worker.Tests.csproj index 5c45e194..bd2da07a 100644 --- a/test/Worker/Core.Tests/Worker.Tests.csproj +++ b/test/Worker/Core.Tests/Worker.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index 7547f853..cda2aa55 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -5,7 +5,7 @@ - + From 837bb5a9519d1569384c46aa49173d7c01b7454e Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 11 Feb 2025 20:40:52 -0800 Subject: [PATCH 2/7] udpate by comment --- Directory.Packages.props | 87 +++++++++++-------- .../Grpc.Tests/Client.Grpc.Tests.csproj | 2 +- .../Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 3 files changed, 52 insertions(+), 39 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 540594a3..1b3c3b57 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,67 +8,80 @@ - - - - - - - - - - - + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - - + + + - - - - - - - - - - + + + + + + - - - - \ No newline at end of file + diff --git a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj index 6d3dba79..eabf4a0e 100644 --- a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj +++ b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net48 + net6.0 diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index cda2aa55..d256e4a4 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net48 + net6.0 From ff451b72ffbf12fe497244884ae7a473b3c04c02 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 11 Feb 2025 20:44:19 -0800 Subject: [PATCH 3/7] upgrade durabletask.sidecar to v1.1.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1b3c3b57..e8ddf7ee 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From 288b7c32c7e5249f06283a29944f5850ca91a5d1 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 11 Feb 2025 20:54:33 -0800 Subject: [PATCH 4/7] fix typo --- samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj b/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj index 9de0036d..faa8299a 100644 --- a/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj +++ b/samples/AzureFunctionsUnitTests/AzureFunctionsApp.Tests.csproj @@ -14,7 +14,7 @@ - + From 7331c069977c1e395094df6cb24b28875fb63412 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 18 Feb 2025 14:44:33 -0800 Subject: [PATCH 5/7] udpate with comments --- Directory.Packages.props | 33 ++++++++----------- .../Grpc.Tests/Client.Grpc.Tests.csproj | 2 +- .../Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index e8ddf7ee..a1e78379 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,8 +7,8 @@ true + - @@ -20,18 +20,21 @@ + - - + + + + + - - + + - @@ -39,16 +42,8 @@ + - - - - - - - - - @@ -60,28 +55,28 @@ + - - - + + - + diff --git a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj index eabf4a0e..6d3dba79 100644 --- a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj +++ b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net6.0;net48 diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index d256e4a4..cda2aa55 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net48 From 6af3c93b4d53112554efd431f63d86c36ea806ed Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 18 Feb 2025 14:50:19 -0800 Subject: [PATCH 6/7] add samples cpm file --- samples/Directory.Packages.props | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 samples/Directory.Packages.props diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props new file mode 100644 index 00000000..82f79555 --- /dev/null +++ b/samples/Directory.Packages.props @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8e35c6296c412cfb92a5a5cfb7e1c602cded2e97 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 18 Feb 2025 15:23:46 -0800 Subject: [PATCH 7/7] udpate sample test to pass CI --- samples/AzureFunctionsUnitTests/SampleUnitTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/AzureFunctionsUnitTests/SampleUnitTests.cs b/samples/AzureFunctionsUnitTests/SampleUnitTests.cs index b780b5ef..85d3a5b7 100644 --- a/samples/AzureFunctionsUnitTests/SampleUnitTests.cs +++ b/samples/AzureFunctionsUnitTests/SampleUnitTests.cs @@ -33,6 +33,9 @@ public async Task OrchestrationReturnsMultipleGreetings() Mock loggerFactoryMock = new(); loggerFactoryMock.Setup(x => x.CreateLogger(It.IsAny())).Returns(logger); contextMock.Protected().Setup("LoggerFactory").Returns(loggerFactoryMock.Object); + contextMock.Setup(x => x.CreateReplaySafeLogger(It.IsAny())) + .Returns((string categoryName) => loggerFactoryMock.Object.CreateLogger(categoryName)); + // mock activity results // In Moq, optional arguments need to be specified as well. We specify them with It.IsAny(), where T is the type of the optional argument @@ -144,10 +147,10 @@ public async Task ClientReturnsUrls() // Validate format of response URLs Assert.NotNull(keyValuePairs); - Assert.Contains(keyValuePairs, kvp => kvp.Key == "id" && kvp.Value == instanceId); - Assert.Contains(keyValuePairs, kvp => kvp.Key == "purgeHistoryDeleteUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}"); - Assert.Contains(keyValuePairs, kvp => kvp.Key == "sendEventPostUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}/raiseEvent/{{eventName}}"); - Assert.Contains(keyValuePairs, kvp => kvp.Key == "statusQueryGetUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}"); + Assert.Contains(keyValuePairs, kvp => kvp.Key == "Id" && kvp.Value == instanceId); + Assert.Contains(keyValuePairs, kvp => kvp.Key == "PurgeHistoryDeleteUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}"); + Assert.Contains(keyValuePairs, kvp => kvp.Key == "SendEventPostUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}/raiseEvent/{{eventName}}"); + Assert.Contains(keyValuePairs, kvp => kvp.Key == "StatusQueryGetUri" && kvp.Value == $"http://localhost:8888/runtime/webhooks/durabletask/instances/{instanceId}"); }