Skip to content

Commit

Permalink
Fix reporting code (#1884)
Browse files Browse the repository at this point in the history
* Add icons to CI report
  • Loading branch information
rogeralsing authored Dec 5, 2022
1 parent 425281c commit bb4e3b1
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions tests/Proto.Cluster.Tests/Tracing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,19 @@ public static async Task Trace(Func<Task> callBack, ITestOutputHelper testOutput
$"{TracingSettings.TraceViewUrl}/logs?traceId={traceId.ToUpperInvariant()}";

var duration = sw.Elapsed;
if (success)
{
var failIcon =
"<img src=\"https://gist.githubusercontent.com/rogeralsing/d8566b01e0850be70f7af9bc9757691e/raw/e025b5d58fe3aec1029a5c74f5ab2ee198960fcb/fail.svg\">";
var successIcon =
"<img src=\"https://gist.githubusercontent.com/rogeralsing/b9165f8eaeb25f05226745c94ab011b6/raw/cb28ccf1a11c44c8b4c9173bc4aeb98bfa79ca4b/success.svg\">";



var markdown = $@"
🟢 [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms <br/>
var markdown = $@"
{(success ? successIcon : failIcon)} [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms <br/>
{(success ? "" : $"Error:\n```\n{error}\n```")}
";
await File.AppendAllTextAsync(f, markdown);
}
else
{
var markdown = $@"
🔴 [Test: {callerName}]({traceViewUrl}) - Duration: {duration.TotalMilliseconds} ms <br/>
Error:
```
{error}
```
";
await File.AppendAllTextAsync(f, markdown);
}
await File.AppendAllTextAsync(f, markdown);

}
}
}
Expand Down

0 comments on commit bb4e3b1

Please sign in to comment.