Skip to content

Commit

Permalink
Check for non-test summary output too
Browse files Browse the repository at this point in the history
Otherwise, we detect as a non-run a scenario that actually does work (i.e. https://github.com/devlooped/dotnet-retest/actions/runs/10025060085/job/27707830143).
  • Loading branch information
kzu committed Jul 21, 2024
1 parent 709da32 commit dcd8ff3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dotnet-retest/RetestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public override async Task<int> ExecuteAsync(CommandContext context, RetestSetti
if (exit.ExitCode == 0)
return 0;

if (!HasTestExpr().IsMatch(exit.StandardOutput))
if (!HasTestExpr().IsMatch(exit.StandardOutput) &&
!HasTestSummaryExpr().IsMatch(exit.StandardOutput))
{
runFailure = exit;
return exit.ExitCode;
Expand Down Expand Up @@ -202,6 +203,9 @@ async Task<BufferedCommandResult> RunTestsAsync(string dotnet, List<string> args
[GeneratedRegex(":.*VSTEST.*:")]
private static partial Regex HasTestExpr();

[GeneratedRegex("Failed:.*Passed:.*Skipped:.*Total:.*")]
private static partial Regex HasTestSummaryExpr();

public class RetestSettings : CommandSettings
{
[Description("Maximum attempts to run tests")]
Expand Down

0 comments on commit dcd8ff3

Please sign in to comment.