Skip to content

Commit

Permalink
#1088 MultiNode tests can now be skipped by specifying a SkipReason
Browse files Browse the repository at this point in the history
  • Loading branch information
schatekar committed Aug 8, 2015
1 parent e6ca2ac commit 75f966c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/Akka.MultiNodeTestRunner.Shared/NodeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class NodeTest
public string TestName { get; set; }
public string TypeName { get; set; }
public string MethodName { get; set; }
public string SkipReason { get; set; }
}
}

3 changes: 2 additions & 1 deletion src/core/Akka.MultiNodeTestRunner/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ private NodeTest GetTestDetails(ITestCaseDiscoveryMessage nodeTest)
Node = Convert.ToInt32(matches.Groups[2].Value),
TestName = matches.Groups[1].Value,
TypeName = nodeTest.TestClass.Class.Name,
MethodName = nodeTest.TestCase.TestMethod.Method.Name
MethodName = nodeTest.TestCase.TestMethod.Method.Name,
SkipReason = nodeTest.TestCase.SkipReason
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/core/Akka.MultiNodeTestRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ static void Main(string[] args)

foreach (var test in discovery.Tests.Reverse())
{
if (!string.IsNullOrEmpty(test.Value.First().SkipReason))
{
PublishRunnerMessage(string.Format("Skipping test {0}. Reason - {1}", test.Value.First().MethodName, test.Value.First().SkipReason));
continue;
}

PublishRunnerMessage(string.Format("Starting test {0}", test.Value.First().MethodName));

var processes = new List<Process>();
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.MultiNodeTests/MultiNodeFact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override string Skip
get
{
return ExecutedByMultiNodeRunner.Value
? null
? base.Skip
: "Must be executed by multi-node test runner";
}
set { base.Skip = value; }
Expand Down

0 comments on commit 75f966c

Please sign in to comment.