Skip to content
Merged
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,5 @@ __pycache__/
*.btm.cs
*.odx.cs
*.xsd.cs
package-lock.json
azurite/
6 changes: 0 additions & 6 deletions Akka.Persistence.Azure.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.Azure.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.Azure.Tests.Performance", "src\Akka.Persistence.Azure.Tests.Performance\Akka.Persistence.Azure.Tests.Performance.csproj", "{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.Azure.TestHelpers", "src\Akka.Persistence.Azure.TestHelpers\Akka.Persistence.Azure.TestHelpers.csproj", "{FE4C3232-1DB9-40E5-B0BE-BD70ACB4C1F3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{320BFA6C-930A-4B7F-9FA4-76CDD0F0E552}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
Expand All @@ -37,10 +35,6 @@ Global
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Release|Any CPU.Build.0 = Release|Any CPU
{FE4C3232-1DB9-40E5-B0BE-BD70ACB4C1F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE4C3232-1DB9-40E5-B0BE-BD70ACB4C1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE4C3232-1DB9-40E5-B0BE-BD70ACB4C1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE4C3232-1DB9-40E5-B0BE-BD70ACB4C1F3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions azurite.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
start /B azurite --silent --location azurite --debug azirute/debug.log
16 changes: 14 additions & 2 deletions build-system/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true
# Linux or macOS
- bash: |
sudo npm install -g azurite@3.17.1
sudo mkdir azurite
sudo azurite --silent --location azurite --debug azirute/debug.log &
displayName: 'Install and Run Azurite (Linux)'
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
- task: Bash@3
displayName: Linux / OSX Build
inputs:
Expand All @@ -24,8 +30,14 @@ jobs:
continueOnError: true
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
env:
AZURE_CONNECTION_STR: $(azureConnectionString)
AZURE_CONNECTION_STR: UseDevelopmentStorage=true
# Windows
- powershell: |
npm install -g azurite@3.17.1
mkdir azurite
Start-Process azurite.cmd -PassThru
displayName: 'Install and Run Azurite (Windows)'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: BatchScript@1
displayName: Windows Build
inputs:
Expand All @@ -34,7 +46,7 @@ jobs:
continueOnError: true
condition: eq( variables['Agent.OS'], 'Windows_NT' )
env:
AZURE_CONNECTION_STR: $(azureConnectionString)
AZURE_CONNECTION_STR: UseDevelopmentStorage=true
- task: PublishTestResults@2
inputs:
testRunner: VSTest
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions src/Akka.Persistence.Azure.TestHelpers/DbUtils.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/Akka.Persistence.Azure.TestHelpers/IAsyncFixture.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Akka.Persistence.Azure.TestHelpers\Akka.Persistence.Azure.TestHelpers.csproj" />
<ProjectReference Include="..\Akka.Persistence.Azure\Akka.Persistence.Azure.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
using Akka.Persistence.Azure.TestHelpers;
using Akka.Util.Internal;
using Azure.Data.Tables;
using Azure.Storage.Blobs;
using NBench;

namespace Akka.Persistence.Azure.Tests.Performance
{
public class AzureJournalPerfSpecs
{
public const string ConnectionString = "UseDevelopmentStorage=true";

public const string RecoveryCounterName = "MsgRecovered";
private Counter _recoveryCounter;

Expand All @@ -35,10 +37,12 @@ public class AzureJournalPerfSpecs

public static Config JournalConfig()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR")))
return JournalConfig(Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR"));
var connString = Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR");
if (string.IsNullOrWhiteSpace(connString))
connString = ConnectionString;

return JournalConfig(WindowsAzureStorageEmulatorFixture.GenerateConnStr());
CleanupCloudTable(connString).Wait();
return JournalConfig(connString);
}

public static Config JournalConfig(string connectionString)
Expand All @@ -55,6 +59,22 @@ public static Config JournalConfig(string connectionString)
.WithFallback("akka.persistence.journal.azure-table.table-name=" + TableName);
}

public static async Task CleanupCloudTable(string connectionString)
{
var tableClient = new TableServiceClient(connectionString);

await foreach(var table in tableClient.QueryAsync())
{
await tableClient.DeleteTableAsync(table.Name);
}

var blobClient = new BlobServiceClient(connectionString);
foreach (var blobContainer in blobClient.GetBlobContainers())
{
await blobClient.DeleteBlobContainerAsync(blobContainer.Name);
}
}

private ActorSystem ActorSystem { get; set; }

private List<IActorRef> _persistentActors = new List<IActorRef>(PersistentActorCount);
Expand All @@ -65,7 +85,6 @@ public void Setup(BenchmarkContext context)
_recoveryCounter = context.GetCounter(RecoveryCounterName);
_writeCounter = context.GetCounter(WriteCounterName);


ActorSystem = Actor.ActorSystem.Create(nameof(AzureJournalPerfSpecs) + TableVersionCounter.Current, JournalConfig());

foreach (var i in Enumerable.Range(0, PersistentActorCount))
Expand Down Expand Up @@ -121,7 +140,7 @@ public void CleanUp()

try
{
DbUtils.CleanupCloudTable(AzurePersistence.Get(ActorSystem).TableSettings.ConnectionString, TableName).Wait(TimeSpan.FromSeconds(3));
CleanupCloudTable(AzurePersistence.Get(ActorSystem).TableSettings.ConnectionString).Wait(TimeSpan.FromSeconds(3));
}
catch { }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\xunitRunner.props" />
<PropertyGroup>
<TargetFramework>$(NetCoreTestVersion)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka.Persistence.TCK" Version="$(AkkaVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="Docker.DotNet" Version="3.125.5" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -16,7 +16,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Akka.Persistence.Azure.TestHelpers\Akka.Persistence.Azure.TestHelpers.csproj" />
<ProjectReference Include="..\Akka.Persistence.Azure\Akka.Persistence.Azure.csproj" />
</ItemGroup>

Expand Down
Loading