Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: ["inmem", "mssql", "mssql-v3", "mysql", "postgres", "sqlite", "hal", "http"]
test: ["inmem", "mssql", "mssql-v3", "mysql", "postgres", "postgres-v2", "sqlite", "hal", "http"]

runs-on: ubuntu-latest
name: Test ${{ matrix.test }}
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
fetch-depth: 0
- name: Pull Containers
shell: bash
run: docker pull damianh/dotnet-core-lts-sdks:1
run: docker pull alpinelinux/docker-cli:latest-x86_64
- name: Build and Test
shell: bash
run: ./build.sh test-${{ matrix.test }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: ["inmem", "mssql", "mssql-v3", "mysql", "postgres", "sqlite", "hal", "http"]
test: ["inmem", "mssql", "mssql-v3", "mysql", "postgres", "postgres-v2", "sqlite", "hal", "http"]

runs-on: ubuntu-latest
name: Test ${{ matrix.test }}
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
fetch-depth: 0
- name: Pull Containers
shell: bash
run: docker pull damianh/dotnet-core-lts-sdks:1
run: docker pull alpinelinux/docker-cli:latest-x86_64
- name: Build and Test
shell: bash
run: ./build.sh test-${{ matrix.test }}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/LoadTests/bin/Debug/netcoreapp2.0/LoadTests.dll",
"program": "${workspaceFolder}/src/LoadTests/bin/Debug/net6.0/LoadTests.dll",
"args": [],
"cwd": "${workspaceFolder}/src/LoadTests",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
FROM damianh/dotnet-core-lts-sdks:2
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal

RUN apt-get update \
&& apt-get install git \
&& apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release -y \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install docker-ce-cli -y \
&& apt-get install zip -y

WORKDIR /repo

Expand Down
12 changes: 10 additions & 2 deletions SqlStreamStore.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
# Visual Studio Version 17
VisualStudioVersion = 17.1.32120.378
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SqlStreamStore", "src\SqlStreamStore\SqlStreamStore.csproj", "{8F86833A-6686-409C-B0E4-6FBFB70F7DE1}"
EndProject
Expand Down Expand Up @@ -148,6 +148,14 @@ Global
{5273D70A-96D7-4775-B67C-BDE48D20CA36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5273D70A-96D7-4775-B67C-BDE48D20CA36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5273D70A-96D7-4775-B67C-BDE48D20CA36}.Release|Any CPU.Build.0 = Release|Any CPU
{A8D87EDC-E911-42F3-891F-82DEBBD4E0A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8D87EDC-E911-42F3-891F-82DEBBD4E0A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8D87EDC-E911-42F3-891F-82DEBBD4E0A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8D87EDC-E911-42F3-891F-82DEBBD4E0A3}.Release|Any CPU.Build.0 = Release|Any CPU
{D1FA4E2A-9113-4F8E-987D-DDC1C1C583E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1FA4E2A-9113-4F8E-987D-DDC1C1C583E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1FA4E2A-9113-4F8E-987D-DDC1C1C583E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1FA4E2A-9113-4F8E-987D-DDC1C1C583E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion build-local.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

dotnet run -p build/build.csproj -- %*
dotnet run --project build/build.csproj -- %*
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ docker run --rm --name sss-build \
--network host \
-e FEEDZ_SSS_API_KEY=$FEEDZ_SSS_API_KEY \
sss-build \
dotnet run -p /repo/build/build.csproj -- "$@"
dotnet run --project /repo/build/build.csproj -- "$@"
18 changes: 13 additions & 5 deletions build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace build
{
using System.Text;

class Program
{
private const string ArtifactsDir = "artifacts";
Expand All @@ -20,6 +22,7 @@ class Program
private const string TestMsSql = "test-mssql";
private const string TestMsSqlV3 = "test-mssql-v3";
private const string TestPostgres = "test-postgres";
private const string TestPostgresV2 = "test-postgres-v2";
private const string TestSqlite = "test-sqlite";
private const string TestHal = "test-hal";
private const string TestHttp = "test-http";
Expand Down Expand Up @@ -59,11 +62,10 @@ void RunTest(string project)
{
try
{
Run("dotnet",
$"test tests/{project}/{project}.csproj --configuration=Release --no-build --no-restore --verbosity=normal"
+ $" --logger \"trx;logfilename=..\\..\\..\\{ArtifactsDir}\\{project}.trx\"");
Run("dotnet", $"test tests/{project}/{project}.csproj --configuration=Release --no-build --no-restore --verbosity=normal" +
$" --logger \"trx;logfilename=..\\..\\..\\{ArtifactsDir}\\{project}.trx\"");
}
catch (NonZeroExitCodeException) when (ShouldCatch())
catch (ExitCodeException) when (ShouldCatch())
{
TestProjectsWithFailures.Add(project);
}
Expand Down Expand Up @@ -106,6 +108,11 @@ void RunTest(string project)
DependsOn(Build),
() => RunTest("SqlStreamStore.Postgres.Tests"));

Target(
TestPostgresV2,
DependsOn(Build),
() => RunTest("SqlStreamStore.Postgres.V2.Tests"));

Target(
TestSqlite,
DependsOn(Build),
Expand All @@ -123,6 +130,7 @@ void RunTest(string project)
"SqlStreamStore.MsSql",
"SqlStreamStore.MySql",
"SqlStreamStore.Postgres",
"SqlStreamStore.PostgresV2",
"SqlStreamStore.HAL",
"SqlStreamStore.Http",
"SqlStreamStore.Sqlite",
Expand All @@ -146,7 +154,7 @@ void RunTest(string project)

foreach (var packageToPush in packagesToPush)
{
Run("dotnet", $"nuget push {packageToPush} -s https://f.feedz.io/logicality/streamstore-ci/nuget/index.json -k {apiKey} --skip-duplicate", noEcho: true);
Run("dotnet", $"nuget push {packageToPush} -s https://f.feedz.io/gritti/sqlstreamstore/nuget/index.json -k {apiKey} --skip-duplicate", noEcho: true);
}
});

Expand Down
6 changes: 3 additions & 3 deletions build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="SimpleExec" Version="6.2.0" />
<PackageReference Include="Bullseye" Version="3.8.0" />
<PackageReference Include="SimpleExec" Version="8.0.0" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>cqrs;event-sourcing;event-store;stream-store</PackageTags>
<NoWarn>$(NoWarn);1701;1702;1705;1591</NoWarn>
<LangVersion>7.3</LangVersion>
<LangVersion>9.0</LangVersion>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerMinimumMajorMinor>1.2</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>1.3</MinVerMinimumMajorMinor>
<DebugType>full</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="2.3.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<Target Name="Adjust_Version_1_Releases_AssemblyVersion" AfterTargets="MinVer" Condition="'$(MinVerMajor)' == '1'">
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/LoadTests/AppendsReadsDeadlocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ await dictStreamMessage.ForEachAsync(chunkSize,
}
}

public async Task<long> GetManyPagesAsync(IStreamStore store, int chunksCount, int batchSize)
public async Task<long> GetManyPagesAsync(IStreamStore<IReadAllPage> store, int chunksCount, int batchSize)
{
long start = 0;
//var events = new List<StreamMessage>();
Expand Down
45 changes: 4 additions & 41 deletions src/LoadTests/LoadTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,20 @@
using System.Threading.Tasks;
using EasyConsole;
using SqlStreamStore;
using SqlStreamStore.Streams;


public abstract class LoadTest
{
public abstract Task Run(CancellationToken cancellationToken);

protected async Task<(IStreamStore, Action)> GetStore(CancellationToken cancellationToken)
protected async Task<(IStreamStore<IReadAllPage>, Action)> GetStore(CancellationToken cancellationToken)
{
IStreamStore streamStore = null;
IStreamStore<IReadAllPage> streamStore = null;
IDisposable disposable = null;

Output.WriteLine(ConsoleColor.Yellow, "Store type:");
await new Menu()
.AddSync("InMem", () => streamStore = new InMemoryStreamStore())
.Add("MS SQL V2 (Docker)",
async _ =>
{
var fixture = new MsSqlStreamStoreDb("dbo");
Console.WriteLine(fixture.ConnectionString);
streamStore = await fixture.GetStreamStore();
disposable = fixture;
})
.Add("MS SQL V3 (Docker)",
async _ =>
{
var fixture = new MsSqlStreamStoreDbV3("dbo");
Console.WriteLine(fixture.ConnectionString);
streamStore = await fixture.GetStreamStore();
disposable = fixture;
})
.AddSync("MS SQL V3 (LocalDB)",
() =>
{
var sqlLocalDb = new SqlLocalDb();
Console.WriteLine(sqlLocalDb.ConnectionString);
streamStore = sqlLocalDb.StreamStore;
disposable = sqlLocalDb;
})
.Add("MYSQL V3 (Docker)",
async ct =>
{
var mysqlDb = new MySqlStreamStoreDb();
streamStore = await mysqlDb.GetMySqlStreamStore();
disposable = streamStore;
})
.Add("Postgres (Docker)",
async ct =>
{
Expand All @@ -67,13 +37,6 @@ public abstract class LoadTest
streamStore = await postgresStreamStoreDb.GetPostgresStreamStore(true);
disposable = postgresStreamStoreDb;
})
.Add("MySql (Docker)",
async ct =>
{
var db = new MySqlStreamStoreDb();
streamStore = await db.GetMySqlStreamStore();
disposable = db;
})
/*.Add("MySql (Server)",
async ct =>
{
Expand Down
12 changes: 7 additions & 5 deletions src/LoadTests/LoadTests.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64;ubuntu.16.10-x64;ubuntu.14.04-x64</RuntimeIdentifiers>
<OutputType>exe</OutputType>
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyConsoleStd" Version="2.0.0" />
<PackageReference Include="MartinCostello.SqlLocalDb" Version="3.0.0" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="MartinCostello.SqlLocalDb" Version="3.1.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SqlStreamStore.MsSql\SqlStreamStore.MsSql.csproj" />
<ProjectReference Include="..\SqlStreamStore.MySql\SqlStreamStore.MySql.csproj" />
<ProjectReference Include="..\SqlStreamStore.Postgres\SqlStreamStore.Postgres.csproj" />
<ProjectReference Include="..\SqlStreamStore.TestUtils\SqlStreamStore.TestUtils.csproj" />
<ProjectReference Include="..\SqlStreamStore\SqlStreamStore.csproj" />
Expand Down
86 changes: 0 additions & 86 deletions src/LoadTests/MsSqlStreamStoreDb.cs

This file was deleted.

Loading