Skip to content

Commit

Permalink
Merge pull request #62 from petabridge/dev
Browse files Browse the repository at this point in the history
v0.5.0 Release
  • Loading branch information
Aaronontheweb authored Oct 9, 2019
2 parents b1a8b24 + 289f8d2 commit 90b2e34
Show file tree
Hide file tree
Showing 47 changed files with 2,829 additions and 260 deletions.
8 changes: 6 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#### 0.1.0 July 12 2019 ####
**Beta Release of Akka.Persistence.Azure**
#### 0.5.0 October 08 2019 ####
**Beta Release of Akka.Persistence.Azure**

Akka.Persistence.Azure v0.5.0 is a major leap forward ahead of v0.1.0. It fully implements Akka.Persistence.Query and fully implements Akka.NET v1.4.0-compatible serialization techniques.

There are still some issues with respect to ordering and result sets from Akka.Persistence.Query and those will be addressed in a future release of Akka.Persistence.Azure.
2 changes: 1 addition & 1 deletion build-system/windows-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- template: azure-pipeline.template.yaml
parameters:
name: Windows
vmImage: 'vs2017-win2016'
vmImage: 'windows-2019'
scriptFileName: build.cmd
scriptArgs: all
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@


<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="NBench" Version="1.2.1" />
<PackageReference Include="NBench" Version="1.2.2" />
<DotNetCliToolReference Include="dotnet-nbench" Version="1.2.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<Import Project="..\xunitRunner.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka.Persistence.TCK" Version="1.3.8" />
<PackageReference Include="FluentAssertions" Version="5.4.1" />
<PackageReference Include="Akka.Persistence.TCK" Version="1.3.15" />
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit" Version="2.4.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// -----------------------------------------------------------------------
// <copyright file="AzureBlobSnapshotStoreSerializationSpec.cs" company="Petabridge, LLC">
// Copyright (C) 2015 - 2019 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------

using System;
using Akka.Configuration;
using Akka.Persistence.Azure.TestHelpers;
using Akka.Persistence.Azure.Tests.Helper;
using Akka.Persistence.TCK.Serialization;
using Xunit;
using Xunit.Abstractions;

