File tree Expand file tree Collapse file tree 15 files changed +23
-30
lines changed
AzureFunctions.TestHelpers
AzureFunctions.TestHelpers.Tests
AzureFunctions.TestHelpers.Tests.DemoFunctions Expand file tree Collapse file tree 15 files changed +23
-30
lines changed Original file line number Diff line number Diff line change 1
1
using Microsoft . Azure . WebJobs ;
2
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
2
3
3
4
namespace AzureFunctions . TestHelpers . Activities
4
5
{
@@ -12,6 +13,6 @@ public Activity(IInjectable injectable)
12
13
}
13
14
14
15
[ FunctionName ( nameof ( Activity ) ) ]
15
- public void Run ( [ ActivityTrigger ] DurableActivityContextBase context ) => _injectable . Execute ( ) ;
16
+ public void Run ( [ ActivityTrigger ] IDurableOrchestrationClient context ) => _injectable . Execute ( ) ;
16
17
}
17
18
}
Original file line number Diff line number Diff line change 6
6
</PropertyGroup >
7
7
8
8
<ItemGroup >
9
- <PackageReference Include =" Microsoft.Azure.WebJobs.Extensions.DurableTask" Version =" [1.7,2 )" />
9
+ <PackageReference Include =" Microsoft.Azure.WebJobs.Extensions.DurableTask" Version =" [2.0.0,3 )" />
10
10
<PackageReference Include =" Microsoft.NET.Sdk.Functions" Version =" [1.0.29,2)" />
11
11
</ItemGroup >
12
12
</Project >
Original file line number Diff line number Diff line change 1
1
using System . Threading . Tasks ;
2
2
using AzureFunctions . TestHelpers . Activities ;
3
3
using Microsoft . Azure . WebJobs ;
4
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
4
5
5
6
namespace AzureFunctions . TestHelpers . Orchestrators
6
7
{
7
8
public static class Orchestration
8
9
{
9
10
[ FunctionName ( nameof ( Orchestration ) ) ]
10
- public static async Task Run ( [ OrchestrationTrigger ] DurableOrchestrationContextBase context )
11
+ public static async Task Run ( [ OrchestrationTrigger ] IDurableOrchestrationContext context )
11
12
{
12
13
await context . CallActivityAsync ( nameof ( Activity ) , null ) ;
13
14
}
Original file line number Diff line number Diff line change 1
1
using System . Threading . Tasks ;
2
2
using AzureFunctions . TestHelpers . Orchestrators ;
3
3
using Microsoft . Azure . WebJobs ;
4
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
4
5
5
6
namespace AzureFunctions . TestHelpers . Starters
6
7
{
@@ -9,7 +10,7 @@ public static class Starter
9
10
[ FunctionName ( nameof ( Starter ) ) ]
10
11
public static async Task Run ( [ TimerTrigger ( "0 0 1 * * *" ) ]
11
12
TimerInfo timerInfo ,
12
- [ OrchestrationClient ] DurableOrchestrationClientBase orchestrationClient )
13
+ [ DurableClient ] IDurableOrchestrationClient orchestrationClient )
13
14
{
14
15
await orchestrationClient . StartNewAsync ( nameof ( Orchestration ) , null ) ;
15
16
}
Original file line number Diff line number Diff line change 1
1
using Microsoft . Azure . WebJobs ;
2
2
using Microsoft . Azure . WebJobs . Hosting ;
3
- using Microsoft . Extensions . DependencyInjection ;
4
3
5
4
namespace AzureFunctions . TestHelpers
6
5
{
Original file line number Diff line number Diff line change 16
16
<PackageReference Include =" xunit" Version =" [2.3,3)" />
17
17
<PackageReference Include =" xunit.runner.visualstudio" Version =" [2.3,3)" />
18
18
<PackageReference Include =" FluentAssertions" Version =" [5.7,6)" />
19
- <PackageReference Include =" Flurl.Http" Version =" [2.4.2,3)" />
20
- <PackageReference Include =" Newtonsoft.Json" Version =" [12.0.2,13)" />
21
- <PackageReference Include =" Microsoft.Azure.Functions.Extensions" Version =" [1.0.0,2)" />
22
19
</ItemGroup >
23
20
24
21
<ItemGroup >
Original file line number Diff line number Diff line change @@ -165,11 +165,7 @@ public HostFixture()
165
165
Mock = Substitute . For < IInjectable > ( ) ;
166
166
_host = new HostBuilder ( )
167
167
. ConfigureWebJobs ( builder => builder
168
- . AddDurableTask ( options =>
169
- {
170
- options . HubName = nameof ( DurableFunctionsHelper ) ;
171
- options . MaxQueuePollingInterval = TimeSpan . FromSeconds ( 2 ) ;
172
- } )
168
+ . AddDurableTask ( options => options . HubName = nameof ( DurableFunctionsHelper ) )
173
169
. AddAzureStorageCoreServices ( )
174
170
. ConfigureServices ( services => services . AddSingleton ( Mock ) ) )
175
171
. Build ( ) ;
Original file line number Diff line number Diff line change 7
7
8
8
<ItemGroup >
9
9
<PackageReference Include =" Microsoft.AspNetCore.Http" Version =" [2.2,3)" />
10
- <PackageReference Include =" Microsoft.Azure.WebJobs" Version =" [3,4)" />
11
- <PackageReference Include =" Microsoft.Azure.WebJobs.Core" Version =" 3.0.14" />
12
- <PackageReference Include =" Microsoft.Azure.WebJobs.Extensions.DurableTask" Version =" [1.8,2 )" />
10
+ <PackageReference Include =" Microsoft.Azure.WebJobs" Version =" [3.0.14 ,4)" />
11
+ <PackageReference Include =" Microsoft.Azure.WebJobs.Core" Version =" [ 3.0.14,4) " />
12
+ <PackageReference Include =" Microsoft.Azure.WebJobs.Extensions.DurableTask" Version =" [2.0.0,3 )" />
13
13
</ItemGroup >
14
14
15
15
<PropertyGroup >
16
16
<Authors >Manuel Riezebosch</Authors >
17
17
<NeutralLanguage >en-US</NeutralLanguage >
18
18
<AssemblyTitle >AzureFunctions.TestHelpers</AssemblyTitle >
19
19
<Description >Spin up integration tests on your Azure Functions!</Description >
20
- <PackageReleaseNotes >Wait, ThrowIfFailed and Purge separated. </PackageReleaseNotes >
20
+ <PackageReleaseNotes >Upgrade to durable task v2 </PackageReleaseNotes >
21
21
<PackageTags >azure;functions;serverless;integration;testing;tdd</PackageTags >
22
22
<PackageRequireLicenseAcceptance >false</PackageRequireLicenseAcceptance >
23
23
<RepositoryType >git</RepositoryType >
Original file line number Diff line number Diff line change 1
1
using System ;
2
- using System . Linq ;
3
2
using System . Threading . Tasks ;
4
3
using DurableTask . Core ;
5
4
using Microsoft . Azure . WebJobs ;
5
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
6
6
7
7
namespace AzureFunctions . TestHelpers
8
8
{
9
9
public static class PurgeFunction
10
10
{
11
11
[ FunctionName ( nameof ( PurgeFunction ) ) ]
12
- public static async Task Run ( [ OrchestrationClient ] DurableOrchestrationClientBase client )
12
+ public static async Task Run ( [ DurableClient ] IDurableOrchestrationClient client )
13
13
{
14
14
await client . PurgeInstanceHistoryAsync (
15
15
DateTime . MinValue ,
Original file line number Diff line number Diff line change 1
- using Microsoft . Azure . WebJobs ;
1
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
2
2
3
3
namespace AzureFunctions . TestHelpers
4
4
{
Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Linq ;
3
1
using System . Threading . Tasks ;
4
- using DurableTask . Core ;
5
2
using Microsoft . Azure . WebJobs ;
3
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
6
4
7
5
namespace AzureFunctions . TestHelpers
8
6
{
9
7
public static class TerminateFunction
10
8
{
11
9
[ FunctionName ( nameof ( TerminateFunction ) ) ]
12
- public static async Task Run ( [ OrchestrationClient ] DurableOrchestrationClientBase client )
10
+ public static async Task Run ( [ DurableClient ] IDurableOrchestrationClient client )
13
11
{
14
12
var orchestrations = await client . GetStatusAsync ( ) ;
15
13
foreach ( var orchestration in orchestrations )
Original file line number Diff line number Diff line change 1
1
using System ;
2
- using System . Collections . Generic ;
3
2
using System . Linq ;
4
3
using System . Threading . Tasks ;
5
4
using Microsoft . Azure . WebJobs ;
5
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
6
6
7
7
namespace AzureFunctions . TestHelpers
8
8
{
9
9
public static class ThrowIfFailedFunction
10
10
{
11
11
[ FunctionName ( nameof ( ThrowIfFailedFunction ) ) ]
12
- public static async Task Run ( [ OrchestrationClient ] DurableOrchestrationClientBase client )
12
+ public static async Task Run ( [ DurableClient ] IDurableOrchestrationClient client )
13
13
{
14
14
var failed = ( await client . GetStatusAsync ( ) ) . Where ( x => x . RuntimeStatus == OrchestrationRuntimeStatus . Failed ) . ToList ( ) ;
15
15
if ( failed . Any ( ) )
Original file line number Diff line number Diff line change 3
3
using System . Threading ;
4
4
using System . Threading . Tasks ;
5
5
using Microsoft . Azure . WebJobs ;
6
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
6
7
7
8
namespace AzureFunctions . TestHelpers
8
9
{
9
10
public static class WaitForCompletion
10
11
{
11
12
[ FunctionName ( nameof ( WaitForCompletion ) ) ]
12
13
[ NoAutomaticTrigger ]
13
- public static async Task Run ( [ OrchestrationClient ] DurableOrchestrationClientBase client , TimeSpan ? timeout )
14
+ public static async Task Run ( [ DurableClient ] IDurableOrchestrationClient client , TimeSpan ? timeout )
14
15
{
15
16
using ( var cts = new CancellationTokenSource ( ) )
16
17
{
@@ -19,7 +20,7 @@ public static async Task Run([OrchestrationClient]DurableOrchestrationClientBase
19
20
}
20
21
}
21
22
22
- private static async Task Wait ( DurableOrchestrationClientBase client , CancellationToken token )
23
+ private static async Task Wait ( IDurableOrchestrationClient client , CancellationToken token )
23
24
{
24
25
while ( ! token . IsCancellationRequested )
25
26
{
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using Microsoft . Azure . WebJobs ;
3
- using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
4
3
using Microsoft . Extensions . DependencyInjection ;
5
4
6
5
namespace AzureFunctions . TestHelpers
Original file line number Diff line number Diff line change 1
- version : 2.1 .{build}
1
+ version : 3.0 .{build}
2
2
pull_requests :
3
3
do_not_increment_build_number : true
4
4
image : Previous Ubuntu1804
You can’t perform that action at this time.
0 commit comments