Skip to content

Commit

Permalink
Fix approval specs to use Xunit2Reporter when v2 runner is used (#4766)
Browse files Browse the repository at this point in the history
* Let approval specs to run under different targets (not only full framework)

* Forse xunit.assert to be loaded before tests reporting

* Break public API (this commit should be rolled back once CI will fail properly)

* Make PR more lightweight for CI

* Remove breaking public API change
  • Loading branch information
IgorFedchenko authored Feb 8, 2021
1 parent 8d48ef9 commit 1502dbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Akka.Cluster.Sharding
using ShardId = String;
using EntryId = String;
using Msg = Object;

/// <summary>
/// This actor creates children entity actors on demand that it is told to be
/// responsible for. It is used when `rememberEntities` is enabled.
Expand Down
7 changes: 2 additions & 5 deletions src/core/Akka.API.Tests/Akka.API.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<AssemblyTitle>Akka.API.Tests</AssemblyTitle>
<TargetFrameworks>$(NetFrameworkTestVersion)</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<UserSecretsId>93253ee8-0410-4483-9809-9bb2d32860fa</UserSecretsId>
</PropertyGroup>

Expand All @@ -28,14 +28,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageReference Include="ApiApprover" Version="9.3.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="App_Packages\" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/core/Akka.API.Tests/CoreAPISpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ namespace Akka.API.Tests
{
public class CoreAPISpec
{
public CoreAPISpec()
{
// force xunit.assert to be loaded into context, to fix https://github.com/akkadotnet/akka.net/issues/4765
var ass = AppDomain.CurrentDomain.Load("xunit.assert");
}

[Fact]
[MethodImpl(MethodImplOptions.NoInlining)]
public void ApproveCore()
Expand Down

0 comments on commit 1502dbc

Please sign in to comment.