Skip to content

Commit

Permalink
Don't allow non-trx logger on non-Windows OS
Browse files Browse the repository at this point in the history
This failed consistently in CI and locally (WSL), so prevent users from having an unsupported combination.
  • Loading branch information
kzu committed Aug 7, 2024
1 parent 43f2da5 commit 7d7b16f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/dotnet-retest/RetestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,27 @@ public override async Task<int> ExecuteAsync(CommandContext context, RetestSetti
string? path = null;
var hastrx = false;
var hasconsole = false;
var haslogger = false;

new OptionSet
{
{ "l|logger=", v =>
{
hastrx = v.StartsWith("trx");
hasconsole = v.StartsWith("console");
haslogger = true;
}
},
{ "results-directory=", v => path = v },
}.Parse(args);

// In non-Windows OSes, the trx logger must be the only one if specified
if (haslogger && !hastrx && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
MarkupLine("[red]If a logger is specified, it can only be trx in non-Windows platforms.[/]");
return 1;
}

var trx = new TrxCommand.TrxSettings
{
Path = path,
Expand Down

0 comments on commit 7d7b16f

Please sign in to comment.