Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Fixed #12
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedennis committed Sep 9, 2016
1 parent 02df6f3 commit 4264381
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions NUnitOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ await this.ExecuteCommandLineAsync(
var testResultsElement = xdoc.Element("test-results");

var startTime = this.TryParseStartTime((string)testResultsElement.Attribute("date"), (string)testResultsElement.Attribute("time")) ?? DateTime.UtcNow;
var failures = 0;

using (var db = new DB.Context())
{
Expand All @@ -130,6 +131,8 @@ await this.ExecuteCommandLineAsync(
.Case("Inconclusive", Domains.TestStatusCodes.Inconclusive)
.Default(Domains.TestStatusCodes.Failed)
.End();
if (result == Domains.TestStatusCodes.Failed)
failures++;

var testDuration = this.TryParseTestTime((string)testCaseElement.Attribute("time"));

Expand All @@ -148,6 +151,9 @@ await this.ExecuteCommandLineAsync(
startTime += testDuration;
}
}

if (failures > 0)
this.LogError($"{0} test failures were reported.");
}
finally
{
Expand Down

0 comments on commit 4264381

Please sign in to comment.