From 3123db088b8f3084088ef504991eb84417c04805 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 4 Jan 2026 22:16:27 -0600 Subject: [PATCH] chore: debug tests failing in CI --- .../Logging/GlobalExceptionHandler.cs | 2 +- .../Integration/PaymentTests.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GroundsForSupport.Server/Logging/GlobalExceptionHandler.cs b/src/GroundsForSupport.Server/Logging/GlobalExceptionHandler.cs index 5a4fc0c..9315759 100644 --- a/src/GroundsForSupport.Server/Logging/GlobalExceptionHandler.cs +++ b/src/GroundsForSupport.Server/Logging/GlobalExceptionHandler.cs @@ -19,7 +19,7 @@ internal sealed class GlobalExceptionHandler(ILogger log { Status = StatusCodes.Status500InternalServerError, Title = "Server Error", - Detail = "An internal error occurred." + Detail = exception.Message, }; httpContext.Response.StatusCode = problemDetails.Status.Value; diff --git a/tests/GroundsForSupport.Server.Tests/Integration/PaymentTests.cs b/tests/GroundsForSupport.Server.Tests/Integration/PaymentTests.cs index a8dc1be..9889f4c 100644 --- a/tests/GroundsForSupport.Server.Tests/Integration/PaymentTests.cs +++ b/tests/GroundsForSupport.Server.Tests/Integration/PaymentTests.cs @@ -3,6 +3,8 @@ using System.Net.Http.Json; using GroundsForSupport.API.Tests.Integration.Infra; +[assembly: CaptureConsole] + namespace GroundsForSupport.API.Tests.Integration; public sealed class PaymentTests(TestApi api) : IClassFixture @@ -22,6 +24,8 @@ public sealed class PaymentTests(TestApi api) : IClassFixture var response = await client.PostAsJsonAsync("/payments/create-intent", request, TestContext.Current.CancellationToken); + Console.WriteLine(await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken)); + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); } @@ -38,6 +42,8 @@ public sealed class PaymentTests(TestApi api) : IClassFixture var response = await client.PostAsJsonAsync("/payments/create-intent", request, TestContext.Current.CancellationToken); + Console.WriteLine(await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken)); + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); } @@ -55,6 +61,8 @@ public sealed class PaymentTests(TestApi api) : IClassFixture var response = await client.PostAsJsonAsync("/payments/create-intent", request, TestContext.Current.CancellationToken); + Console.WriteLine(await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken)); + response.StatusCode.Should().Be(HttpStatusCode.OK); } } \ No newline at end of file