From 313df6f93504c134f2f9ae1a8170e4c63ff98676 Mon Sep 17 00:00:00 2001 From: "Raymond A. Kaleho" Date: Fri, 6 Sep 2019 15:48:24 -0500 Subject: [PATCH 1/2] Set TableName from config to get most of the AzureTableJournalSpec tests to pass, went from 13 Passed/22 Failed to 26 Passed/9 Failed --- .../AzureTableJournalSpec.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Akka.Persistence.Azure.Tests/AzureTableJournalSpec.cs b/src/Akka.Persistence.Azure.Tests/AzureTableJournalSpec.cs index 213da45..6d22e35 100644 --- a/src/Akka.Persistence.Azure.Tests/AzureTableJournalSpec.cs +++ b/src/Akka.Persistence.Azure.Tests/AzureTableJournalSpec.cs @@ -10,9 +10,6 @@ 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 Xunit; using Xunit.Abstractions; using static Akka.Persistence.Azure.Tests.AzureStorageConfigHelper; @@ -33,10 +30,14 @@ public AzureTableJournalSpec(ITestOutputHelper output) : base(Config(), nameof(A public static Config Config() { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"))) - return AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")); + var config = + !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")) + ? AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")) + : AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr()); - return AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr()); + TableName = config.GetString("akka.persistence.journal.azure-table.table-name"); + + return config; } protected override void Dispose(bool disposing) From 43d00387cd96fe6bfdbcf99a9e66a3c7a240e17b Mon Sep 17 00:00:00 2001 From: "Raymond A. Kaleho" Date: Fri, 6 Sep 2019 16:24:28 -0500 Subject: [PATCH 2/2] Added config to get the SerializerHelperSpecs tests to pass --- .../SerializerHelperSpecs.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Akka.Persistence.Azure.Tests/SerializerHelperSpecs.cs b/src/Akka.Persistence.Azure.Tests/SerializerHelperSpecs.cs index e485366..20e7462 100644 --- a/src/Akka.Persistence.Azure.Tests/SerializerHelperSpecs.cs +++ b/src/Akka.Persistence.Azure.Tests/SerializerHelperSpecs.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Text; +using Akka.Configuration; +using Akka.Persistence.Azure.TestHelpers; using FluentAssertions; using Xunit; using Xunit.Abstractions; @@ -11,13 +13,24 @@ public class SerializerHelperSpecs : Akka.TestKit.Xunit2.TestKit { private readonly SerializationHelper _helper; - public SerializerHelperSpecs(ITestOutputHelper helper) : base(output: helper) + public SerializerHelperSpecs(ITestOutputHelper helper) + : base(Config(), nameof(SerializerHelperSpecs), output: helper) { // force Akka.Persistence serializers to be loaded AzurePersistence.Get(Sys); _helper = new SerializationHelper(Sys); } + public static Config Config() + { + var azureConfig = + !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")) + ? AzureStorageConfigHelper.AzureConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")) + : AzureStorageConfigHelper.AzureConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr()); + + return azureConfig; + } + [Fact] public void ShouldSerializeAndDeserializePersistentRepresentation() {