Skip to content

Commit

Permalink
added debugging to flaky test (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Feb 24, 2020
1 parent 3073edd commit 7e6fe78
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/NBench.Tests.End2End/NBenchIntegrationTest.WithDependencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ public void LoadAssemblyCorrect()
{
var package = LoadPackageWithDependencies().AddOutput(_benchmarkOutput);
var result = TestRunner.Run(package);

result.AllTestsPassed.Should().BeTrue("Expected all tests to pass, but did not.");
result.ExecutedTestsCount.Should().NotBe(0);
result.IgnoredTestsCount.Should().Be(0);

try
{
result.AllTestsPassed.Should().BeTrue("Expected all tests to pass, but did not.");
result.ExecutedTestsCount.Should().NotBe(0);
result.IgnoredTestsCount.Should().Be(0);
}
catch
{
foreach (var test in result.FullResults)
{
_output.WriteLine($"DEBUG: Checking output for {test.BenchmarkName}");
foreach(var a in test.AssertionResults)
_output.WriteLine($"ASSERT: {a.MetricName} - Passed? {a.Passed}");
}
throw;
}
}

private static TestPackage LoadPackageWithDependencies(IEnumerable<string> include = null, IEnumerable<string> exclude = null)
Expand Down

0 comments on commit 7e6fe78

Please sign in to comment.