Skip to content

Commit

Permalink
Exclude example workers from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Dec 5, 2024
1 parent 27201d3 commit 8751793
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV CONDUCTOR_SERVER_URL=${CONDUCTOR_SERVER_URL}
COPY /csharp-examples /package/csharp-examples
COPY /Tests /package/Tests
WORKDIR /package/Tests
RUN dotnet test -l "console;verbosity=normal"
RUN dotnet test -p:DefineConstants=EXCLUDE_EXAMPLE_WORKERS -l "console;verbosity=normal"

FROM build as pack_release
ARG SDK_VERSION
Expand Down
2 changes: 1 addition & 1 deletion Tests/Worker/WorkerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public async System.Threading.Tasks.Task TestWorkflowAsyncExecution()
var workflow = GetConductorWorkflow();
ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(workflow, true);
var workflowIdList = await StartWorkflows(workflow, quantity: 15);
await ExecuteWorkflowTasks(workflowCompletionTimeout: TimeSpan.FromSeconds(40));
await ExecuteWorkflowTasks(workflowCompletionTimeout: TimeSpan.FromSeconds(30));
await ValidateWorkflowCompletion(workflowIdList.ToArray());
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
using Conductor.Client.Extensions;
using Conductor.Client.Interfaces;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Conductor.Examples.Utils
{
Expand All @@ -32,7 +29,7 @@ public static async Task<bool> StartBackGroundTask(ManualResetEvent waitHandle,
{
var host = WorkflowTaskHost.CreateWorkerHost(Microsoft.Extensions.Logging.LogLevel.Information);
await host.StartAsync();
Thread.Sleep(60000);
Thread.Sleep(40000);
waitHandle.Set();
await host.StopAsync();
return true;
Expand Down
7 changes: 6 additions & 1 deletion csharp-examples/csharp-examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets"
Version="1.19.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Conductor/conductor-csharp.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(DefineConstants)' == 'EXCLUDE_EXAMPLE_WORKERS'">
<Compile Remove="Examples/**/*.cs" />
<Compile Remove="WorkflowExamples.cs" />
</ItemGroup>

</Project>

0 comments on commit 8751793

Please sign in to comment.