diff --git a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs index 7d4920db1f3..46ee19759bf 100644 --- a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs +++ b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs @@ -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; diff --git a/tests/Aspire.Hosting.Yarp.Tests/YarpFunctionalTests.cs b/tests/Aspire.Hosting.Yarp.Tests/YarpFunctionalTests.cs index aa19184fb9e..3c62e817843 100644 --- a/tests/Aspire.Hosting.Yarp.Tests/YarpFunctionalTests.cs +++ b/tests/Aspire.Hosting.Yarp.Tests/YarpFunctionalTests.cs @@ -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)); diff --git a/tools/GenerateTestSummary/TestSummaryGenerator.cs b/tools/GenerateTestSummary/TestSummaryGenerator.cs index 0e90db5f2a8..dfdb9219d9f 100644 --- a/tools/GenerateTestSummary/TestSummaryGenerator.cs +++ b/tools/GenerateTestSummary/TestSummaryGenerator.cs @@ -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"); + + 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(""); @@ -181,9 +191,4 @@ public static string GetTestTitle(string trxFileName) [GeneratedRegex(@"(?.*)_(?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..]; }