Skip to content

Commit

Permalink
Ensure both failed tests and errors cancel for stopOnFail
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Jul 5, 2023
1 parent 4e86b43 commit fd327b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Versions.props
Expand Up @@ -9,7 +9,7 @@
<NSubstituteVersion>5.0.0</NSubstituteVersion>
<TunnelVisionLabsReferenceAssemblyAnnotatorVersion>1.0.0-alpha.160</TunnelVisionLabsReferenceAssemblyAnnotatorVersion>
<XunitAnalyzersVersion>1.2.0-pre.48</XunitAnalyzersVersion>
<XunitVersion>2.5.0-pre.44</XunitVersion>
<XunitVersion>2.5.0-pre.45</XunitVersion>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/xunit.runner.visualstudio/VsTestRunner.cs
Expand Up @@ -578,7 +578,7 @@ static bool IsXunitPackageReferenced(string assemblyFileName)
resultsSink.Finished.WaitOne();

reporterMessageHandler.OnMessage(new TestAssemblyExecutionFinished(assembly, executionOptions, resultsSink.ExecutionSummary));
if (resultsSink.ExecutionSummary.Failed != 0 && executionOptions.GetStopOnTestFailOrDefault())
if ((resultsSink.ExecutionSummary.Failed != 0 || resultsSink.ExecutionSummary.Errors != 0) && executionOptions.GetStopOnTestFailOrDefault())
{
logger.Log("Canceling due to test failure...");
cancelled = true;
Expand Down

0 comments on commit fd327b6

Please sign in to comment.