Skip to content

Implement Akka.MultiNodeTestRunner.VisualStudio package #8

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

Merged
merged 48 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4b504bc
Added Akka.MultiNodeTestRunner.VisualStudio project
IgorFedchenko Jan 31, 2020
669e34b
Port of https://github.com/akkadotnet/akka.net/pull/4180 (#6)
IgorFedchenko Jan 31, 2020
7a44ec0
Merge branch 'dev' into add-vs-runner
IgorFedchenko Jan 31, 2020
506ce55
Added sample spec
IgorFedchenko Feb 1, 2020
5b72048
Updated references
IgorFedchenko Feb 1, 2020
79ef422
Added props files + fixed paths
IgorFedchenko Feb 1, 2020
cec8bac
Fixed paths for dotnetcore
IgorFedchenko Feb 1, 2020
1ca5633
Updated fixed package version
IgorFedchenko Feb 1, 2020
2ad6c40
Updated package version
IgorFedchenko Feb 1, 2020
2a9cea1
Writing custom adapter from scratch
IgorFedchenko Feb 1, 2020
3824061
Adapted MNTR to run tests (proof-of-concept, always passing)
IgorFedchenko Feb 1, 2020
99ac61c
Refactored project names and namespaces
IgorFedchenko Feb 4, 2020
6616b4d
Fixed references
IgorFedchenko Feb 4, 2020
a18c643
Moved shared MNTR/TestAdapter logic into TestRunner.Shared
IgorFedchenko Feb 4, 2020
41dd1b4
Fixed MNTR run detection
IgorFedchenko Feb 4, 2020
e951250
Added MNTR detection issue from Akka.NET
IgorFedchenko Feb 4, 2020
74a8459
MNTR code refactoring
IgorFedchenko Feb 4, 2020
64ba990
Fixed utils paths under `dotnet test`
IgorFedchenko Feb 4, 2020
73c971e
Removed exception logging
IgorFedchenko Feb 4, 2020
14ebed7
Fixed dotnet test run + added some specs
IgorFedchenko Feb 5, 2020
66303ab
Refactored and implemented test discovery
IgorFedchenko Feb 5, 2020
ee4764d
Fixed running Akka.MultiNode.NodeRunner under .net core
IgorFedchenko Feb 5, 2020
245896e
Handling exception when .net472 assembly is loaded under .net core ru…
IgorFedchenko Feb 5, 2020
72e5a9d
Removed local feed from nuget.config
IgorFedchenko Feb 5, 2020
2ee6336
Disabled MNTR tests parallelization
IgorFedchenko Feb 5, 2020
eda48c4
Fixed multiple MNTR running conflict
IgorFedchenko Feb 7, 2020
75de83a
Fixed referenced test assembly path
IgorFedchenko Feb 7, 2020
44c5c97
Fixed test run from net472
IgorFedchenko Feb 7, 2020
08c168e
Ignoring xunit tests in multi-node tests assembly
IgorFedchenko Feb 7, 2020
3754949
Handle missing output directory when no tests are executed
IgorFedchenko Feb 7, 2020
1e771b8
Fixed xunit test ignoring by MNTR
IgorFedchenko Feb 7, 2020
e547f67
Fixed node runner discovery under different platforms
IgorFedchenko Feb 7, 2020
f23af94
Fix compiler errors
IgorFedchenko Feb 7, 2020
128b2d8
Fixed nuget generation and target dependencies
IgorFedchenko Feb 7, 2020
e3db2f4
Fixed discovery of xunit tests error message, and discovery tests con…
IgorFedchenko Feb 7, 2020
b655444
Fixed race condition on taking random free port
IgorFedchenko Feb 7, 2020
9d48b75
LocalAddress handling report
IgorFedchenko Feb 7, 2020
1cf052a
Bind logging
IgorFedchenko Feb 7, 2020
295eb69
Fix options mutability issues
IgorFedchenko Feb 7, 2020
8d06294
Throw on unexpected endpoint type under linux
IgorFedchenko Feb 7, 2020
1cd4cd4
Added logging for debugging
IgorFedchenko Feb 7, 2020
8abd463
Fixed bound port saving + added more logging of node runner process path
IgorFedchenko Feb 7, 2020
0391988
Add discovery of node runner under CoreClr
IgorFedchenko Feb 7, 2020
0e7d997
Fix MNTR platform under linux
IgorFedchenko Feb 7, 2020
52fc65c
Fixed platform selection under windows/linux for coreclr
IgorFedchenko Feb 7, 2020
471ab47
Added platform logging
IgorFedchenko Feb 7, 2020
03aaffb
Fixed default MNTR settings for linux
IgorFedchenko Feb 7, 2020
bbab661
Logging cleanup
IgorFedchenko Feb 7, 2020
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
32 changes: 28 additions & 4 deletions Akka.MultiNodeTestRunner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29230.47
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNodeTestRunner", "src\Akka.MultiNodeTestRunner\Akka.MultiNodeTestRunner.csproj", "{E945AABA-2779-41E8-9B43-8898FFD64F22}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNode.TestRunner", "src\Akka.MultiNode.TestRunner\Akka.MultiNode.TestRunner.csproj", "{E945AABA-2779-41E8-9B43-8898FFD64F22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{79D71264-186B-4F62-8930-35DD9ECCAF3B}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -13,11 +13,19 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{79D71264
build.sh = build.sh
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNodeTestRunner.Shared", "src\Akka.MultiNodeTestRunner.Shared\Akka.MultiNodeTestRunner.Shared.csproj", "{2F249AFE-6F7E-42CA-9D84-A3914F9DD158}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNode.Shared", "src\Akka.MultiNode.Shared\Akka.MultiNode.Shared.csproj", "{2F249AFE-6F7E-42CA-9D84-A3914F9DD158}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.NodeTestRunner", "src\Akka.NodeTestRunner\Akka.NodeTestRunner.csproj", "{5150BF37-8247-4A47-AFB6-300DD7426DC4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNode.NodeRunner", "src\Akka.MultiNode.NodeRunner\Akka.MultiNode.NodeRunner.csproj", "{5150BF37-8247-4A47-AFB6-300DD7426DC4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNodeTestRunner.Shared.Tests", "src\Akka.MultiNodeTestRunner.Shared.Tests\Akka.MultiNodeTestRunner.Shared.Tests.csproj", "{6E3C7F54-F954-4D4C-B9CA-ACFEF046E036}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.MultiNode.Shared.Tests", "src\Akka.MultiNode.Shared.Tests\Akka.MultiNode.Shared.Tests.csproj", "{6E3C7F54-F954-4D4C-B9CA-ACFEF046E036}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.MultiNode.TestAdapter", "src\Akka.MultiNode.TestAdapter\Akka.MultiNode.TestAdapter.csproj", "{F3037C62-E780-4619-89B3-BA21C7168DFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.MultiNode.SampleMultiNodeTests", "src\Akka.MultiNode.SampleMultiNodeTests\Akka.MultiNode.SampleMultiNodeTests.csproj", "{89D2C131-718F-4C93-9343-72E5BE6F7317}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.MultiNode.TestRunner.Shared", "src\Akka.MultiNode.TestRunner.Shared\Akka.MultiNode.TestRunner.Shared.csproj", "{ECAF9A0E-8ED2-460A-8408-4648F2BC3FB5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.MultiNode.TestAdapter.Tests", "src\Akka.MultiNode.TestAdapter.Tests\Akka.MultiNode.TestAdapter.Tests.csproj", "{A66D60EE-714F-4297-A9BD-222CFD868C28}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -41,6 +49,22 @@ Global
{6E3C7F54-F954-4D4C-B9CA-ACFEF046E036}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E3C7F54-F954-4D4C-B9CA-ACFEF046E036}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E3C7F54-F954-4D4C-B9CA-ACFEF046E036}.Release|Any CPU.Build.0 = Release|Any CPU
{F3037C62-E780-4619-89B3-BA21C7168DFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3037C62-E780-4619-89B3-BA21C7168DFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3037C62-E780-4619-89B3-BA21C7168DFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3037C62-E780-4619-89B3-BA21C7168DFA}.Release|Any CPU.Build.0 = Release|Any CPU
{89D2C131-718F-4C93-9343-72E5BE6F7317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89D2C131-718F-4C93-9343-72E5BE6F7317}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89D2C131-718F-4C93-9343-72E5BE6F7317}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89D2C131-718F-4C93-9343-72E5BE6F7317}.Release|Any CPU.Build.0 = Release|Any CPU
{ECAF9A0E-8ED2-460A-8408-4648F2BC3FB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECAF9A0E-8ED2-460A-8408-4648F2BC3FB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECAF9A0E-8ED2-460A-8408-4648F2BC3FB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECAF9A0E-8ED2-460A-8408-4648F2BC3FB5}.Release|Any CPU.Build.0 = Release|Any CPU
{A66D60EE-714F-4297-A9BD-222CFD868C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A66D60EE-714F-4297-A9BD-222CFD868C28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A66D60EE-714F-4297-A9BD-222CFD868C28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A66D60EE-714F-4297-A9BD-222CFD868C28}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
12 changes: 7 additions & 5 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="myget.org/F/xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" protocolVersion="3" />
<add key="myget.org/F/b4ff5f6" value="http://www.myget.org/F/b4ff5f68eccf4f6bbfed74f055f88d8f/api/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
</disabledPackageSources>
</configuration>
18 changes: 9 additions & 9 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ Target "CreateNuget" (fun _ ->
let projects = !! "src/**/*.csproj"
-- "src/**/*Tests.csproj" // Don't publish unit tests
-- "src/**/*Tests*.csproj"
-- "src/**/*.MultiNodeTestRunner.csproj"
-- "src/**/*.MultiNodeTestRunner.Shared.csproj"
-- "src/**/*.NodeTestRunner.csproj"
-- "src/**/*.MultiNode.TestRunner.csproj"
-- "src/**/*.MultiNode.TestRunner.Shared.csproj"
-- "src/**/*.MultiNode.NodeRunner.csproj"

let runSingleProject project =
DotNetCli.Pack
Expand All @@ -219,7 +219,7 @@ Target "CreateNuget" (fun _ ->
)

Target "PublishMntr" (fun _ ->
let executableProjects = !! "./src/**/Akka.MultiNodeTestRunner.csproj"
let executableProjects = !! "./src/**/Akka.MultiNode.TestRunner.csproj"

executableProjects |> Seq.iter (fun project ->
DotNetCli.Restore
Expand Down Expand Up @@ -251,12 +251,12 @@ Target "PublishMntr" (fun _ ->

Target "CreateMntrNuget" (fun _ ->
// uses the template file to create a temporary .nuspec file with the correct version
CopyFile "./src/Akka.MultiNodeTestRunner/Akka.MultiNodeTestRunner.nuspec" "./src/Akka.MultiNodeTestRunner/Akka.MultiNodeTestRunner.nuspec.template"
CopyFile "./src/Akka.MultiNode.TestRunner/Akka.MultiNode.TestRunner.nuspec" "./src/Akka.MultiNode.TestRunner/Akka.MultiNode.TestRunner.nuspec.template"
let commonPropsVersionPrefix = XMLRead true "./src/common.props" "" "" "//Project/PropertyGroup/VersionPrefix" |> Seq.head
let versionReplacement = List.ofSeq [ "@version@", commonPropsVersionPrefix + (if (not (versionSuffix = "")) then ("-" + versionSuffix) else "") ]
TemplateHelper.processTemplates versionReplacement [ "./src/Akka.MultiNodeTestRunner/Akka.MultiNodeTestRunner.nuspec" ]
TemplateHelper.processTemplates versionReplacement [ "./src/Akka.MultiNode.TestRunner/Akka.MultiNode.TestRunner.nuspec" ]

let executableProjects = !! "./src/**/Akka.MultiNodeTestRunner.csproj"
let executableProjects = !! "./src/**/Akka.MultiNode.TestRunner.csproj"

executableProjects |> Seq.iter (fun project ->
DotNetCli.Pack
Expand All @@ -269,7 +269,7 @@ Target "CreateMntrNuget" (fun _ ->
OutputPath = "\"" + outputNuGet + "\"" } )
)

DeleteFile "./src/Akka.MultiNodeTestRunner/Akka.MultiNodeTestRunner.nuspec"
DeleteFile "./src/Akka.MultiNode.TestRunner/Akka.MultiNode.TestRunner.nuspec"
)

Target "PublishNuget" (fun _ ->
Expand Down Expand Up @@ -356,7 +356,7 @@ Target "Nuget" DoNothing
"Build" ==> "RunTests"

// nuget dependencies
"Clean" ==> "Build" ==> "CreateMntrNuget" ==> "CreateNuget"
"BuildRelease" ==> "CreateMntrNuget" ==> "CreateNuget"
"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget"

// docs
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.54"
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<AssemblyTitle>Akka.NodeTestRunner</AssemblyTitle>
<AssemblyTitle>Akka.MultiNode.NodeRunner</AssemblyTitle>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Akka.MultiNode.NodeRunner</RootNamespace>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Akka.MultiNodeTestRunner.Shared\Akka.MultiNodeTestRunner.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
<PackageReference Include="xunit.runner.utility" Version="$(XunitVersion)" />
<PackageReference Include="Akka.Remote.TestKit" Version="$(AkkaVersion)" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="$(AkkaVersion)" />
</ItemGroup>
Expand All @@ -21,6 +20,10 @@
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Akka.MultiNode.Shared\Akka.MultiNode.Shared.csproj" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetCoreTestVersion)' ">
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Xunit;
using Xunit.Abstractions;

namespace Akka.NodeTestRunner
namespace Akka.MultiNode.NodeRunner
{
[Serializable]
public class Discovery : TestMessageVisitor<IDiscoveryCompleteMessage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.IO;
using Akka.MultiNodeTestRunner.Shared.Sinks;
using Akka.MultiNode.Shared.Environment;
using Akka.MultiNode.Shared.Sinks;
using Akka.Remote.TestKit;
using Xunit;

#if CORECLR
using System.Runtime.Loader;
using Microsoft.Extensions.DependencyModel;
#endif

namespace Akka.NodeTestRunner
namespace Akka.MultiNode.NodeRunner
{
class Program
{
Expand All @@ -50,16 +50,26 @@ static int Main(string[] args)
var system = ActorSystem.Create("NoteTestRunner-" + nodeIndex);
var tcpClient = _logger = system.ActorOf<RunnerTcpClient>();
system.Tcp().Tell(new Tcp.Connect(listenEndpoint), tcpClient);

MultiNodeEnvironment.Initialize();

#if CORECLR
// In NetCore, if the assembly file hasn't been touched,
// XunitFrontController would fail loading external assemblies and its dependencies.
AssemblyLoadContext.Default.Resolving += (assemblyLoadContext, assemblyName) => DefaultOnResolving(assemblyLoadContext, assemblyName, assemblyFileName);
var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyFileName);
DependencyContext.Load(assembly)
var dependencyContext = DependencyContext.Load(assembly);
if (dependencyContext == null)
{
Console.WriteLine($"Failed to load assembly under .NET Core from {assemblyFileName}. " +
$"Possible reason is that assembly is compiled under .NET Full Framework.");
Environment.Exit(1);
return 1;
}

dependencyContext
.CompileLibraries
.Where(dep => dep.Name.ToLower()
.Contains(assembly.FullName.Split(new[] { ',' })[0].ToLower()))
.Where(dep => dep.Name.ToLower().Contains(assembly.FullName.Split(new[] {','})[0].ToLower()))
.Select(dependency => AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(dependency.Name)));
#endif

Expand All @@ -72,7 +82,7 @@ static int Main(string[] args)
* the Discovery class to actually not find any individual specs to run
*/
var assemblyName = Path.GetFileName(assemblyFileName);
Console.WriteLine("Running specs for {0} [{1}]", assemblyName, assemblyFileName);
Console.WriteLine("Running specs for {0} [{1}] ", assemblyName, assemblyFileName);
using (var discovery = new Discovery(assemblyName, typeName))
{
using (var sink = new Sink(nodeIndex, nodeRole, tcpClient))
Expand Down Expand Up @@ -139,8 +149,9 @@ static int Main(string[] args)
FlushLogMessages();
system.Terminate().Wait();

Environment.Exit(sink.Passed && !timedOut ? 0 : 1);
return sink.Passed ? 0 : 1;
var retCode = sink.Passed && !timedOut ? 0 : 1;
Environment.Exit(retCode);
return retCode;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using Akka.Actor;
using Akka.MultiNodeTestRunner.Shared.Sinks;
using Akka.MultiNode.Shared.Sinks;
using Xunit;
using Xunit.Abstractions;
using IMessageSink = Xunit.Abstractions.IMessageSink;

namespace Akka.NodeTestRunner
namespace Akka.MultiNode.NodeRunner
{
#if CORECLR
class Sink : IMessageSink, IDisposable
Expand Down Expand Up @@ -46,6 +44,7 @@ public bool OnMessage(IMessageSinkMessage message)
_logger.Tell(resultMessage.Output);
Console.WriteLine(resultMessage.Output);
}

var testPassed = message as ITestPassed;
if (testPassed != null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<RootNamespace>Akka.MultiNode.TestAdapter.SampleTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka.Cluster.TestKit" Version="1.4.0-beta4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Akka.MultiNode.Shared\Akka.MultiNode.Shared.csproj" />
<ProjectReference Include="..\Akka.MultiNode.TestAdapter\Akka.MultiNode.TestAdapter.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Remove="TestResults\**" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Remove="TestResults\**" />
</ItemGroup>

<ItemGroup>
<None Remove="TestResults\**" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions src/Akka.MultiNode.SampleMultiNodeTests/IgnoredXunitTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using Xunit;

namespace Akka.MultiNode.TestAdapter.SampleTests
{
public class IgnoredXunitTest
{
[Fact(Skip = "This test should be ignored by MNTR")]
public void Ignored_test()
{
throw new Exception("This test should be ignored by MNTR");
}
}
}
50 changes: 50 additions & 0 deletions src/Akka.MultiNode.SampleMultiNodeTests/SampleMultiNodeSpec.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using Akka.Cluster.TestKit;
using Akka.MultiNode.NodeRunner;
using Akka.MultiNode.Shared.Environment;
using Akka.MultiNode.TestRunner.Shared;
using Akka.Remote.TestKit;

namespace Akka.MultiNode.TestAdapter.SampleTests
{
public class SampleMultiNodeSpecConfig : MultiNodeConfig
{
public RoleName First { get; }
public RoleName Second { get; }

public SampleMultiNodeSpecConfig()
{
First = Role("first");
Second = Role("second");

CommonConfig = DebugConfig(true)
.WithFallback(MultiNodeClusterSpec.ClusterConfig());
}
}

public class SampleMultiNodeSpec : MultiNodeClusterSpec
{
private readonly SampleMultiNodeSpecConfig _config;

public SampleMultiNodeSpec() : this(new SampleMultiNodeSpecConfig())
{
}

private SampleMultiNodeSpec(SampleMultiNodeSpecConfig config) : base(config, typeof(SampleMultiNodeSpec))
{
_config = config;
}

// [MultiNodeFact]
[CustomMultiNodeFact]
public void Should_start_and_join_cluster()
{
RunOn(StartClusterNode, _config.First);

EnterBarrier("first-started");

RunOn(() => Cluster.Join(GetAddress(_config.First)), _config.Second);

EnterBarrier("after");
}
}
}
Loading