namespace Akka.Persistence.Azure.Tests
{
[Collection("AzureSnapshot")]
public class AzureBlobSnapshotStoreSerializationSpec : SnapshotStoreSerializationSpec
{
public AzureBlobSnapshotStoreSerializationSpec(ITestOutputHelper output) : base(Config(),
nameof(AzureTableJournalSpec), output)
{
AzurePersistence.Get(Sys);
}

public static Config Config()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")))
return AzureStorageConfigHelper.AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"));

return AzureStorageConfigHelper.AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="AzureBlobStorageSpec.cs" company="Petabridge, LLC">
// <copyright file="AzureBlobSnapshotStoreSpec.cs" company="Petabridge, LLC">
// Copyright (C) 2015 - 2018 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
Expand All @@ -10,14 +10,14 @@
using Akka.Persistence.TCK.Snapshot;
using Xunit;
using Xunit.Abstractions;
using static Akka.Persistence.Azure.Tests.AzureStorageConfigHelper;
using static Akka.Persistence.Azure.Tests.Helper.AzureStorageConfigHelper;

namespace Akka.Persistence.Azure.Tests
{
[Collection("AzureSnapshot")]
public class AzureBlobStorageSpec : SnapshotStoreSpec
public class AzureBlobSnapshotStoreSpec : SnapshotStoreSpec
{
public AzureBlobStorageSpec(ITestOutputHelper output) : base(Config(),
public AzureBlobSnapshotStoreSpec(ITestOutputHelper output) : base(Config(),
nameof(AzureTableJournalSpec), output)
{
AzurePersistence.Get(Sys);
Expand Down
20 changes: 20 additions & 0 deletions src/Akka.Persistence.Azure.Tests/AzurePersistenceConfigSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using Akka.Configuration;
using Akka.Persistence.Azure.Journal;
using Akka.Persistence.Azure.Query;
using Akka.Persistence.Azure.Snapshot;
using FluentAssertions;
using FluentAssertions.Equivalency;
Expand Down Expand Up @@ -60,6 +61,25 @@ public void ShouldParseTableConfig()
tableSettings.VerboseLogging.Should().BeFalse();
}

[Fact]
public void ShouldParseQueryConfig()
{
var querySettings =
AzureTableStorageQuerySettings.Create(
ConfigurationFactory.ParseString(@"akka.persistence.query.journal.azure-table{
class = ""classname""
write-plugin = foo
max-buffer-size = 100
refresh-interval = 3s
}").WithFallback(AzurePersistence.DefaultConfig)
.GetConfig("akka.persistence.query.journal.azure-table"));

querySettings.Class.Should().Be("classname");
querySettings.WritePlugin.Should().Be("foo");
querySettings.MaxBufferSize.Should().Be("100");
querySettings.RefreshInterval.Should().Be(new TimeSpan(0, 0, 3));
}

[Theory]
[InlineData("fo", "Invalid table name length")]
[InlineData("1foo", "Invalid table name")]
Expand Down
29 changes: 0 additions & 29 deletions src/Akka.Persistence.Azure.Tests/AzureStorageConfigHelper.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// -----------------------------------------------------------------------
// <copyright file="AzureTableJournalSerializationSpec.cs" company="Petabridge, LLC">
// Copyright (C) 2015 - 2019 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------

using System;
using Akka.Configuration;
using Akka.Persistence.Azure.TestHelpers;
using Akka.Persistence.Azure.Tests.Helper;
using Akka.Persistence.TCK.Serialization;
using Xunit;
using Xunit.Abstractions;

namespace Akka.Persistence.Azure.Tests
{
[Collection("AzureJournal")]
public class AzureTableJournalSerializationSpec : JournalSerializationSpec
{
public AzureTableJournalSerializationSpec(ITestOutputHelper output)
: base(Config(), nameof(AzureTableJournalSerializationSpec), output)
{
AzurePersistence.Get(Sys);
output.WriteLine("Current table: {0}", TableName);
}

[Fact(Skip= "https://github.com/akkadotnet/akka.net/issues/3965")]
public override void Journal_should_serialize_Persistent_with_EventAdapter_manifest()
{

}

public static string TableName { get; private set; }

public static Config Config()
{
var azureConfig =
!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"))
? AzureStorageConfigHelper.AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"))
: AzureStorageConfigHelper.AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr());

TableName = azureConfig.GetString("akka.persistence.journal.azure-table.table-name");

return azureConfig;
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (DbUtils.CleanupCloudTable(AzurePersistence.Get(Sys).TableSettings.ConnectionString, TableName).Wait(TimeSpan.FromSeconds(3)))
{
Log.Info("Successfully deleted table [{0}] after test run.", TableName);
}
else
{
Log.Error("Unable to delete table [{0}] after test run.", TableName);
}
}
}
}
30 changes: 16 additions & 14 deletions src/Akka.Persistence.Azure.Tests/AzureTableJournalSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,41 @@
// </copyright>
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
using Akka.Persistence.Azure.TestHelpers;
using Akka.Persistence.TCK.Journal;
using Akka.Util.Internal;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using System;
using Xunit;
using Xunit.Abstractions;
using static Akka.Persistence.Azure.Tests.AzureStorageConfigHelper;
using static Akka.Persistence.Azure.Tests.Helper.AzureStorageConfigHelper;

namespace Akka.Persistence.Azure.Tests
{
[Collection("AzureJournal")]
public class AzureTableJournalSpec : JournalSpec
{
public static string TableName { get; private set; }

public AzureTableJournalSpec(ITestOutputHelper output) : base(Config(), nameof(AzureTableJournalSpec),
output)
public AzureTableJournalSpec(ITestOutputHelper output)
: base(Config(), nameof(AzureTableJournalSpec), output)
{
AzurePersistence.Get(Sys);

Initialize();

output.WriteLine("Current table: {0}", TableName);
}

public static string TableName { get; private set; }

public static Config Config()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")))
return AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"));
var azureConfig =
!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"))
? AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"))
: AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr());

TableName = azureConfig.GetString("akka.persistence.journal.azure-table.table-name");

return AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr());
return azureConfig;
}

protected override void Dispose(bool disposing)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using System;
using Akka.Configuration;

namespace Akka.Persistence.Azure.Tests.Helper
{
public static class AzureStorageConfigHelper
{
public static Config AzureConfig(string connectionString)
{
var tableName = "t" + Guid.NewGuid().ToString().Replace("-", "");
var containerName = "testcontainer" + Guid.NewGuid();

return ConfigurationFactory.ParseString(
@"
akka {
loglevel = DEBUG
log-config-on-start = off
test.single-expect-default = 30s
persistence {
publish-plugin-commands = on
journal {
plugin = ""akka.persistence.journal.azure-table""
azure-table {
connection-string=""" + connectionString + @"""
connect-timeout = 3s
request-timeout = 3s
verbose-logging = on
event-adapters {
color-tagger = ""Akka.Persistence.TCK.Query.ColorFruitTagger, Akka.Persistence.TCK""
}
event-adapter-bindings = {
""System.String"" = color-tagger
}
}
}
query {
journal {
azure-table {
write-plugin = ""akka.persistence.journal.azure-table""
refresh-interval = 1s
max-buffer-size = 150
}
}
}
snapshot-store {
plugin = ""akka.persistence.snapshot-store.azure-blob-store""
azure-blob-store {
connection-string=""" + connectionString + @"""
request-timeout = 3s
}
}
}
}")
.WithFallback("akka.persistence.journal.azure-table.table-name=" + tableName)
.WithFallback("akka.persistence.snapshot-store.azure-blob-store.container-name=" + containerName);
}

}
}
Loading

0 comments on commit 90b2e34

Please sign in to comment.