Skip to content

Commit

Permalink
update to latest nullean.xunit.partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Feb 23, 2024
1 parent 0c5661f commit 5adf933
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageTags>elastic,elasticsearch,xunit,cluster,integration,test,ephemeral</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nullean.Xunit.Partitions" Version="0.4.2" />
<PackageReference Include="Nullean.Xunit.Partitions" Version="0.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
Expand Down
24 changes: 20 additions & 4 deletions src/Elastic.Elasticsearch.Xunit/Sdk/TestAssemblyRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,33 @@ protected override async Task<RunSummary> RunTestCollectionsAsync(IMessageBus bu
.ConfigureAwait(false);
}

protected override async Task UseStateAndRun(IEphemeralCluster<XunitClusterConfiguration> cluster, Func<int?, Task> runGroup)
protected override async Task UseStateAndRun(
IEphemeralCluster<XunitClusterConfiguration> cluster,
Func<int?, Task> runGroup,
Func<Exception, string, Task> failAll
)
{
using (cluster)
{
ElasticXunitRunner.CurrentCluster = cluster;
var clusterConfiguration = cluster.ClusterConfiguration;
var timeout = clusterConfiguration?.Timeout ?? TimeSpan.FromMinutes(2);
if (!IntegrationTestsMayUseAlreadyRunningNode || !ValidateRunningVersion(cluster))
cluster.Start(timeout);

await runGroup(clusterConfiguration?.MaxConcurrency).ConfigureAwait(false);
var started = false;
try
{
if (!IntegrationTestsMayUseAlreadyRunningNode || !ValidateRunningVersion(cluster))
cluster.Start(timeout);

started = true;
}
catch (Exception e)
{
await failAll(e, $"Further logs might be available at: {cluster.ClusterConfiguration?.FileSystem?.LogsPath}")
.ConfigureAwait(false);
}
if (started)
await runGroup(clusterConfiguration?.MaxConcurrency).ConfigureAwait(false);
}
}

Expand Down

0 comments on commit 5adf933

Please sign in to comment.