Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DData config] Added reproduction #513

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
Expand Down
63 changes: 63 additions & 0 deletions src/Akka.Cluster.Hosting.Tests/DDataOptionsSpecs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Cluster.Sharding;
using Akka.DistributedData;
using Akka.Hosting;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;

namespace Akka.Cluster.Hosting.Tests;

public class DDataOptionsSpecs
{
public DDataOptionsSpecs(ITestOutputHelper output)
{
Output = output;
}

public ITestOutputHelper Output { get; }

public static readonly TheoryData<DDataOptions> DDataOptionsTypes = new TheoryData<DDataOptions>()
{
new DDataOptions() // empty
{
Durable = new DurableOptions()
{
Keys = []
}
},
new DDataOptions() // null
{
Durable = new DurableOptions()
{
Keys = null
}
},
};

/// <summary>
/// Reproduction for https://github.com/akkadotnet/Akka.Hosting/issues/512
/// </summary>
[Theory]
[MemberData(nameof(DDataOptionsTypes))]
public async Task Should_not_emit_durable_keys_when_empty(DDataOptions options)
{
// arrange
using var host = await TestHelper.CreateHost(builder =>
{
builder
.WithDistributedData(options);
},
new ClusterOptions() { Roles = new[] { "my-host" } }, Output);

var actorSystem = host.Services.GetRequiredService<ActorSystem>();

// act
var ddataSettings = ReplicatorSettings.Create(actorSystem); // parse the settings

// assert
ddataSettings.DurableKeys.Should().BeEmpty();
}
}
50 changes: 50 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project>
<PropertyGroup>
<Copyright>Copyright © 2013-2023 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.5.19</VersionPrefix>
<PackageReleaseNotes>• [Update Akka.NET to 1.5.19](https://github.com/akkadotnet/akka.net/releases/tag/1.5.19)</PackageReleaseNotes>
<PackageIcon>akkalogo.png</PackageIcon>
<PackageProjectUrl>
https://github.com/akkadotnet/Akka.Hosting
</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<LibraryFramework>netstandard2.0</LibraryFramework>
<TestsNetCoreFramework>net6.0</TestsNetCoreFramework>
<XunitVersion>2.8.1</XunitVersion>
<TestSdkVersion>17.11.1</TestSdkVersion>
<CoverletVersion>6.0.2</CoverletVersion>
<XunitRunneVisualstudio>2.8.1</XunitRunneVisualstudio>
<AkkaVersion>1.5.30</AkkaVersion>
<MicrosoftExtensionsVersion>[6.0.0,)</MicrosoftExtensionsVersion>
</PropertyGroup>

<!-- SourceLink support for all Akka.NET projects -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\..\docs\images\akkalogo.png" Pack="true" Visible="false" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)\..\README.md" Pack="true" Visible="false" PackagePath="\" />
</ItemGroup>

<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
</Project>
Loading