From bb4e3b19d2c8b691939d581837c64107fdbb2ef6 Mon Sep 17 00:00:00 2001 From: Roger Johansson Date: Mon, 5 Dec 2022 10:15:11 +0100 Subject: [PATCH] Fix reporting code (#1884) * Add icons to CI report --- tests/Proto.Cluster.Tests/Tracing.cs | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/tests/Proto.Cluster.Tests/Tracing.cs b/tests/Proto.Cluster.Tests/Tracing.cs index 66469f3046..feab5a6d26 100644 --- a/tests/Proto.Cluster.Tests/Tracing.cs +++ b/tests/Proto.Cluster.Tests/Tracing.cs @@ -83,27 +83,19 @@ public static async Task Trace(Func callBack, ITestOutputHelper testOutput $"{TracingSettings.TraceViewUrl}/logs?traceId={traceId.ToUpperInvariant()}"; var duration = sw.Elapsed; - if (success) - { + var failIcon = + ""; + var successIcon = + ""; + - var markdown = $@" -🟢 [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms
+ var markdown = $@" +{(success ? successIcon : failIcon)} [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms
+{(success ? "" : $"Error:\n```\n{error}\n```")} "; - await File.AppendAllTextAsync(f, markdown); - } - else - { - var markdown = $@" -🔴 [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms
- -Error: -``` -{error} -``` -"; - await File.AppendAllTextAsync(f, markdown); - } + await File.AppendAllTextAsync(f, markdown); + } } }