From d2c435815082ccc4b578479a73d8697f3eb68166 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 19 Nov 2025 15:24:14 +1300 Subject: [PATCH 01/35] .net10 tests for Android --- .github/workflows/device-tests-android.yml | 13 ++++++------- Sentry.sln | 1 + integration-test/android.Tests.ps1 | 19 +++++++++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/device-tests-android.yml b/.github/workflows/device-tests-android.yml index 5e079053a3..2f3162f99d 100644 --- a/.github/workflows/device-tests-android.yml +++ b/.github/workflows/device-tests-android.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - tfm: [net9.0] + tfm: [net9.0, net10.0] env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: 1 @@ -40,13 +40,12 @@ jobs: - name: Build Android Test App run: pwsh ./scripts/device-test.ps1 android -Build -Tfm ${{ matrix.tfm }} - - name: Upload Android Test App (net9.0) - if: matrix.tfm == 'net9.0' + - name: Upload Android Test App (${{ matrix.tfm }}) uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: - name: device-test-android-net9.0 + name: device-test-android-${{ matrix.tfm }} if-no-files-found: error - path: test/Sentry.Maui.Device.TestApp/bin/Release/net9.0-android/android-x64/io.sentry.dotnet.maui.device.testapp-Signed.apk + path: test/Sentry.Maui.Device.TestApp/bin/Release/${{ matrix.tfm }}-android/android-x64/io.sentry.dotnet.maui.device.testapp-Signed.apk android: needs: [build] @@ -58,7 +57,7 @@ jobs: strategy: fail-fast: false matrix: - tfm: [net9.0] + tfm: [net9.0, net10.0] # Must be 34+ for new apps and app updates as of August 31, 2024. # See https://apilevels.com/ api-level: [34, 36] @@ -147,7 +146,7 @@ jobs: disk-size: ${{ env.ANDROID_EMULATOR_DISK_SIZE }} emulator-options: ${{ env.ANDROID_EMULATOR_OPTIONS }} disable-animations: false - script: pwsh integration-test/android.Tests.ps1 + script: pwsh integration-test/android.Tests.ps1 -dotnet_version ${{ matrix.tfm }} - name: Retry Integration Tests (if previous failed to run) if: steps.first-integration-test-run.outcome == 'failure' diff --git a/Sentry.sln b/Sentry.sln index cf1c80a04f..6934a3c845 100644 --- a/Sentry.sln +++ b/Sentry.sln @@ -271,6 +271,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration-test", "integra integration-test\pester.ps1 = integration-test\pester.ps1 integration-test\ios.Tests.ps1 = integration-test\ios.Tests.ps1 integration-test\msbuild.Tests.ps1 = integration-test\msbuild.Tests.ps1 + integration-test\android.Tests.ps1 = integration-test\android.Tests.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net4-console", "net4-console", "{33793113-C7B5-434D-B5C1-6CA1A9587842}" diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index f7910a5af3..ef463b9362 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -1,3 +1,7 @@ +param( + [string] $dotnet_version = "net9.0" +) + # This file contains test cases for https://pester.dev/ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -12,11 +16,18 @@ BeforeDiscovery { $script:emulator = Get-AndroidEmulatorId } -Describe 'MAUI app (, )' -ForEach @( - @{ tfm = "net9.0-android35.0"; configuration = "Release" } - @{ tfm = "net9.0-android35.0"; configuration = "Debug" } -) -Skip:(-not $script:emulator) { +$cases = @( + @{ Configuration = 'Release' } + @{ Configuration = 'Debug' } +) +Describe 'MAUI app (, )' -ForEach $cases -Skip:(-not $script:emulator) { BeforeAll { + if ($dotnet_version -eq 'net9.0') { + $tfm = 'net9.0-android35.0' + } else { + $tfm = 'net10.0-android36.0' + } + Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue Copy-Item -Path "$PSScriptRoot/net9-maui" -Destination "$PSScriptRoot/mobile-app" -Recurse -Force Push-Location $PSScriptRoot/mobile-app From 5e9fdcb38c8f9e5605fc1f4d05b0d274e34ee6b5 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 20 Nov 2025 12:37:14 +1300 Subject: [PATCH 02/35] . --- .../Sentry.Maui.Device.TestApp.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index b04676ed72..0187f7878c 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -1,8 +1,8 @@  - $(TargetFrameworks);net9.0-android - $(TargetFrameworks);net9.0-ios + $(TargetFrameworks);net9.0-android;net10.0-android + $(TargetFrameworks);net9.0-ios;net10.0-ios $(DefineConstants);VISUAL_RUNNER From f99a7119085e16930165e8f8862f28ab4a50a6c6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 20 Nov 2025 14:58:23 +1300 Subject: [PATCH 03/35] . --- .../Sentry.Maui.Device.TestApp.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index 0187f7878c..1a24ba8bab 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -73,7 +73,9 @@ + + From 5b7fbc3382c26af9c7618c7227cf02dfe5e8e233 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 20 Nov 2025 16:30:28 +1300 Subject: [PATCH 04/35] . --- integration-test/android.Tests.ps1 | 2 +- .../net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index ef463b9362..dcc2d7292a 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -1,5 +1,5 @@ param( - [string] $dotnet_version = "net9.0" + [string] $dotnet_version = "net10.0" ) # This file contains test cases for https://pester.dev/ diff --git a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj index ed6ab044f6..c998217f68 100644 --- a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj +++ b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj @@ -1,7 +1,7 @@ - $(TargetFrameworks);net9.0-android35.0 + $(TargetFrameworks);net9.0-android35.0;net10.0-android36.0 $(TargetFrameworks);net9.0-ios18.0 Exe From d40c0304c940d30b3054dc9cea21c640bf551950 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 26 Nov 2025 13:07:51 +1300 Subject: [PATCH 05/35] Testing a theory... --- integration-test/net9-maui/MauiProgram.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/integration-test/net9-maui/MauiProgram.cs b/integration-test/net9-maui/MauiProgram.cs index e1c619cdb5..92aa8cfc5a 100644 --- a/integration-test/net9-maui/MauiProgram.cs +++ b/integration-test/net9-maui/MauiProgram.cs @@ -21,11 +21,16 @@ public static MauiApp CreateMauiApp() options.SendClientReports = false; options.AutoSessionTracking = false; - options.SetBeforeBreadcrumb((breadcrumb, hint) => + // Only check breadcrumbs for non-crash tests... + var testArg = System.Environment.GetEnvironmentVariable("SENTRY_TEST_ARG"); + if (!Enum.TryParse(testArg, ignoreCase: true, out var crashType)) { - App.ReceiveSystemBreadcrumb(breadcrumb); - return breadcrumb; - }); + options.SetBeforeBreadcrumb((breadcrumb, hint) => + { + App.ReceiveSystemBreadcrumb(breadcrumb); + return breadcrumb; + }); + } }) .ConfigureFonts(fonts => { From 344c80a0323712fbd4df9cc124967ee235180e2a Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 27 Nov 2025 14:03:58 +1300 Subject: [PATCH 06/35] Try to prevent double crash --- integration-test/net9-maui/App.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index c187a5ad66..ce3f1ae083 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -70,6 +70,7 @@ public static void OnAppearing() { SentrySdk.CauseCrash(crashType); } + else #pragma warning restore CS0618 if (HasTestArg("NullReferenceException")) From b8d6c02c31359c710b6bfc004e360b42756d7b20 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 27 Nov 2025 14:06:03 +1300 Subject: [PATCH 07/35] Revert "Try to prevent double crash" This reverts commit 344c80a0323712fbd4df9cc124967ee235180e2a. --- integration-test/net9-maui/App.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index ce3f1ae083..c187a5ad66 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -70,7 +70,6 @@ public static void OnAppearing() { SentrySdk.CauseCrash(crashType); } - else #pragma warning restore CS0618 if (HasTestArg("NullReferenceException")) From 241a908d925baca7b1a9c6906b1dd3c2051e4d42 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 27 Nov 2025 14:40:01 +1300 Subject: [PATCH 08/35] Ensure JavaSDK is shutdown when closing the Hub --- src/Sentry/Internal/Hub.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry/Internal/Hub.cs b/src/Sentry/Internal/Hub.cs index f44a288b33..6b57ff50aa 100644 --- a/src/Sentry/Internal/Hub.cs +++ b/src/Sentry/Internal/Hub.cs @@ -871,7 +871,7 @@ public void Dispose() #if __IOS__ // TODO #elif ANDROID - // TODO + JavaSdk.Sentry.Close(); #elif NET8_0_OR_GREATER if (SentryNative.IsAvailable) { From 278c04c7de03431ca5ff076bee4fe9ccd33042bf Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 27 Nov 2025 16:34:18 +1300 Subject: [PATCH 09/35] Remove todo from previously failing test --- integration-test/android.Tests.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index dcc2d7292a..fc691b333d 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -180,13 +180,8 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" - # TODO: fix redundant SIGSEGV in Release (#3954) - if ($configuration -eq "Release") { - { $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw - } else { - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" - $result.Envelopes() | Should -HaveCount 1 - } + $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" + $result.Envelopes() | Should -HaveCount 1 } It 'Delivers battery breadcrumbs in main thread ()' { From ad9c67196382f441a803aad10ac4bec66b001c7a Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 28 Nov 2025 12:58:16 +1300 Subject: [PATCH 10/35] Try System.Environment.Exit(0) instead of process.kill --- integration-test/net9-maui/App.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index c187a5ad66..3009ce1a0c 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -72,7 +72,7 @@ public static void OnAppearing() } #pragma warning restore CS0618 - if (HasTestArg("NullReferenceException")) + else if (HasTestArg("NullReferenceException")) { try { @@ -104,7 +104,7 @@ public static void Kill() #if ANDROID // prevent auto-restart Platform.CurrentActivity?.FinishAffinity(); - Process.KillProcess(Process.MyPid()); + System.Environment.Exit(0); #elif IOS System.Environment.Exit(0); #endif From 429801b1668b7ae3b500c496d4be24b57ff82f1e Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 28 Nov 2025 15:21:27 +1300 Subject: [PATCH 11/35] roll back unrelated change --- integration-test/net9-maui/MauiProgram.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/integration-test/net9-maui/MauiProgram.cs b/integration-test/net9-maui/MauiProgram.cs index 92aa8cfc5a..5fe652d372 100644 --- a/integration-test/net9-maui/MauiProgram.cs +++ b/integration-test/net9-maui/MauiProgram.cs @@ -21,17 +21,11 @@ public static MauiApp CreateMauiApp() options.SendClientReports = false; options.AutoSessionTracking = false; - // Only check breadcrumbs for non-crash tests... - var testArg = System.Environment.GetEnvironmentVariable("SENTRY_TEST_ARG"); - if (!Enum.TryParse(testArg, ignoreCase: true, out var crashType)) + options.SetBeforeBreadcrumb((breadcrumb, hint) => { - options.SetBeforeBreadcrumb((breadcrumb, hint) => - { - App.ReceiveSystemBreadcrumb(breadcrumb); - return breadcrumb; - }); - } - }) + App.ReceiveSystemBreadcrumb(breadcrumb); + return breadcrumb; + }); }) .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); From cf16076a992a10ffa591e511b5107b452bd360b0 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 28 Nov 2025 15:22:04 +1300 Subject: [PATCH 12/35] reinstate null reference workaround for net9 tfm --- integration-test/android.Tests.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index fc691b333d..b969f55027 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -180,8 +180,13 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" - $result.Envelopes() | Should -HaveCount 1 + # TODO: fix redundant SIGSEGV in Release (#3954) + if ($configuration -eq "Release" -and $dotnet_version -eq 'net9.0') { + { $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw + } else { + $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" + $result.Envelopes() | Should -HaveCount 1 + } } It 'Delivers battery breadcrumbs in main thread ()' { From 08897351f59e36ac3dc0dc0e358c017d8823a557 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 28 Nov 2025 15:44:40 +1300 Subject: [PATCH 13/35] Revert change from kill to System.Environment.Exit --- integration-test/net9-maui/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index 3009ce1a0c..de8bcf17d5 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -104,7 +104,7 @@ public static void Kill() #if ANDROID // prevent auto-restart Platform.CurrentActivity?.FinishAffinity(); - System.Environment.Exit(0); + Process.KillProcess(Process.MyPid()); #elif IOS System.Environment.Exit(0); #endif From c1b3e7c1583562449bcb03a26b499aa1dacd6093 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 28 Nov 2025 15:49:15 +1300 Subject: [PATCH 14/35] Skip the Native Crash integration test on net10 --- integration-test/android.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index b969f55027..d24ec1acaa 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -156,7 +156,8 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- $result.Envelopes() | Should -HaveCount 1 } - It 'Native crash ()' { + # Skipping on .NET 10.0 for the time being - see https://github.com/getsentry/sentry-dotnet/pull/4750#issuecomment-3583814252 + It 'Native crash ()' -Skip:($dotnet_version -eq 'net10.0') { $result = Invoke-SentryServer { param([string]$url) RunAndroidApp -Dsn $url -TestArg "Native" From 0adaddb7ad91d0b41a2c38aacc64727ce54b2a3b Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 1 Dec 2025 11:46:30 +1300 Subject: [PATCH 15/35] . --- integration-test/android.Tests.ps1 | 9 ++------- integration-test/net9-maui/MauiProgram.cs | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index d24ec1acaa..1d941aa7a7 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -181,13 +181,8 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" - # TODO: fix redundant SIGSEGV in Release (#3954) - if ($configuration -eq "Release" -and $dotnet_version -eq 'net9.0') { - { $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw - } else { - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" - $result.Envelopes() | Should -HaveCount 1 - } + $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" + $result.Envelopes() | Should -HaveCount 1 } It 'Delivers battery breadcrumbs in main thread ()' { diff --git a/integration-test/net9-maui/MauiProgram.cs b/integration-test/net9-maui/MauiProgram.cs index 5fe652d372..e1c619cdb5 100644 --- a/integration-test/net9-maui/MauiProgram.cs +++ b/integration-test/net9-maui/MauiProgram.cs @@ -25,7 +25,8 @@ public static MauiApp CreateMauiApp() { App.ReceiveSystemBreadcrumb(breadcrumb); return breadcrumb; - }); }) + }); + }) .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); From 1361614ebbf035bd083a5896c197ed568d28c208 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 1 Dec 2025 14:44:24 +1300 Subject: [PATCH 16/35] Revert fix to close Java SDK until we can work out why it breaks unit tests --- src/Sentry/Internal/Hub.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Sentry/Internal/Hub.cs b/src/Sentry/Internal/Hub.cs index 6b57ff50aa..c378c3dc2d 100644 --- a/src/Sentry/Internal/Hub.cs +++ b/src/Sentry/Internal/Hub.cs @@ -871,7 +871,9 @@ public void Dispose() #if __IOS__ // TODO #elif ANDROID - JavaSdk.Sentry.Close(); + // TODO: For some reason the integration tests on Android fail if we Close on the Java SDK... + // https://github.com/getsentry/sentry-dotnet/blob/0adaddb7ad91d0b41a2c38aacc64727ce54b2a3b/integration-test/android.Tests.ps1#L154 + // JavaSdk.Sentry.Close(); #elif NET8_0_OR_GREATER if (SentryNative.IsAvailable) { From ed8b558969e7cb0a31bcd8fce0bea2b95a146d37 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 1 Dec 2025 20:53:25 +1300 Subject: [PATCH 17/35] . --- integration-test/net9-maui/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index de8bcf17d5..c187a5ad66 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -72,7 +72,7 @@ public static void OnAppearing() } #pragma warning restore CS0618 - else if (HasTestArg("NullReferenceException")) + if (HasTestArg("NullReferenceException")) { try { From 5fdc83223874dc6e14038dc4b4b78f9731fd55e0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 Jan 2026 10:08:37 +0100 Subject: [PATCH 18/35] Revert NRE test changes (#3954 was not fixed, yet) --- integration-test/android.Tests.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index 1d941aa7a7..f26ef49253 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -181,8 +181,13 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" - $result.Envelopes() | Should -HaveCount 1 + # TODO: fix redundant SIGSEGV in Release (#3954) + if ($configuration -eq "Release") { + { $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw + } else { + $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" + $result.Envelopes() | Should -HaveCount 1 + } } It 'Delivers battery breadcrumbs in main thread ()' { From 5d27b341a8cba217ed5c67c8137c4f9997600f44 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 Jan 2026 10:06:12 +0100 Subject: [PATCH 19/35] Use InvokeSentryResult::Events() See https://github.com/getsentry/github-workflows/pull/137 --- .github/workflows/device-tests-android.yml | 2 +- integration-test/android.Tests.ps1 | 34 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/device-tests-android.yml b/.github/workflows/device-tests-android.yml index 39361ed619..7dad49b435 100644 --- a/.github/workflows/device-tests-android.yml +++ b/.github/workflows/device-tests-android.yml @@ -129,7 +129,7 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: repository: getsentry/github-workflows - ref: a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1 + ref: 95603f4efe938315ff0dd427a1f2bb40b1889a92 # 3.2.0 path: modules/github-workflows - name: Run Integration Tests diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index f26ef49253..49658c0590 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -137,9 +137,9 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`"" - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`"" + $result.Events() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`"" + $result.Events() | Should -HaveCount 1 } It 'Java crash ()' { @@ -151,9 +151,9 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"RuntimeException`"" - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -AnyElementMatch "`"type`":`"RuntimeException`"" + $result.Events() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`"" + $result.Events() | Should -HaveCount 1 } # Skipping on .NET 10.0 for the time being - see https://github.com/getsentry/sentry-dotnet/pull/4750#issuecomment-3583814252 @@ -166,9 +166,9 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"SIG[A-Z]+`"" # SIGILL (x86_64), SIGTRAP (arm64-v8a) - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -AnyElementMatch "`"type`":`"SIG[A-Z]+`"" # SIGILL (x86_64), SIGTRAP (arm64-v8a) + $result.Events() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`"" + $result.Events() | Should -HaveCount 1 } It 'Null reference exception ()' { @@ -180,13 +180,13 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" + $result.Events() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`"" # TODO: fix redundant SIGSEGV in Release (#3954) if ($configuration -eq "Release") { - { $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw + { $result.Events() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw } else { - $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" + $result.Events() | Should -HaveCount 1 } } @@ -198,8 +198,8 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"system`",`"thread_id`":`"1`",`"category`":`"device.event`",`"action`":`"BATTERY_CHANGED`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -AnyElementMatch "`"type`":`"system`",`"thread_id`":`"1`",`"category`":`"device.event`",`"action`":`"BATTERY_CHANGED`"" + $result.Events() | Should -HaveCount 1 } It 'Delivers network breadcrumbs in main thread ()' { @@ -210,7 +210,7 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- Dump-ServerErrors -Result $result $result.HasErrors() | Should -BeFalse - $result.Envelopes() | Should -AnyElementMatch "`"type`":`"system`",`"thread_id`":`"1`",`"category`":`"network.event`",`"action`":`"NETWORK_CAPABILITIES_CHANGED`"" - $result.Envelopes() | Should -HaveCount 1 + $result.Events() | Should -AnyElementMatch "`"type`":`"system`",`"thread_id`":`"1`",`"category`":`"network.event`",`"action`":`"NETWORK_CAPABILITIES_CHANGED`"" + $result.Events() | Should -HaveCount 1 } } From cce63e985286c976eda0dc5128288a36853b7f58 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 Jan 2026 10:12:20 +0100 Subject: [PATCH 20/35] Unskip native crash test for net10.0 --- integration-test/android.Tests.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index 49658c0590..88386da86e 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -156,8 +156,7 @@ Describe 'MAUI app (, )' -ForEach $cases -Skip:(- $result.Events() | Should -HaveCount 1 } - # Skipping on .NET 10.0 for the time being - see https://github.com/getsentry/sentry-dotnet/pull/4750#issuecomment-3583814252 - It 'Native crash ()' -Skip:($dotnet_version -eq 'net10.0') { + It 'Native crash ()' { $result = Invoke-SentryServer { param([string]$url) RunAndroidApp -Dsn $url -TestArg "Native" From 3f5f2272222c248bb2a962337e8972d3561ceb91 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 20 Jan 2026 10:12:28 +1300 Subject: [PATCH 21/35] Update target frameworks for iOS in project file Testing whether this is related to line 34 or not... --- .../net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj index c998217f68..e649376b47 100644 --- a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj +++ b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj @@ -2,7 +2,7 @@ $(TargetFrameworks);net9.0-android35.0;net10.0-android36.0 - $(TargetFrameworks);net9.0-ios18.0 + $(TargetFrameworks);net9.0-ios;net10.0-ios Exe Sentry.Maui.Device.IntegrationTestApp From 2f798fdfdc43362849a3540754b1a7d7da0af979 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 20 Jan 2026 11:44:48 +1300 Subject: [PATCH 22/35] Make target platform version conditional for ios --- .../Sentry.Maui.Device.IntegrationTestApp.csproj | 10 +++++++++- .../Sentry.Maui.Device.TestApp.csproj | 9 +++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj index e649376b47..ad25aeef5e 100644 --- a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj +++ b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj @@ -31,7 +31,15 @@ 15.0 21.0 - 18.0 + + + 18.0 + 26.0 + diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index 1a24ba8bab..40827122eb 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -32,9 +32,14 @@ 13.0 21.0 + - 18.0 + 'netX.0-ios' resolves the latest version of the iOS SDK otherwise. + Note that this could be done by setting the TargetFramework to net9.0-ios18 or net10.0-ios26... either do one or + the other, but not both. I've done it this way to avoid changing scripts that assume the abbreviated TFM. + --> + 18.0 + 26.0 true From 00c676753ae51fc6a210a74dcc5fb955684e8492 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 20 Jan 2026 15:03:42 +1300 Subject: [PATCH 23/35] . --- .../Sentry.Maui.Device.IntegrationTestApp.csproj | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj index ad25aeef5e..182fe2735c 100644 --- a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj +++ b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj @@ -2,7 +2,10 @@ $(TargetFrameworks);net9.0-android35.0;net10.0-android36.0 - $(TargetFrameworks);net9.0-ios;net10.0-ios + + $(TargetFrameworks);net9.0-ios18.0;net10.0-ios26.0 Exe Sentry.Maui.Device.IntegrationTestApp @@ -32,14 +35,6 @@ 15.0 21.0 - - 18.0 - 26.0 - From 461ff9b31e34b72a10cd9a56342564a0b5bae795 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 23 Jan 2026 15:08:47 +1300 Subject: [PATCH 24/35] Review feedback --- integration-test/android.Tests.ps1 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index 88386da86e..11208485b9 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -6,6 +6,7 @@ param( Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' . $PSScriptRoot/pester.ps1 +. $PSScriptRoot/common.ps1 . $PSScriptRoot/../scripts/device-test-utils.ps1 BeforeDiscovery { @@ -17,16 +18,12 @@ BeforeDiscovery { } $cases = @( - @{ Configuration = 'Release' } - @{ Configuration = 'Debug' } + @{ configuration = 'Release' } + @{ configuration = 'Debug' } ) Describe 'MAUI app (, )' -ForEach $cases -Skip:(-not $script:emulator) { BeforeAll { - if ($dotnet_version -eq 'net9.0') { - $tfm = 'net9.0-android35.0' - } else { - $tfm = 'net10.0-android36.0' - } + $tfm = "$dotnet_version-android$(GetAndroidTpv $dotnet_version)" Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue Copy-Item -Path "$PSScriptRoot/net9-maui" -Destination "$PSScriptRoot/mobile-app" -Recurse -Force From 130e51a7f7e297100ce310a80272ba71ad99c86f Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 4 Feb 2026 10:05:27 +1300 Subject: [PATCH 25/35] Unpin the target platform version for ios in the device test app --- .../Sentry.Maui.Device.TestApp.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index 40827122eb..d25132c9ea 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -33,14 +33,6 @@ 13.0 21.0 - - 18.0 - 26.0 - true - $(TargetFrameworks);net9.0-ios18.0;net10.0-ios26.0 + $(TargetFrameworks);net10.0-ios26.2 Exe Sentry.Maui.Device.IntegrationTestApp diff --git a/scripts/device-test-utils.ps1 b/scripts/device-test-utils.ps1 index c3f8b771b2..455e85e4e8 100644 --- a/scripts/device-test-utils.ps1 +++ b/scripts/device-test-utils.ps1 @@ -29,11 +29,11 @@ function Get-AndroidEmulatorId function Get-IosSimulatorUdid { [CmdletBinding()] param( - [string]$IosVersion = '18.5', + [string]$IosVersion = '26.0', [string[]]$PreferredDeviceTypes = @( 'com.apple.CoreSimulator.SimDeviceType.iPhone-XS', - 'com.apple.CoreSimulator.SimDeviceType.iPhone-16', - 'com.apple.CoreSimulator.SimDeviceType.iPhone-15' + 'com.apple.CoreSimulator.SimDeviceType.iPhone-17', + 'com.apple.CoreSimulator.SimDeviceType.iPhone-16' ), [string[]]$PreferredStates = @('Shutdown','Booted') ) diff --git a/scripts/device-test.ps1 b/scripts/device-test.ps1 index b42a1ecc06..dc896e2280 100644 --- a/scripts/device-test.ps1 +++ b/scripts/device-test.ps1 @@ -26,7 +26,7 @@ try { if (!$Tfm) { - $Tfm = 'net9.0' + $Tfm = 'net10.0' } $arch = (!$IsWindows -and $(uname -m) -eq 'arm64') ? 'arm64' : 'x64' if ($Platform -eq 'android') diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index d25132c9ea..31b2fe8048 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -2,7 +2,11 @@ $(TargetFrameworks);net9.0-android;net10.0-android - $(TargetFrameworks);net9.0-ios;net10.0-ios + + $(TargetFrameworks);net10.0-ios $(DefineConstants);VISUAL_RUNNER From edcc79241d0e6a619e68613cfe788cf85e60443b Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 14:05:32 +1300 Subject: [PATCH 28/35] Remove side effects from common.ps1 --- integration-test/android.Tests.ps1 | 5 +++++ integration-test/cli.Tests.ps1 | 3 +++ integration-test/common.ps1 | 10 +++++++--- integration-test/runtime.Tests.ps1 | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index 11208485b9..11697cda72 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -23,6 +23,11 @@ $cases = @( ) Describe 'MAUI app (, )' -ForEach $cases -Skip:(-not $script:emulator) { BeforeAll { + if (-not (Test-Path Env:CI)) + { + ResetLocalPackages + } + $tfm = "$dotnet_version-android$(GetAndroidTpv $dotnet_version)" Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue diff --git a/integration-test/cli.Tests.ps1 b/integration-test/cli.Tests.ps1 index 1217bb7376..4c016a54d9 100644 --- a/integration-test/cli.Tests.ps1 +++ b/integration-test/cli.Tests.ps1 @@ -7,6 +7,9 @@ Describe 'Console apps () - normal build' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { + if (-not (Test-Path Env:CI)) { + ResetLocalPackages + } DotnetNew 'console' 'console-app' $framework } diff --git a/integration-test/common.ps1 b/integration-test/common.ps1 index 146bbabfee..4f7a72236a 100644 --- a/integration-test/common.ps1 +++ b/integration-test/common.ps1 @@ -108,9 +108,13 @@ BeforeAll { Remove-Item -Path ~/.nuget/packages/$($name.ToLower())/$packageVersion -Recurse -Force -ErrorAction SilentlyContinue } - Remove-Item -Path "$PSScriptRoot/packages" -Recurse -Force -ErrorAction SilentlyContinue - New-Item -ItemType Directory -Path "$PSScriptRoot/packages" | Out-Null - RegisterLocalPackage 'Sentry' + function ResetLocalPackages() + { + Remove-Item -Path "$PSScriptRoot/packages" -Recurse -Force -ErrorAction SilentlyContinue + New-Item -ItemType Directory -Path "$PSScriptRoot/packages" | Out-Null + RegisterLocalPackage 'Sentry' + RegisterLocalPackage 'Sentry.Maui' + } function RunDotnetWithSentryCLI([string] $action, [string]$project, [bool]$Symbols, [bool]$Sources, [string]$TargetFramework) { diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index f6f98407c6..a247335afe 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -7,6 +7,9 @@ Describe 'Console app NativeAOT ()' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { + if (-not (Test-Path Env:CI)) { + ResetLocalPackages + } $path = './console-app' DotnetNew 'console' $path $framework @' From 68db72f8b85a1ecc685cab80440bb638028d9f53 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 14:41:20 +1300 Subject: [PATCH 29/35] Revert behaviour change to cli and runtime integration tests --- integration-test/cli.Tests.ps1 | 4 +--- integration-test/runtime.Tests.ps1 | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/integration-test/cli.Tests.ps1 b/integration-test/cli.Tests.ps1 index 4c016a54d9..a5981e7887 100644 --- a/integration-test/cli.Tests.ps1 +++ b/integration-test/cli.Tests.ps1 @@ -7,9 +7,7 @@ Describe 'Console apps () - normal build' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - if (-not (Test-Path Env:CI)) { - ResetLocalPackages - } + ResetLocalPackages DotnetNew 'console' 'console-app' $framework } diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index a247335afe..cc41f9389b 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -7,9 +7,7 @@ Describe 'Console app NativeAOT ()' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - if (-not (Test-Path Env:CI)) { - ResetLocalPackages - } + ResetLocalPackages $path = './console-app' DotnetNew 'console' $path $framework @' From 3b5ea8de1e7ca7ea86255dcca417f70a17a4d5d9 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 15:39:30 +1300 Subject: [PATCH 30/35] Spinning in circles now... --- integration-test/cli.Tests.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration-test/cli.Tests.ps1 b/integration-test/cli.Tests.ps1 index a5981e7887..b18127137c 100644 --- a/integration-test/cli.Tests.ps1 +++ b/integration-test/cli.Tests.ps1 @@ -7,7 +7,10 @@ Describe 'Console apps () - normal build' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - ResetLocalPackages + if (-not (Test-Path Env:CI)) + { + ResetLocalPackages + } DotnetNew 'console' 'console-app' $framework } From 4580fe2437a3e8ad7db710b2ae00526c6db1cca2 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 16:08:26 +1300 Subject: [PATCH 31/35] . --- integration-test/runtime.Tests.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index cc41f9389b..0bd032d774 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -7,7 +7,10 @@ Describe 'Console app NativeAOT ()' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - ResetLocalPackages + if (-not (Test-Path Env:CI)) + { + ResetLocalPackages + } $path = './console-app' DotnetNew 'console' $path $framework @' From 7f66cda7406c0ac28f8e1f7ea07b63b6e5235add Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 16:51:14 +1300 Subject: [PATCH 32/35] msbuild --- integration-test/common.ps1 | 7 ++++++- integration-test/msbuild.Tests.ps1 | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/integration-test/common.ps1 b/integration-test/common.ps1 index 4f7a72236a..c897281890 100644 --- a/integration-test/common.ps1 +++ b/integration-test/common.ps1 @@ -108,10 +108,15 @@ BeforeAll { Remove-Item -Path ~/.nuget/packages/$($name.ToLower())/$packageVersion -Recurse -Force -ErrorAction SilentlyContinue } - function ResetLocalPackages() + function ResetLocalPackagePath() { Remove-Item -Path "$PSScriptRoot/packages" -Recurse -Force -ErrorAction SilentlyContinue New-Item -ItemType Directory -Path "$PSScriptRoot/packages" | Out-Null + } + + function ResetLocalPackages() + { + ResetLocalPackagePath RegisterLocalPackage 'Sentry' RegisterLocalPackage 'Sentry.Maui' } diff --git a/integration-test/msbuild.Tests.ps1 b/integration-test/msbuild.Tests.ps1 index 95288d7213..fa3e6fd16c 100644 --- a/integration-test/msbuild.Tests.ps1 +++ b/integration-test/msbuild.Tests.ps1 @@ -8,6 +8,10 @@ $IsARM64 = "Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::O # NOTE: These .NET versions are used to build a test app that consumes the Sentry # .NET SDK, and are not tied to the .NET version used to build the SDK itself. Describe 'MSBuild app' { + BeforeAll { + ResetLocalPackagePath + } + BeforeDiscovery { $frameworks = @() From af39bb7dce8c1a21adc9fd9abe58292ec71c2ab6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 20:17:42 +1300 Subject: [PATCH 33/35] . --- integration-test/android.Tests.ps1 | 5 ----- integration-test/cli.Tests.ps1 | 5 +---- integration-test/common.ps1 | 8 +------- integration-test/msbuild.Tests.ps1 | 2 +- integration-test/runtime.Tests.ps1 | 5 +---- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/integration-test/android.Tests.ps1 b/integration-test/android.Tests.ps1 index 11697cda72..11208485b9 100644 --- a/integration-test/android.Tests.ps1 +++ b/integration-test/android.Tests.ps1 @@ -23,11 +23,6 @@ $cases = @( ) Describe 'MAUI app (, )' -ForEach $cases -Skip:(-not $script:emulator) { BeforeAll { - if (-not (Test-Path Env:CI)) - { - ResetLocalPackages - } - $tfm = "$dotnet_version-android$(GetAndroidTpv $dotnet_version)" Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue diff --git a/integration-test/cli.Tests.ps1 b/integration-test/cli.Tests.ps1 index b18127137c..a5981e7887 100644 --- a/integration-test/cli.Tests.ps1 +++ b/integration-test/cli.Tests.ps1 @@ -7,10 +7,7 @@ Describe 'Console apps () - normal build' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - if (-not (Test-Path Env:CI)) - { - ResetLocalPackages - } + ResetLocalPackages DotnetNew 'console' 'console-app' $framework } diff --git a/integration-test/common.ps1 b/integration-test/common.ps1 index c897281890..36e1b9981c 100644 --- a/integration-test/common.ps1 +++ b/integration-test/common.ps1 @@ -108,17 +108,11 @@ BeforeAll { Remove-Item -Path ~/.nuget/packages/$($name.ToLower())/$packageVersion -Recurse -Force -ErrorAction SilentlyContinue } - function ResetLocalPackagePath() + function ResetLocalPackages() { Remove-Item -Path "$PSScriptRoot/packages" -Recurse -Force -ErrorAction SilentlyContinue New-Item -ItemType Directory -Path "$PSScriptRoot/packages" | Out-Null - } - - function ResetLocalPackages() - { - ResetLocalPackagePath RegisterLocalPackage 'Sentry' - RegisterLocalPackage 'Sentry.Maui' } function RunDotnetWithSentryCLI([string] $action, [string]$project, [bool]$Symbols, [bool]$Sources, [string]$TargetFramework) diff --git a/integration-test/msbuild.Tests.ps1 b/integration-test/msbuild.Tests.ps1 index fa3e6fd16c..8df9580533 100644 --- a/integration-test/msbuild.Tests.ps1 +++ b/integration-test/msbuild.Tests.ps1 @@ -9,7 +9,7 @@ $IsARM64 = "Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::O # .NET SDK, and are not tied to the .NET version used to build the SDK itself. Describe 'MSBuild app' { BeforeAll { - ResetLocalPackagePath + ResetLocalPackages } BeforeDiscovery { diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index 0bd032d774..cc41f9389b 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -7,10 +7,7 @@ Describe 'Console app NativeAOT ()' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { - if (-not (Test-Path Env:CI)) - { - ResetLocalPackages - } + ResetLocalPackages $path = './console-app' DotnetNew 'console' $path $framework @' From 8ce560c1b8920ee313888e78989515f2d2fadc84 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 5 Feb 2026 20:26:46 +1300 Subject: [PATCH 34/35] . --- integration-test/cli.Tests.ps1 | 2 ++ integration-test/runtime.Tests.ps1 | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/integration-test/cli.Tests.ps1 b/integration-test/cli.Tests.ps1 index a5981e7887..927d771293 100644 --- a/integration-test/cli.Tests.ps1 +++ b/integration-test/cli.Tests.ps1 @@ -44,6 +44,7 @@ Describe 'Console apps () - native AOT publish' -ForEach @( foreach ($fw in $currentFrameworks) { @{ framework = $fw } } ) { BeforeAll { + ResetLocalPackages DotnetNew 'console' 'console-app' $framework } @@ -106,6 +107,7 @@ Describe 'MAUI ()' -ForEach @( @{ framework = $previousFramework } ) -Skip:($env:NO_MOBILE -eq "true") { BeforeAll { + ResetLocalPackages RegisterLocalPackage 'Sentry.Android.AssemblyReader' RegisterLocalPackage 'Sentry.Bindings.Android' RegisterLocalPackage 'Sentry.Extensions.Logging' diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index cc41f9389b..0fa357c3fa 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -185,6 +185,10 @@ internal class FakeTransport : ITransport # This ensures we don't have a regression for https://github.com/getsentry/sentry-dotnet/issues/2825 Describe 'Console app regression (missing System.Reflection.Metadata)' { + BeforeAll { + ResetLocalPackages + } + AfterAll { dotnet remove ./net4-console/console-app.csproj package Sentry } From 30cd0f68d5f4a016c83c7a926f9018abb58431fb Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Fri, 6 Feb 2026 09:58:46 +1300 Subject: [PATCH 35/35] error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned --- .../Sentry.Maui.Device.TestApp.csproj | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index 31b2fe8048..47eafa7536 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -36,7 +36,9 @@ 13.0 21.0 - + + 26.2 true - - -