-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 1.1.0-beta2 release
- Loading branch information
Showing
13 changed files
with
197 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"msbuild-sdks": { | ||
"MSBuild.Sdk.Extras": "3.0.38" | ||
"MSBuild.Sdk.Extras": "3.0.44" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Akka.MultiNode.SampleMultiNodeTests/Metadata/SampleTestsMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Akka.MultiNode.TestAdapter/Internal/CollectionPerSessionTestCollectionFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Akka.MultiNode.TestAdapter.Internal | ||
{ | ||
internal class CollectionPerSessionTestCollectionFactory : IXunitTestCollectionFactory | ||
{ | ||
private readonly Dictionary<IAssemblyInfo, TestCollection> _collectionCache = | ||
new Dictionary<IAssemblyInfo, TestCollection>(); | ||
|
||
public ITestCollection Get(ITypeInfo testClass) | ||
{ | ||
if (_collectionCache.TryGetValue(testClass.Assembly, out var collection)) | ||
return collection; | ||
|
||
collection = new TestCollection( | ||
new TestAssembly(testClass.Assembly), | ||
null, | ||
$"MultiNode test collection for {Path.GetFileName(testClass.Assembly.AssemblyPath)}"); | ||
_collectionCache[testClass.Assembly] = collection; | ||
return collection; | ||
} | ||
|
||
public string DisplayName => "collection-per-session"; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Akka.MultiNode.TestAdapter/Internal/MultiNodeTestAssemblyRunner.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Akka.MultiNode.TestAdapter.Internal | ||
{ | ||
internal class MultiNodeTestAssemblyRunner : XunitTestAssemblyRunner | ||
{ | ||
public MultiNodeTestAssemblyRunner( | ||
ITestAssembly testAssembly, | ||
IEnumerable<IXunitTestCase> testCases, | ||
IMessageSink diagnosticMessageSink, | ||
IMessageSink executionMessageSink, | ||
ITestFrameworkExecutionOptions executionOptions) | ||
: base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions) | ||
{ | ||
} | ||
|
||
protected override async Task<RunSummary> RunTestCollectionsAsync(IMessageBus messageBus, CancellationTokenSource cancellationTokenSource) | ||
{ | ||
var summary = new RunSummary(); | ||
|
||
foreach (var (testCollection, testCases) in OrderTestCollections()) | ||
{ | ||
summary.Aggregate(await RunTestCollectionAsync(messageBus, testCollection, testCases, cancellationTokenSource)); | ||
if (cancellationTokenSource.IsCancellationRequested) | ||
break; | ||
} | ||
|
||
return summary; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Akka.MultiNode.TestAdapter/Internal/MultiNodeTestFrameworkExecutor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Akka.MultiNode.TestAdapter.Internal | ||
{ | ||
internal class MultiNodeTestFrameworkExecutor : XunitTestFrameworkExecutor | ||
{ | ||
public MultiNodeTestFrameworkExecutor( | ||
AssemblyName assemblyName, | ||
ISourceInformationProvider sourceInformationProvider, | ||
IMessageSink diagnosticMessageSink) | ||
: base(assemblyName, sourceInformationProvider, diagnosticMessageSink) | ||
{ | ||
} | ||
|
||
protected override async void RunTestCases(IEnumerable<IXunitTestCase> testCases, IMessageSink executionMessageSink, | ||
ITestFrameworkExecutionOptions executionOptions) | ||
{ | ||
using (var assemblyRunner = new MultiNodeTestAssemblyRunner(TestAssembly, testCases, DiagnosticMessageSink, executionMessageSink, executionOptions)) | ||
await assemblyRunner.RunAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Reflection; | ||
using Akka.MultiNode.TestAdapter.Internal; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Akka.MultiNode.TestAdapter | ||
{ | ||
public class MultiNodeTestFramework : TestFramework | ||
{ | ||
public MultiNodeTestFramework(IMessageSink diagnosticMessageSink) : base(diagnosticMessageSink) | ||
{ | ||
} | ||
|
||
protected override ITestFrameworkDiscoverer CreateDiscoverer(IAssemblyInfo assemblyInfo) | ||
{ | ||
return new XunitTestFrameworkDiscoverer( | ||
assemblyInfo: assemblyInfo, | ||
sourceProvider: SourceInformationProvider, | ||
diagnosticMessageSink: DiagnosticMessageSink, | ||
collectionFactory: new CollectionPerSessionTestCollectionFactory()); | ||
} | ||
|
||
protected override ITestFrameworkExecutor CreateExecutor(AssemblyName assemblyName) | ||
{ | ||
return new MultiNodeTestFrameworkExecutor(assemblyName, SourceInformationProvider, DiagnosticMessageSink); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters