Skip to content

Commit

Permalink
Merge tag '9.0.0' into develop
Browse files Browse the repository at this point in the history
9.0.0
  • Loading branch information
AGiorgetti committed Dec 2, 2021
2 parents dc420a9 + 34ad7c0 commit 4f332c1
Show file tree
Hide file tree
Showing 47 changed files with 658 additions and 711 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
@@ -1,5 +1,11 @@
# NEventStore Versions

## 9.0.0

- Added support for .net 6 [#493](https://github.com/NEventStore/NEventStore/issues/493).
- Change / Optimization: Commit and CommitAttempt do not create internal readonly collections anymore, it can be useless given the fact we can change properties of events.
- NEventStore.Serialization.Json: accepts a JsonSerializerSettings to configure the serializer.

## 8.0.0

- Added support for .net 5 [#489](https://github.com/NEventStore/NEventStore/issues/489).
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,5 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2019 Preview
image: Visual Studio 2022
configuration: Release
assembly_info:
patch: true
Expand Down
3 changes: 2 additions & 1 deletion readme.markdown
Expand Up @@ -7,7 +7,8 @@ This library is developed with a specific focus on [DDD](http://en.wikipedia.org

NEventStore currently supports:

- .net 5
- .net 6.0
- .net 5.0
- .net standard 2.0
- .net framework 4.6.1

Expand Down
27 changes: 0 additions & 27 deletions src/NEventStore.Benchmark/Benchmarks/Md5VsSha256.cs

This file was deleted.

11 changes: 6 additions & 5 deletions src/NEventStore.Benchmark/Benchmarks/PersistenceBenchmarks.cs
Expand Up @@ -5,7 +5,7 @@
namespace NEventStore.Benchmark.Benchmarks
{
[Config(typeof(AllowNonOptimized))]
[SimpleJob(launchCount: 3, warmupCount: 3, targetCount: 20, invocationCount: -1)]
[SimpleJob(launchCount: 3, warmupCount: 3, targetCount: 3, invocationCount: 1)]
[MemoryDiagnoser]
[MeanColumn, StdErrorColumn, StdDevColumn, MinColumn, MaxColumn, IterationsColumn]
public class PersistenceBenchmarks
Expand All @@ -18,6 +18,9 @@ public PersistenceBenchmarks()
_eventStore = EventStoreHelpers.WireupEventStore();
}

[Params(100, 1000, 10000, 100000)]
public int CommitsToWrite { get; set; }

[Benchmark]
public void WriteToStream()
{
Expand All @@ -26,8 +29,7 @@ public void WriteToStream()
// if no commits exist then it creates a new stream for us.
using (var stream = _eventStore.OpenStream(StreamId, 0, int.MaxValue))
{
// add XXX commits to the stream
for (int i = 0; i < 500; i++)
for (int i = 0; i < CommitsToWrite; i++)
{
var @event = new SomeDomainEvent { Value = i.ToString() };
stream.Add(new EventMessage { Body = @event });
Expand All @@ -41,8 +43,7 @@ public void ReadSetup()
{
using (var stream = _eventStore.OpenStream(StreamId, 0, int.MaxValue))
{
// add XXX commits to the stream
for (int i = 0; i < 500; i++)
for (int i = 0; i < CommitsToWrite; i++)
{
var @event = new SomeDomainEvent { Value = i.ToString() };
stream.Add(new EventMessage { Body = @event });
Expand Down
4 changes: 2 additions & 2 deletions src/NEventStore.Benchmark/NEventStore.Benchmark.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/NEventStore.Example/NEventStore.Example.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/NEventStore.Persistence.AcceptanceTests/ExtensionMethods.cs
Expand Up @@ -54,7 +54,7 @@ public static CommitAttempt BuildAttempt(this string streamId, DateTime? now = n
now = now ?? SystemTime.UtcNow;
bucketId = bucketId ?? Bucket.Default;

var messages = new List<EventMessage>
var messages = new EventMessage[]
{
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Test"}},
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Test2"}},
Expand All @@ -74,15 +74,15 @@ public static CommitAttempt BuildAttempt(this string streamId, DateTime? now = n

public static CommitAttempt BuildNextAttempt(this ICommit commit)
{
var messages = new List<EventMessage>
var messages = new EventMessage[]
{
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Another test"}},
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Another test2"}},
};

return new CommitAttempt(commit.BucketId,
commit.StreamId,
commit.StreamRevision + messages.Count,
commit.StreamRevision + messages.Length,
Guid.NewGuid(),
commit.CommitSequence + 1,
commit.CommitStamp.AddSeconds(1),
Expand All @@ -92,7 +92,7 @@ public static CommitAttempt BuildNextAttempt(this ICommit commit)

public static CommitAttempt BuildNextAttempt(this CommitAttempt commit)
{
var messages = new List<EventMessage>
var messages = new EventMessage[]
{
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Another test"}},
new EventMessage {Body = new SomeDomainEvent {SomeProperty = "Another test2"}},
Expand Down Expand Up @@ -142,7 +142,7 @@ public static CommitAttempt BuildCommit(this string streamId)
}
};

return new CommitAttempt(streamId, streamRevision, commitId, commitSequence, SystemTime.UtcNow, headers, events.ToList());
return new CommitAttempt(streamId, streamRevision, commitId, commitSequence, SystemTime.UtcNow, headers, events);
}

[Serializable]
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<IsPackable>false</IsPackable>
<RootNamespace>NEventStore.Persistence.AcceptanceTests</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand All @@ -13,9 +13,9 @@
<DefineConstants>NUNIT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="NUnit" Version="3.13.2" />
</ItemGroup>
<ItemGroup>
<Compile Remove="ConfigurationExtensions.cs" />
Expand Down
23 changes: 9 additions & 14 deletions src/NEventStore.Persistence.AcceptanceTests/PersistenceTests.cs
@@ -1,6 +1,6 @@

#pragma warning disable 169 // ReSharper disable InconsistentNaming
#pragma warning disable IDE1006 // Naming Styles
#pragma warning disable S101 // Types should be named in PascalCase

namespace NEventStore.Persistence.AcceptanceTests
{
Expand Down Expand Up @@ -38,9 +38,9 @@ protected override void Context()
2,
Guid.NewGuid(),
1,
DateTime.Now,
DateTime.UtcNow,
new Dictionary<string, object> { { "key.1", "value" } },
new List<EventMessage> { new EventMessage { Body = new ExtensionMethods.SomeDomainEvent { SomeProperty = "Test" } } });
new EventMessage[] { new EventMessage { Body = new ExtensionMethods.SomeDomainEvent { SomeProperty = "Test" } } });
Persistence.Commit(attempt);
}

Expand Down Expand Up @@ -130,9 +130,7 @@ public void should_correctly_persist_the_events()
[Fact]
public void should_cause_the_stream_to_be_found_in_the_list_of_streams_to_snapshot()
{
#pragma warning disable RCS1202 // Avoid NullReferenceException.
Persistence.GetStreamsToSnapshot(1).FirstOrDefault(x => x.StreamId == _streamId).Should().NotBeNull();
#pragma warning restore RCS1202 // Avoid NullReferenceException.
}
}

Expand Down Expand Up @@ -330,8 +328,8 @@ protected override void Context()
commit.CommitId,
commit.CommitSequence,
commit.CommitStamp,
commit.Headers,
commit.Events);
commit.Headers.ToDictionary(k => k.Key, v => v.Value),
commit.Events.ToArray());
}

protected override void Because()
Expand Down Expand Up @@ -364,8 +362,8 @@ protected override void Context()
commit.CommitId,
commit.CommitSequence + 1,
commit.CommitStamp,
commit.Headers,
commit.Events
commit.Headers.ToDictionary(k => k.Key, v => v.Value),
commit.Events.ToArray()
);
}

Expand Down Expand Up @@ -611,9 +609,7 @@ protected override void Because()
[Fact]
public void should_find_the_stream_in_the_set_of_streams_to_be_snapshot_when_within_the_threshold()
{
#pragma warning disable RCS1202 // Avoid NullReferenceException.
Persistence.GetStreamsToSnapshot(WithinThreshold).FirstOrDefault(x => x.StreamId == _streamId).Should().NotBeNull();
#pragma warning restore RCS1202 // Avoid NullReferenceException.
}

[Fact]
Expand Down Expand Up @@ -1227,7 +1223,7 @@ public void can_commit()
1,
DateTime.UtcNow,
new Dictionary<string, object>(),
new List<EventMessage> { new EventMessage { Body = new string('a', bodyLength) } });
new EventMessage[] { new EventMessage { Body = new string('a', bodyLength) } });
Persistence.Commit(attempt);

ICommit commits = Persistence.GetFrom(0).Single();
Expand Down Expand Up @@ -1288,7 +1284,7 @@ protected virtual void Dispose(bool disposing)
/// This code was meant to be run right before every test in the fixture to give time
/// to do further initialization before the PersistenceEngineFixture was created.
/// Unfortunately the 3 frameworks
/// have very different ways of doing this:
/// have very different ways of doing this:
/// - NUnit: TestFixtureSetUp
/// - MSTest: ClassInitialize (not inherited, will be ignored if defined on a base class)
/// - xUnit: IUseFixture + SetFixture
Expand Down Expand Up @@ -1380,6 +1376,5 @@ protected virtual void Dispose(bool disposing)
}
}

#pragma warning restore S101 // Types should be named in PascalCase
#pragma warning restore 169 // ReSharper disable InconsistentNaming
#pragma warning restore IDE1006 // Naming Styles
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netstandard2.0;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>NEventStore.PollingClient</RootNamespace>
<AssemblyName>NEventStore.PollingClient</AssemblyName>
Expand Down
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -18,11 +18,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -7,9 +7,11 @@ namespace NEventStore.Serialization.AcceptanceTests
public partial class SerializerFixture
{
public SerializerFixture()
{
{
#pragma warning disable CS0618 // Type or member is obsolete
_createSerializer = () =>
new BinarySerializer();
new BinarySerializer();
#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -18,11 +18,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netstandard2.0;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>NEventStore.Serialization.Bson</RootNamespace>
<AssemblyName>NEventStore.Serialization.Bson</AssemblyName>
Expand Down

0 comments on commit 4f332c1

Please sign in to comment.