Skip to content

Commit

Permalink
#417: Catastrophic failure when no tests pass the filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Sep 13, 2024
1 parent a5a6808 commit d72ef51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/xunit.runner.visualstudio/VsTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ await DiscoverTestsInAssembly(
}
}

// https://github.com/xunit/visualstudio.xunit/issues/417
if (testCaseSerializations.Count == 0)
{
if (configuration.InternalDiagnosticMessagesOrDefault)
logger.LogWarning("Skipping '{0}': no tests passed the filter", assemblyFileName);

return;
}

// Execute tests
var executionOptions = TestFrameworkOptions.ForExecution(configuration);
if (!configuration.ParallelizeTestCollectionsOrDefault)
Expand Down

0 comments on commit d72ef51

Please sign in to comment.