From 6a6895fb17c956b22e7b5ff6db6fc007b30d554f Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 8 Dec 2025 10:44:16 +1300 Subject: [PATCH] Clarify intent of PreFlightIgnoresTransaction test --- ...IgnoresTransaction.DotNet10_0.verified.txt | 14 ----------- ...tIgnoresTransaction.DotNet8_0.verified.txt | 24 ------------------- ...tIgnoresTransaction.DotNet9_0.verified.txt | 14 ----------- .../WebIntegrationTests.verify.cs | 7 +++--- 4 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet10_0.verified.txt delete mode 100644 test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet8_0.verified.txt delete mode 100644 test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet9_0.verified.txt diff --git a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet10_0.verified.txt b/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet10_0.verified.txt deleted file mode 100644 index 679694a306..0000000000 --- a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet10_0.verified.txt +++ /dev/null @@ -1,14 +0,0 @@ -{ - result: { - Status: 204 No Content, - Headers: { - Access-Control-Allow-Headers: origin, - Access-Control-Allow-Methods: GET, - Access-Control-Allow-Origin: * - }, - Content: { - Headers: {} - } - }, - Payloads: [] -} \ No newline at end of file diff --git a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet8_0.verified.txt b/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet8_0.verified.txt deleted file mode 100644 index f1a0c6f665..0000000000 --- a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet8_0.verified.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - result: { - Version: 1.1, - Status: 204 No Content, - Headers: { - Access-Control-Allow-Headers: origin, - Access-Control-Allow-Methods: GET, - Access-Control-Allow-Origin: * - }, - Content: { - Headers: {} - }, - Request: { - Method: OPTIONS, - Uri: http://localhost/Target, - Headers: { - Access-Control-Request-Headers: origin, - Access-Control-Request-Method: GET, - Origin: https://sentry.io/foo - } - } - }, - Payloads: [] -} \ No newline at end of file diff --git a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet9_0.verified.txt b/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet9_0.verified.txt deleted file mode 100644 index 679694a306..0000000000 --- a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.PreFlightIgnoresTransaction.DotNet9_0.verified.txt +++ /dev/null @@ -1,14 +0,0 @@ -{ - result: { - Status: 204 No Content, - Headers: { - Access-Control-Allow-Headers: origin, - Access-Control-Allow-Methods: GET, - Access-Control-Allow-Origin: * - }, - Content: { - Headers: {} - } - }, - Payloads: [] -} \ No newline at end of file diff --git a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.verify.cs b/test/Sentry.AspNetCore.Tests/WebIntegrationTests.verify.cs index 107848062d..7006292052 100644 --- a/test/Sentry.AspNetCore.Tests/WebIntegrationTests.verify.cs +++ b/test/Sentry.AspNetCore.Tests/WebIntegrationTests.verify.cs @@ -134,10 +134,9 @@ public async Task PreFlightIgnoresTransaction() // dispose will ultimately trigger the background worker to flush server.Dispose(); - await Verify(new { result, transport.Payloads }) - .IgnoreStandardSentryMembers() - .ScrubAspMembers() - .UniqueForTargetFrameworkAndVersion(); + // No transaction should be recorded for pre-flight/options requests + // See: https://github.com/getsentry/sentry-dotnet/issues/1835#issuecomment-1239546099 + transport.Payloads.Any().Should().BeFalse(); } [ApiController]