From e7d46d61eec2e51e3005d6f92b3409f3dc12d7a8 Mon Sep 17 00:00:00 2001 From: Varshi Bachu Date: Fri, 12 Mar 2021 12:10:59 -0800 Subject: [PATCH 1/5] initial commit --- ...rableTaskJobHostConfigurationExtensions.cs | 3 + test/Common/DurableClientBaseTests.cs | 40 ++++++++++ test/Common/TestHelpers.cs | 48 +++++++++++- .../PlatformSpecificHelpers.FunctionsV2.cs | 73 +++++++++++++++++++ 4 files changed, 163 insertions(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index 1a7df3454..25ebcb92c 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -45,6 +45,9 @@ public static IServiceCollection AddDurableClientFactory(this IServiceCollection serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); +#pragma warning disable CS0612 // Type or member is obsolete + serviceCollection.TryAddSingleton(); +#pragma warning restore CS0612 // Type or member is obsolete return serviceCollection; } diff --git a/test/Common/DurableClientBaseTests.cs b/test/Common/DurableClientBaseTests.cs index f204dd475..6a8d0b82c 100644 --- a/test/Common/DurableClientBaseTests.cs +++ b/test/Common/DurableClientBaseTests.cs @@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; +using Microsoft.Azure.WebJobs.Host.TestCommon; #endif using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; @@ -20,12 +21,27 @@ using Moq; using Newtonsoft.Json; using Xunit; +using Xunit.Abstractions; using static Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests.HttpApiHandlerTests; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests { public class DurableClientBaseTests { + private readonly ITestOutputHelper output; + +#if !FUNCTIONS_V1 + private readonly TestLoggerProvider loggerProvider; +#endif + + public DurableClientBaseTests(ITestOutputHelper output) + { + this.output = output; +#if !FUNCTIONS_V1 + this.loggerProvider = new TestLoggerProvider(output); +#endif + } + [Theory] [Trait("Category", PlatformSpecificHelpers.TestCategory)] [InlineData("@invalid")] @@ -212,6 +228,30 @@ public void DurableClient_ExternalApp_CreateHttpManagementPayload_ThrowsExceptio Assert.ThrowsAny(() => durableOrchestrationClient.CreateHttpManagementPayload("testInstanceId")); } + /// + /// End to end test that ensures that DurableClientFactory is set up correctly + /// (i.e. the correct services are injected through dependency injection + /// and AzureStorageDurabilityProvider is created). + /// + [Fact] + [Trait("Category", PlatformSpecificHelpers.TestCategory)] + public async Task DurableClient_AzureStorage_SuccessfulSetup() + { + string orchestratorName = nameof(TestOrchestrations.SayHelloInline); + using (ITestHost host = TestHelpers.GetJobHost( + loggerProvider: this.loggerProvider, + testName: nameof(this.DurableClient_AzureStorage_SuccessfulSetup), + enableExtendedSessions: false, + storageProviderType: "azure_storage", + addDurableClientFactory: true)) + { + await host.StartAsync(); + var client = await host.StartOrchestratorAsync(orchestratorName, input: "World", this.output); + var status = await client.WaitForCompletionAsync(this.output); + await host.StopAsync(); + } + } + private IDurableOrchestrationClient GetDurableClient(IOrchestrationServiceClient orchestrationServiceClientMockObject) { var storageProvider = new DurabilityProvider("test", new Mock().Object, orchestrationServiceClientMockObject, "test"); diff --git a/test/Common/TestHelpers.cs b/test/Common/TestHelpers.cs index 25a06b269..8f9dddedb 100644 --- a/test/Common/TestHelpers.cs +++ b/test/Common/TestHelpers.cs @@ -63,7 +63,8 @@ public static ITestHost GetJobHost( Action onSend = null, bool rollbackEntityOperationsOnExceptions = true, int entityMessageReorderWindowInMinutes = 30, - string exactTaskHubName = null) + string exactTaskHubName = null, + bool addDurableClientFactory = false) { switch (storageProviderType) { @@ -144,6 +145,20 @@ public static ITestHost GetJobHost( options.StorageProvider["maxQueuePollingInterval"] = maxQueuePollingInterval.Value; } +#if !FUNCTIONS_V1 + if (addDurableClientFactory) + { + return GetJobHostWithOptionsForDurableClient( + loggerProvider, + options, + nameResolver, + durableHttpMessageHandler, + lifeCycleNotificationHelper, + serializerSettings, + onSend); + } +#endif + return GetJobHostWithOptions( loggerProvider, options, @@ -218,6 +233,37 @@ public static ITestHost GetJobHostWithOptionsWithMultipleDurabilityProviders( optionsWrapper, durabilityProviderFactories); } + + public static ITestHost GetJobHostWithOptionsForDurableClient( + ILoggerProvider loggerProvider, + DurableTaskOptions durableTaskOptions, + INameResolver nameResolver = null, + IDurableHttpMessageHandlerFactory durableHttpMessageHandler = null, + ILifeCycleNotificationHelper lifeCycleNotificationHelper = null, + IMessageSerializerSettingsFactory serializerSettings = null, + Action onSend = null) + { + if (serializerSettings == null) + { + serializerSettings = new MessageSerializerSettingsFactory(); + } + + var optionsWrapper = new OptionsWrapper(durableTaskOptions); + var testNameResolver = new TestNameResolver(nameResolver); + if (durableHttpMessageHandler == null) + { + durableHttpMessageHandler = new DurableHttpMessageHandlerFactory(); + } + + return PlatformSpecificHelpers.CreateJobHostForDurableClient( + options: optionsWrapper, + loggerProvider: loggerProvider, + nameResolver: testNameResolver, + durableHttpMessageHandler: durableHttpMessageHandler, + lifeCycleNotificationHelper: lifeCycleNotificationHelper, + serializerSettingsFactory: serializerSettings, + onSend: onSend); + } #endif #pragma warning disable CS0612 // Type or member is obsolete diff --git a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs index 50ab2fee8..4169bb1b9 100644 --- a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs +++ b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs @@ -107,6 +107,64 @@ public static ITestHost CreateJobHostWithMultipleDurabilityProviders( return new FunctionsV2HostWrapper(host, options); } + public static ITestHost CreateJobHostForDurableClient( + IOptions options, + ILoggerProvider loggerProvider, + INameResolver nameResolver, + IDurableHttpMessageHandlerFactory durableHttpMessageHandler, + ILifeCycleNotificationHelper lifeCycleNotificationHelper, + IMessageSerializerSettingsFactory serializerSettingsFactory, + Action onSend, + bool addDurableClient = false) + { + IHost host = new HostBuilder() + .ConfigureLogging( + loggingBuilder => + { + loggingBuilder.AddProvider(loggerProvider); + }) + .ConfigureWebJobs( + webJobsBuilder => + { + webJobsBuilder.AddDurableClientFactoryDurableTask(options); + webJobsBuilder.AddAzureStorage(); + }) + .ConfigureServices( + serviceCollection => + { + ITypeLocator typeLocator = TestHelpers.GetTypeLocator(); + serviceCollection.AddSingleton(typeLocator); + serviceCollection.AddSingleton(nameResolver); + serviceCollection.AddSingleton(durableHttpMessageHandler); + + if (lifeCycleNotificationHelper != null) + { + serviceCollection.AddSingleton(lifeCycleNotificationHelper); + } + + if (serializerSettingsFactory != null) + { + serviceCollection.AddSingleton(serializerSettingsFactory); + } + + if (onSend != null) + { + serviceCollection.AddSingleton(serviceProvider => + { + var durableTaskOptions = serviceProvider.GetService>(); + var telemetryActivator = new TelemetryActivator(durableTaskOptions) + { + OnSend = onSend, + }; + return telemetryActivator; + }); + } + }) + .Build(); + + return new FunctionsV2HostWrapper(host, options, nameResolver); + } + private static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, IOptions options, string storageProvider, Type durabilityProviderFactoryType = null) { if (durabilityProviderFactoryType != null) @@ -157,6 +215,21 @@ private static IWebJobsBuilder AddMultipleDurabilityProvidersDurableTask(this IW return builder; } + private static IWebJobsBuilder AddDurableClientFactoryDurableTask(this IWebJobsBuilder builder, IOptions options, IEnumerable durabilityProviderFactories = null) + { + builder.Services.AddDurableClientFactory(); + + builder.Services.AddSingleton(options); + + var serviceCollection = builder.AddExtension() + .BindOptions() + .Services.AddSingleton(); + + serviceCollection.TryAddSingleton(); + + return builder; + } + private static IWebJobsBuilder AddRedisDurableTask(this IWebJobsBuilder builder) { builder.Services.AddSingleton(); From 9ce6c586fc995aeab344188c480c061920771d6f Mon Sep 17 00:00:00 2001 From: Varshi Bachu Date: Fri, 12 Mar 2021 15:49:08 -0800 Subject: [PATCH 2/5] addressed PR feedback --- test/Common/DurableClientBaseTests.cs | 7 +------ test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/Common/DurableClientBaseTests.cs b/test/Common/DurableClientBaseTests.cs index 6a8d0b82c..6e3660d71 100644 --- a/test/Common/DurableClientBaseTests.cs +++ b/test/Common/DurableClientBaseTests.cs @@ -8,11 +8,11 @@ using System.Threading.Tasks; using DurableTask.Core; using FluentAssertions; +using Microsoft.Azure.WebJobs.Host.TestCommon; #if !FUNCTIONS_V1 using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; -using Microsoft.Azure.WebJobs.Host.TestCommon; #endif using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; @@ -29,17 +29,12 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests public class DurableClientBaseTests { private readonly ITestOutputHelper output; - -#if !FUNCTIONS_V1 private readonly TestLoggerProvider loggerProvider; -#endif public DurableClientBaseTests(ITestOutputHelper output) { this.output = output; -#if !FUNCTIONS_V1 this.loggerProvider = new TestLoggerProvider(output); -#endif } [Theory] diff --git a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs index 4169bb1b9..4cc7c362c 100644 --- a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs +++ b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs @@ -215,6 +215,10 @@ private static IWebJobsBuilder AddMultipleDurabilityProvidersDurableTask(this IW return builder; } + /// + /// Registers the services needed for DurableClientFactory and calls AddDurableClientFactory() + /// which adds the Durable Task extension that uses Azure Storage. + /// private static IWebJobsBuilder AddDurableClientFactoryDurableTask(this IWebJobsBuilder builder, IOptions options, IEnumerable durabilityProviderFactories = null) { builder.Services.AddDurableClientFactory(); From 26a9f9284e689e84bbc5958b112a7fd1ffa59d72 Mon Sep 17 00:00:00 2001 From: Varshi Bachu Date: Fri, 12 Mar 2021 15:54:58 -0800 Subject: [PATCH 3/5] removed extra parameter in AddDurableClientFactoryDurableTask() --- test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs index 4cc7c362c..c7e8750f4 100644 --- a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs +++ b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs @@ -219,7 +219,7 @@ private static IWebJobsBuilder AddMultipleDurabilityProvidersDurableTask(this IW /// Registers the services needed for DurableClientFactory and calls AddDurableClientFactory() /// which adds the Durable Task extension that uses Azure Storage. /// - private static IWebJobsBuilder AddDurableClientFactoryDurableTask(this IWebJobsBuilder builder, IOptions options, IEnumerable durabilityProviderFactories = null) + private static IWebJobsBuilder AddDurableClientFactoryDurableTask(this IWebJobsBuilder builder, IOptions options) { builder.Services.AddDurableClientFactory(); From 914f01fa068b6489233eb6538b33c7aa83155b37 Mon Sep 17 00:00:00 2001 From: Varshi Bachu Date: Fri, 12 Mar 2021 16:59:55 -0800 Subject: [PATCH 4/5] moved test to DurableTaskEndToEndTests and cleaned up test code --- test/Common/DurableClientBaseTests.cs | 35 +-------- test/Common/DurableTaskEndToEndTests.cs | 24 +++++++ test/Common/TestHelpers.cs | 68 ++++-------------- .../PlatformSpecificHelpers.FunctionsV2.cs | 71 +++---------------- 4 files changed, 50 insertions(+), 148 deletions(-) diff --git a/test/Common/DurableClientBaseTests.cs b/test/Common/DurableClientBaseTests.cs index 6e3660d71..64508b16a 100644 --- a/test/Common/DurableClientBaseTests.cs +++ b/test/Common/DurableClientBaseTests.cs @@ -7,8 +7,6 @@ using System.Net.Http; using System.Threading.Tasks; using DurableTask.Core; -using FluentAssertions; -using Microsoft.Azure.WebJobs.Host.TestCommon; #if !FUNCTIONS_V1 using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -28,14 +26,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests { public class DurableClientBaseTests { - private readonly ITestOutputHelper output; - private readonly TestLoggerProvider loggerProvider; - - public DurableClientBaseTests(ITestOutputHelper output) - { - this.output = output; - this.loggerProvider = new TestLoggerProvider(output); - } + public DurableClientBaseTests() { } [Theory] [Trait("Category", PlatformSpecificHelpers.TestCategory)] @@ -223,30 +214,6 @@ public void DurableClient_ExternalApp_CreateHttpManagementPayload_ThrowsExceptio Assert.ThrowsAny(() => durableOrchestrationClient.CreateHttpManagementPayload("testInstanceId")); } - /// - /// End to end test that ensures that DurableClientFactory is set up correctly - /// (i.e. the correct services are injected through dependency injection - /// and AzureStorageDurabilityProvider is created). - /// - [Fact] - [Trait("Category", PlatformSpecificHelpers.TestCategory)] - public async Task DurableClient_AzureStorage_SuccessfulSetup() - { - string orchestratorName = nameof(TestOrchestrations.SayHelloInline); - using (ITestHost host = TestHelpers.GetJobHost( - loggerProvider: this.loggerProvider, - testName: nameof(this.DurableClient_AzureStorage_SuccessfulSetup), - enableExtendedSessions: false, - storageProviderType: "azure_storage", - addDurableClientFactory: true)) - { - await host.StartAsync(); - var client = await host.StartOrchestratorAsync(orchestratorName, input: "World", this.output); - var status = await client.WaitForCompletionAsync(this.output); - await host.StopAsync(); - } - } - private IDurableOrchestrationClient GetDurableClient(IOrchestrationServiceClient orchestrationServiceClientMockObject) { var storageProvider = new DurabilityProvider("test", new Mock().Object, orchestrationServiceClientMockObject, "test"); diff --git a/test/Common/DurableTaskEndToEndTests.cs b/test/Common/DurableTaskEndToEndTests.cs index 30fbdf3dc..ece0f92ff 100644 --- a/test/Common/DurableTaskEndToEndTests.cs +++ b/test/Common/DurableTaskEndToEndTests.cs @@ -194,6 +194,30 @@ public async Task HelloWorld_OrchestrationClientTaskHub(string storageProviderTy } } + /// + /// End to end test that ensures that DurableClientFactory is set up correctly + /// (i.e. the correct services are injected through dependency injection + /// and AzureStorageDurabilityProvider is created). + /// + [Fact] + [Trait("Category", PlatformSpecificHelpers.TestCategory)] + public async Task DurableClient_AzureStorage_SuccessfulSetup() + { + string orchestratorName = nameof(TestOrchestrations.SayHelloInline); + using (ITestHost host = TestHelpers.GetJobHost( + loggerProvider: this.loggerProvider, + testName: nameof(this.DurableClient_AzureStorage_SuccessfulSetup), + enableExtendedSessions: false, + storageProviderType: "azure_storage", + addDurableClientFactory: true)) + { + await host.StartAsync(); + var client = await host.StartOrchestratorAsync(orchestratorName, input: "World", this.output); + var status = await client.WaitForCompletionAsync(this.output); + await host.StopAsync(); + } + } + /// /// End-to-end test which validates a simple orchestrator function does not have assigned value for . /// diff --git a/test/Common/TestHelpers.cs b/test/Common/TestHelpers.cs index 8f9dddedb..646db5cfa 100644 --- a/test/Common/TestHelpers.cs +++ b/test/Common/TestHelpers.cs @@ -145,30 +145,19 @@ public static ITestHost GetJobHost( options.StorageProvider["maxQueuePollingInterval"] = maxQueuePollingInterval.Value; } + return GetJobHostWithOptions( + loggerProvider: loggerProvider, + durableTaskOptions: options, + storageProviderType: storageProviderType, + nameResolver: nameResolver, + durableHttpMessageHandler: durableHttpMessageHandler, + lifeCycleNotificationHelper: lifeCycleNotificationHelper, + serializerSettings: serializerSettings, + onSend: onSend, #if !FUNCTIONS_V1 - if (addDurableClientFactory) - { - return GetJobHostWithOptionsForDurableClient( - loggerProvider, - options, - nameResolver, - durableHttpMessageHandler, - lifeCycleNotificationHelper, - serializerSettings, - onSend); - } + addDurableClientFactory: addDurableClientFactory, #endif - - return GetJobHostWithOptions( - loggerProvider, - options, - storageProviderType, - nameResolver, - durableHttpMessageHandler, - lifeCycleNotificationHelper, - serializerSettings, - onSend, - durabilityProviderFactoryType); + durabilityProviderFactoryType: durabilityProviderFactoryType); } public static ITestHost GetJobHostWithOptions( @@ -180,7 +169,8 @@ public static ITestHost GetJobHostWithOptions( ILifeCycleNotificationHelper lifeCycleNotificationHelper = null, IMessageSerializerSettingsFactory serializerSettings = null, Action onSend = null, - Type durabilityProviderFactoryType = null) + Type durabilityProviderFactoryType = null, + bool addDurableClientFactory = false) { if (serializerSettings == null) { @@ -199,6 +189,7 @@ public static ITestHost GetJobHostWithOptions( storageProvider: storageProviderType, #if !FUNCTIONS_V1 durabilityProviderFactoryType: durabilityProviderFactoryType, + addDurableClientFactory: addDurableClientFactory, #endif loggerProvider: loggerProvider, nameResolver: testNameResolver, @@ -233,37 +224,6 @@ public static ITestHost GetJobHostWithOptionsWithMultipleDurabilityProviders( optionsWrapper, durabilityProviderFactories); } - - public static ITestHost GetJobHostWithOptionsForDurableClient( - ILoggerProvider loggerProvider, - DurableTaskOptions durableTaskOptions, - INameResolver nameResolver = null, - IDurableHttpMessageHandlerFactory durableHttpMessageHandler = null, - ILifeCycleNotificationHelper lifeCycleNotificationHelper = null, - IMessageSerializerSettingsFactory serializerSettings = null, - Action onSend = null) - { - if (serializerSettings == null) - { - serializerSettings = new MessageSerializerSettingsFactory(); - } - - var optionsWrapper = new OptionsWrapper(durableTaskOptions); - var testNameResolver = new TestNameResolver(nameResolver); - if (durableHttpMessageHandler == null) - { - durableHttpMessageHandler = new DurableHttpMessageHandlerFactory(); - } - - return PlatformSpecificHelpers.CreateJobHostForDurableClient( - options: optionsWrapper, - loggerProvider: loggerProvider, - nameResolver: testNameResolver, - durableHttpMessageHandler: durableHttpMessageHandler, - lifeCycleNotificationHelper: lifeCycleNotificationHelper, - serializerSettingsFactory: serializerSettings, - onSend: onSend); - } #endif #pragma warning disable CS0612 // Type or member is obsolete diff --git a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs index c7e8750f4..a6d5db68a 100644 --- a/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs +++ b/test/FunctionsV2/PlatformSpecificHelpers.FunctionsV2.cs @@ -34,7 +34,8 @@ public static ITestHost CreateJobHost( IDurableHttpMessageHandlerFactory durableHttpMessageHandler, ILifeCycleNotificationHelper lifeCycleNotificationHelper, IMessageSerializerSettingsFactory serializerSettingsFactory, - Action onSend) + Action onSend, + bool addDurableClientFactory) { // Unless otherwise specified, use legacy partition management for tests as it makes the task hubs start up faster. // These tests run on a single task hub workers, so they don't test partition management anyways, and that is tested @@ -53,7 +54,15 @@ public static ITestHost CreateJobHost( .ConfigureWebJobs( webJobsBuilder => { - webJobsBuilder.AddDurableTask(options, storageProvider, durabilityProviderFactoryType); + if (addDurableClientFactory) + { + webJobsBuilder.AddDurableClientFactoryDurableTask(options); + } + else + { + webJobsBuilder.AddDurableTask(options, storageProvider, durabilityProviderFactoryType); + } + webJobsBuilder.AddAzureStorage(); }) .ConfigureServices( @@ -107,64 +116,6 @@ public static ITestHost CreateJobHostWithMultipleDurabilityProviders( return new FunctionsV2HostWrapper(host, options); } - public static ITestHost CreateJobHostForDurableClient( - IOptions options, - ILoggerProvider loggerProvider, - INameResolver nameResolver, - IDurableHttpMessageHandlerFactory durableHttpMessageHandler, - ILifeCycleNotificationHelper lifeCycleNotificationHelper, - IMessageSerializerSettingsFactory serializerSettingsFactory, - Action onSend, - bool addDurableClient = false) - { - IHost host = new HostBuilder() - .ConfigureLogging( - loggingBuilder => - { - loggingBuilder.AddProvider(loggerProvider); - }) - .ConfigureWebJobs( - webJobsBuilder => - { - webJobsBuilder.AddDurableClientFactoryDurableTask(options); - webJobsBuilder.AddAzureStorage(); - }) - .ConfigureServices( - serviceCollection => - { - ITypeLocator typeLocator = TestHelpers.GetTypeLocator(); - serviceCollection.AddSingleton(typeLocator); - serviceCollection.AddSingleton(nameResolver); - serviceCollection.AddSingleton(durableHttpMessageHandler); - - if (lifeCycleNotificationHelper != null) - { - serviceCollection.AddSingleton(lifeCycleNotificationHelper); - } - - if (serializerSettingsFactory != null) - { - serviceCollection.AddSingleton(serializerSettingsFactory); - } - - if (onSend != null) - { - serviceCollection.AddSingleton(serviceProvider => - { - var durableTaskOptions = serviceProvider.GetService>(); - var telemetryActivator = new TelemetryActivator(durableTaskOptions) - { - OnSend = onSend, - }; - return telemetryActivator; - }); - } - }) - .Build(); - - return new FunctionsV2HostWrapper(host, options, nameResolver); - } - private static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, IOptions options, string storageProvider, Type durabilityProviderFactoryType = null) { if (durabilityProviderFactoryType != null) From b861d4425cc408f601b8f06d7a9f5fe37ae3f213 Mon Sep 17 00:00:00 2001 From: Varshi Bachu Date: Fri, 12 Mar 2021 17:07:14 -0800 Subject: [PATCH 5/5] removed DurableClientBaseTests constructor --- test/Common/DurableClientBaseTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Common/DurableClientBaseTests.cs b/test/Common/DurableClientBaseTests.cs index 64508b16a..308592252 100644 --- a/test/Common/DurableClientBaseTests.cs +++ b/test/Common/DurableClientBaseTests.cs @@ -26,8 +26,6 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests { public class DurableClientBaseTests { - public DurableClientBaseTests() { } - [Theory] [Trait("Category", PlatformSpecificHelpers.TestCategory)] [InlineData("@invalid")]