-
Notifications
You must be signed in to change notification settings - Fork 1k
Modify MNTR to work with the new MNTR package #5288
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
Changes from all commits
89aba34
f13af0f
89730cf
6ac62bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,19 @@ namespace Akka.Remote.TestKit | |
/// var testName = CommandLine.GetProperty("multinode.test-method"); | ||
/// </code> | ||
/// </summary> | ||
public class CommandLine | ||
public static class CommandLine | ||
{ | ||
private static readonly StringDictionary Values; | ||
private static readonly StringDictionary Values = new StringDictionary(); | ||
|
||
static CommandLine() | ||
{ | ||
Values = new StringDictionary(); | ||
Initialize(Environment.GetCommandLineArgs()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have to do this, else net472 tests would fail. It seems like static scope in net472 is different than in netcore, static somehow didn't get propagated from the node runner to the xunit test runner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahhh got it - need to defer the |
||
} | ||
|
||
public static void Initialize(string[] args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have to be able to inject arguments from other sources than |
||
{ | ||
// Detect and fix PowerShell command line input. | ||
// PowerShell splits command line arguments on '.' | ||
var args = Environment.GetCommandLineArgs(); | ||
var fixedArgs = new List<string>(); | ||
for (var i = 1; i < args.Length - 1; ++i) | ||
{ | ||
|
@@ -71,7 +73,7 @@ static CommandLine() | |
|
||
if (tokens.Length == 2) | ||
{ | ||
Values.Add(tokens[0], tokens[1]); | ||
Values[tokens[0]] = tokens[1].Trim().Trim('"'); | ||
} | ||
else | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,23 +16,17 @@ public class MultiNodeFactAttribute : FactAttribute | |
/// Set by MultiNodeTestRunner when running multi-node tests | ||
/// </summary> | ||
public const string MultiNodeTestEnvironmentName = "__AKKA_MULTI_NODE_ENVIRONMENT"; | ||
|
||
public static Lazy<bool> ExecutedByMultiNodeRunner = | ||
new Lazy<bool>(() => | ||
{ | ||
var args = Environment.GetCommandLineArgs(); | ||
if (args.Length == 0) return false; | ||
var firstArg = args[0]; | ||
return firstArg.Contains("Akka.MultiNodeTestRunner") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dropped because we're not using separate executable to run the nodes anymore, and we also have a different namespace/package name that conflicts these. We'll rely on the environment variable to detect whether a test is being run inside MNTR or not. |
||
|| firstArg.Contains("Akka.NodeTestRunner") | ||
|| Environment.GetEnvironmentVariable(MultiNodeTestEnvironmentName) != null; | ||
}); | ||
|
||
private bool? _executedByMultiNodeRunner; | ||
|
||
public override string Skip | ||
{ | ||
get | ||
{ | ||
return ExecutedByMultiNodeRunner.Value | ||
if (_executedByMultiNodeRunner == null) | ||
_executedByMultiNodeRunner = | ||
Environment.GetEnvironmentVariable(MultiNodeTestEnvironmentName) != null; | ||
return _executedByMultiNodeRunner != null && _executedByMultiNodeRunner.Value | ||
? base.Skip | ||
: "Must be executed by multi-node test runner"; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Flag to mark that the current test is being run inside the MNTR" according to @Arkatufus in chat - got it