Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Sqlite tests, uncommented snapshot tests in Persistence.Testkit #2724

Merged
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
1 change: 0 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Target "RunTests" (fun _ ->
-- "./**/Akka.MultiNodeTestRunner.Shared.Tests.csproj"
-- "./**/Akka.Persistence.Tests.csproj"
-- "./**/Akka.API.Tests.csproj"
-- "./**/Akka.Persistence.Sqlite.Tests.csproj"

let runSingleProject project =
DotNetCli.RunCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<AssemblyTitle>Akka.Persistence.Sqlite.Tests</AssemblyTitle>
<TargetFrameworks>net452;netcoreapp1.1</TargetFrameworks>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net452' And '$(OS)' == 'Windows_NT'">win7-x64</RuntimeIdentifier>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in the short-run - I @heynickc was mentioning this morning that the runtime might be part of the reason why we're having some trouble with the tests...

<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.Data.SQLite" Version="2.0.0-preview1-final" />
<PackageReference Include="Microsoft.Data.SQLite" Version="1.1.1" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

namespace Akka.Persistence.TestKit.Tests
{
public class LocalSnapshotStoreSpec : SnapshotStoreSpec
// FIXME
public abstract class LocalSnapshotStoreSpec : SnapshotStoreSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to make it abstract?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To skip only LocalSnapshot spec, not all specs inherited from SnapshotStoreSpec

{
private readonly string _path;
public LocalSnapshotStoreSpec(ITestOutputHelper output)
Expand Down
44 changes: 0 additions & 44 deletions src/core/Akka.Persistence.TestKit/Snapshot/SnapshotStoreSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,21 @@ private IEnumerable<SnapshotMetadata> WriteSnapshots()
}
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_not_load_a_snapshot_given_an_invalid_persistence_id()
{
SnapshotStore.Tell(new LoadSnapshot("invalid", SnapshotSelectionCriteria.Latest, long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == long.MaxValue);
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_timestamp_criteria()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(long.MaxValue, new DateTime(100000)), long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == long.MaxValue);
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_sequence_number_criteria()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(7), long.MaxValue), _senderProbe.Ref);
Expand All @@ -116,11 +104,7 @@ public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_sequence
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == 7);
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_load_the_most_recent_snapshot()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, SnapshotSelectionCriteria.Latest, long.MaxValue), _senderProbe.Ref);
Expand All @@ -131,11 +115,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot()
&& result.Snapshot.Snapshot.ToString() == "s-5");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_bound()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(13), long.MaxValue), _senderProbe.Ref);
Expand All @@ -153,11 +133,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper
&& result.Snapshot.Snapshot.ToString() == "s-3");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_and_timestamp_bound()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(13, Metadata[2].Timestamp), long.MaxValue), _senderProbe.Ref);
Expand All @@ -175,11 +151,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper
&& result.Snapshot.Snapshot.ToString() == "s-3");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_delete_a_single_snapshot_identified_by_SequenceNr_in_snapshot_metadata()
{
var md = Metadata[2];
Expand All @@ -200,11 +172,7 @@ public void SnapshotStore_should_delete_a_single_snapshot_identified_by_Sequence
&& result.Snapshot.Snapshot.ToString() == "s-2");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_delete_all_snapshots_matching_upper_sequence_number_and_timestamp_bounds()
{
var md = Metadata[2];
Expand All @@ -228,11 +196,7 @@ public void SnapshotStore_should_delete_all_snapshots_matching_upper_sequence_nu
&& result.Snapshot.Snapshot.ToString() == "s-4");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_not_delete_snapshots_with_non_matching_upper_timestamp_bounds()
{
var md = Metadata[3];
Expand All @@ -253,11 +217,7 @@ public void SnapshotStore_should_not_delete_snapshots_with_non_matching_upper_ti
&& result.Snapshot.Snapshot.ToString() == "s-4");
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_save_and_overwrite_snapshot_with_same_sequence_number()
{
var md = Metadata[4];
Expand All @@ -271,11 +231,7 @@ public void SnapshotStore_should_save_and_overwrite_snapshot_with_same_sequence_
// metadata timestamp may have been changed
}

#if CORECLR
[Fact(Skip = "Fails on .NET Core")]
#else
[Fact]
#endif
public void SnapshotStore_should_save_bigger_size_snapshot()
{
var metadata = new SnapshotMetadata(Pid, 100);
Expand Down