microsoft / durabletask-mssql

Microsoft SQL storage provider for Durable Functions and the Durable Task Framework
MIT License
87 stars 32 forks source link

Expose a method to register SqlDurabilityProviderFactory for integration testing purpose #30

Closed bhugot closed 3 years ago

bhugot commented 3 years ago

Hello, I would like to be able to run integration testing using sql as provider but as the SqlDurabiltyProviderFactory can't be added to service collection it's not possible.

cgillum commented 3 years ago

Thanks for pointing this out. I'll publish an update that includes this.

cgillum commented 3 years ago

@bhugot I've added a new extension method in the v0.9.1-beta release in the DurableTask.SqlServer.AzureFunctions namespace. Let me know if this unblocks your testing.

    /// <summary>
    /// Extension methods for the Microsoft SQL Durable Task storage provider.
    /// </summary>
    public static class SqlDurabilityProviderExtensions
    {
        /// <summary>
        /// Adds Durable Task SQL storage provider services to the specified <see cref="IServiceCollection"/>.
        /// </summary>
        /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
        public static void AddDurableTaskSqlProvider(this IServiceCollection services);
    }
bhugot commented 3 years ago

@cgillum hello, yeah it's perfect to me thanks. Now i m trying to figure why some test à failing randomly when using it with an error on connection using my localdb.