Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/dotnet-trx/TrxCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ public override int Execute(CommandContext context, TrxSettings settings)
{
// Send workflow commands for each failure to be annotated in GH CI
// TODO: somehow the notice does not end up pointing to the right file/line
// TODO: we should do newline replacement with "%0A" here too
//foreach (var failure in failures)
// WriteLine($"::error file={failure.File},line={failure.Line},title={failure.Title}::{failure.Message}");
}
Expand Down Expand Up @@ -460,6 +461,9 @@ void WriteError(string baseDir, List<Failed> failures, XElement result, StringBu
else
details.AppendLine("csharp");

// First line should be the actual error message.
details.AppendLineIndented(message.ReplaceLineEndings(), "> ");

foreach (var line in lines.Select(x => x.EscapeMarkup()))
{
var match = ParseFile().Match(line);
Expand All @@ -479,8 +483,8 @@ void WriteError(string baseDir, List<Failed> failures, XElement result, StringBu
// NOTE: we replace whichever was last, since we want the annotation on the
// last one with a filename, which will be the test itself (see previous skip from last found).
failed = new Failed(testName,
message.ReplaceLineEndings().Replace(Environment.NewLine, "%0A"),
stackTrace.ReplaceLineEndings().Replace(Environment.NewLine, "%0A"),
message.ReplaceLineEndings(),
stackTrace.ReplaceLineEndings(),
relative, int.Parse(pos));

cli.AppendLine(line.Replace(file, $"[link={file}][steelblue1_1]{relative}[/][/]"));
Expand Down
Loading