Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ public Task AfterEndpointsAllocatedAsync(DistributedApplicationModel appModel, C
}

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspire/issues/9340")]
public async Task TestServicesWithMultipleReplicas()
{
var replicaCount = 3;
Expand Down
1 change: 1 addition & 0 deletions tests/Aspire.Hosting.Yarp.Tests/YarpFunctionalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class YarpFunctionalTests(ITestOutputHelper testOutputHelper)
{
[Fact]
[RequiresDocker]
[QuarantinedTest("https://github.com/dotnet/aspire/issues/9344")]
public async Task VerifyYarpResource()
{
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Expand Down
37 changes: 21 additions & 16 deletions tools/GenerateTestSummary/TestSummaryGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,31 @@ public static void CreateSingleTestSummaryReport(string trxFilePath, StringBuild

""");

var errorMsgBuilder = new StringBuilder();
errorMsgBuilder.AppendLine(test.Output?.ErrorInfo?.InnerText ?? string.Empty);
reportBuilder.AppendLine();
reportBuilder.AppendLine("```yml");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yml? do you mean text maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to provide a nice coloring!


reportBuilder.AppendLine(test.Output?.ErrorInfo?.InnerText);
if (test.Output?.StdOut is not null)
{
errorMsgBuilder.AppendLine();
errorMsgBuilder.AppendLine("### StdOut");
errorMsgBuilder.AppendLine(test.Output.StdOut);
const int halfLength = 25_000;
var stdOutSpan = test.Output.StdOut.AsSpan();

reportBuilder.AppendLine();
reportBuilder.AppendLine("### StdOut");

var startSpan = stdOutSpan[..Math.Min(halfLength, stdOutSpan.Length)];
reportBuilder.AppendLine(startSpan.ToString());

if (stdOutSpan.Length > halfLength)
{
reportBuilder.AppendLine(CultureInfo.InvariantCulture, $"{Environment.NewLine}... (snip) ...{Environment.NewLine}");
var endSpan = stdOutSpan[^halfLength..];
// `endSpan` might not begin at the true beginning of the original line
reportBuilder.Append("... ");
reportBuilder.Append(endSpan);
}
}

// Truncate long error messages for readability
var errorMsgTruncated = TruncateTheStart(errorMsgBuilder.ToString(), 50_000);

reportBuilder.AppendLine();
reportBuilder.AppendLine("```yml");
reportBuilder.AppendLine(errorMsgTruncated);
reportBuilder.AppendLine("```");
reportBuilder.AppendLine();
reportBuilder.AppendLine("</div>");
Expand All @@ -181,9 +191,4 @@ public static string GetTestTitle(string trxFileName)

[GeneratedRegex(@"(?<testName>.*)_(?<tfm>net\d+\.0)_.*")]
private static partial Regex TestNameFromTrxFileNameRegex();

private static string? TruncateTheStart(string? s, int maxLength)
=> s is null || s.Length <= maxLength
? s
: "... (truncated) " + s[^maxLength..];
}