|
5 | 5 | using System.IO; |
6 | 6 | using System.Linq; |
7 | 7 | using System.Runtime.InteropServices; |
8 | | -using System.Text.RegularExpressions; |
9 | 8 | using System.Threading.Tasks; |
10 | 9 | using CliWrap; |
11 | 10 | using CliWrap.Buffered; |
|
15 | 14 | using Spectre.Console; |
16 | 15 | using Spectre.Console.Cli; |
17 | 16 | using Spectre.Console.Rendering; |
| 17 | +using static Devlooped.TrxCommand; |
18 | 18 | using static Spectre.Console.AnsiConsole; |
19 | 19 |
|
20 | 20 | namespace Devlooped; |
@@ -66,11 +66,11 @@ public override async Task<int> ExecuteAsync(CommandContext context, RetestSetti |
66 | 66 | return 1; |
67 | 67 | } |
68 | 68 |
|
69 | | - var trx = new TrxCommand.TrxSettings |
| 69 | + var trx = new TrxSettings |
70 | 70 | { |
71 | 71 | Path = path ?? Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")), |
72 | 72 | Output = settings.Output, |
73 | | - Skipped = settings.Skipped, |
| 73 | + Verbosity = settings.Verbosity, |
74 | 74 | GitHubComment = settings.GitHubComment, |
75 | 75 | GitHubSummary = settings.GitHubSummary, |
76 | 76 | }; |
@@ -303,13 +303,35 @@ public int Retries |
303 | 303 | [DefaultValue(false)] |
304 | 304 | public bool Output { get; init; } |
305 | 305 |
|
| 306 | + /// <summary> |
| 307 | + /// Output verbosity. |
| 308 | + /// </summary> |
| 309 | + [Description( |
| 310 | + """ |
| 311 | + Output display verbosity: |
| 312 | + - quiet: only failed tests are displayed |
| 313 | + - normal: failed and skipped tests are displayed |
| 314 | + - verbose: failed, skipped and passed tests are displayed |
| 315 | + """)] |
| 316 | + [CommandOption("-v|--verbosity")] |
| 317 | + [DefaultValue(Verbosity.Quiet)] |
| 318 | + public Verbosity Verbosity { get; set; } = Verbosity.Quiet; |
| 319 | + |
306 | 320 | /// <summary> |
307 | 321 | /// Whether to include skipped tests in the output. |
308 | 322 | /// </summary> |
309 | 323 | [Description("Include skipped tests in report")] |
310 | | - [CommandOption("--skipped")] |
| 324 | + [CommandOption("--skipped", IsHidden = true)] |
311 | 325 | [DefaultValue(true)] |
312 | | - public bool Skipped { get; init; } = true; |
| 326 | + public bool Skipped |
| 327 | + { |
| 328 | + get => Verbosity != Verbosity.Quiet; |
| 329 | + set |
| 330 | + { |
| 331 | + if (!value) |
| 332 | + Verbosity = Verbosity.Quiet; |
| 333 | + } |
| 334 | + } |
313 | 335 |
|
314 | 336 | /// <summary> |
315 | 337 | /// Report as GitHub PR comment. |
|
0 commit comments