Skip to content

Commit ed71eb0

Browse files
authored
1.0.0 Release (#97)
* Add documentation (#95) * Make sure output directory are cleared before the test session starts, not between the tests * Add documentation to the README file * Update RELEASE_NOTES.md for 1.0.0 release (#96)
1 parent 8037e2f commit ed71eb0

File tree

4 files changed

+43
-6
lines changed

4 files changed

+43
-6
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
1-
# Akka.MultiNodeTestRunner
1+
# Akka.MultiNode.TestAdapter
2+
3+
Visual Studio 2019 Test Explorer and .NET CLI Test runner for the Akka.NET MultiNode tests
4+
5+
## Documentation
6+
`Akka.MultiNode.TestAdapter` is a standalone .NET CLI and VSTest adapter for Akka.NET multi node testkit;
7+
It allows you to run multinode tests directly inside Visual Studio Text Explorer window and run them
8+
using the `dotnet test` .NET CLI command.
9+
10+
To use the VSTest test adapter in your multinode spec projects, You will need to add these nuget packages:
11+
- [Akka.MultiNode.TestAdapter](https://www.nuget.org/packages/Akka.MultiNode.TestAdapter)
12+
- [Microsoft.NET.Test.Sdk](https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/)
13+
14+
Documentation regarding the multinode specs themselves can be read in the Akka.NET documentation pages:
15+
- [Using the MultiNode TestKit](https://getakka.net/articles/networking/multi-node-test-kit.html)
16+
- [Multi-Node Testing Distributed Akka.NET Applications](https://getakka.net/articles/testing/multi-node-testing.html)
17+
18+
### VSTest .runsettings
19+
This is the .runsettings XML sub-section `Akka.MultiNode.TestAdapter` can use:
20+
```xml
21+
<?xml version="1.0" encoding="utf-8"?>
22+
<RunSettings>
23+
<MultiNodeTestRunnerOptions>
24+
<ListenAddress>127.0.0.1</ListenAddress>
25+
<ListenPort>0</ListenPort>
26+
<ClearOutputDirectory>false</ClearOutputDirectory>
27+
<UseTeamCityFormatting>false</UseTeamCityFormatting>
28+
</MultiNodeTestRunnerOptions>
29+
</RunSettings>
30+
```
231

3-
Update this readme file with your details.
32+
- **ListenAddress**: Determines the address that this multi-node test runner will use to listen for log messages from individual spec.
33+
- **ListenPort**: Determines the port number that this multi-node test runner will use to listen for log messages from individual spec.
34+
- **ClearOutputDirectory**: Clear the output directory before running the test session. If set to false, all test logs are appended to the out file.
35+
- **UseTeamCityFormatting**: Use TeamCity formatting on the log outputs.
436

537
## Building this solution
638
To run the build script associated with this solution, execute the following:

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 1.0.0 October 20 2019 ####
2+
- Fix [result folder clearing, add documentation](https://github.com/akkadotnet/Akka.MultiNodeTestRunner/pull/95)
3+
14
#### 1.0.0-beta2 October 05 2019 ####
25
- Fix, [node runner should ignore runs not started by MNTR](https://github.com/akkadotnet/Akka.MultiNodeTestRunner/pull/93)
36

src/Akka.MultiNode.TestAdapter/MultiNodeTestAdapter.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public void RunTests(IEnumerable<TestCase> rawTestCases, IRunContext runContext,
7676
var testCases = rawTestCases.ToList();
7777
var testResults = new ConcurrentDictionary<string, TestResult>();
7878
var options = BuildOptions(runContext, frameworkHandle);
79+
// Perform output cleanup before anything is logged
80+
if (options.ClearOutputDirectory && Directory.Exists(options.OutputDirectory))
81+
Directory.Delete(options.OutputDirectory, true);
7982

8083
foreach (var group in testCases.GroupBy(t => Path.GetFullPath(t.Source)))
8184
{
@@ -114,6 +117,9 @@ public void RunTests(IEnumerable<TestCase> rawTestCases, IRunContext runContext,
114117
public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
115118
{
116119
var options = BuildOptions(runContext, frameworkHandle);
120+
// Perform output cleanup before anything is logged
121+
if (options.ClearOutputDirectory && Directory.Exists(options.OutputDirectory))
122+
Directory.Delete(options.OutputDirectory, true);
117123
var testResults = new ConcurrentDictionary<string, TestResult>();
118124

119125
var testAssemblyPaths = sources.ToList();

src/Akka.MultiNode.TestAdapter/MultiNodeTestRunner.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ private void Initialize(string assemblyPath, MultiNodeTestRunnerOptions options)
8181
Console.WriteLine($"Platform name: {_platformName}");
8282

8383
_currentAssembly = fileName;
84-
// Perform output cleanup before anything is logged
85-
if (options.ClearOutputDirectory && Directory.Exists(options.OutputDirectory))
86-
Directory.Delete(options.OutputDirectory, true);
87-
8884
TestRunSystem = ActorSystem.Create("TestRunnerLogging");
8985

9086
var suiteName = Path.GetFileNameWithoutExtension(Path.GetFullPath(assemblyPath));

0 commit comments

Comments
 (0)