From a8e5587597def5d706e350ac9d9b38f8814b9d3e Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 18 Oct 2023 22:44:00 +0200 Subject: [PATCH 01/17] feat: Native AOT debug info & source code upload --- .../Sentry.Samples.Console.Basic.csproj | 8 -- src/Sentry/buildTransitive/Sentry.targets | 112 ++++++++++------ test/sentry-cli-integration.Tests.ps1 | 126 ++++++++++++------ 3 files changed, 155 insertions(+), 91 deletions(-) diff --git a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj index a0b8d0b554..4ae85e4b80 100644 --- a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj +++ b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj @@ -4,14 +4,6 @@ Exe enable enable - - - - - net6.0 - false - - net7.0 true diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index 04b2392a19..4967fe6664 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -120,48 +120,80 @@ - - - - - - - - - - - - - - - + + + true + $(PublishDir) + + CopyNativeBinary + + + + + + + + + + false + $(OutputPath) + Build + + + + + + + + + + + + + + + + + + + + + + + @(IntermediateAssembly->'$(SentryCLIUploadDirectory)%(FileName).pdb') + @(IntermediateAssembly->'$(SentryCLIUploadDirectory)%(FileName)%(Extension)') + + + + + + + + + + - - - - - - - - - - <_SentryDebugInfoFile>@(IntermediateAssembly->'$(IntermediateOutputPath)%(FileName).pdb') - <_SentryDebugInfoFile Condition="!Exists('$(_SentryDebugInfoFile)')">@(IntermediateAssembly->'$(IntermediateOutputPath)%(FileName)%(Extension)') - <_SentrySourceBundle>@(IntermediateAssembly->'$(IntermediateOutputPath)%(FileName).src.zip') - - - - - - - - - diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index b9966cb81f..bdaa2271c6 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -1,4 +1,4 @@ -using namespace System.Runtime.InteropServices +# This file contains test cases for https://pester.dev/ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -9,7 +9,7 @@ if (!(Test-Path env:CI )) Import-Module $PSScriptRoot/../../github-workflows/sentry-cli/integration-test/action.psm1 -Force } -function Should-AnyElementMatch ($ActualValue, [string]$ExpectedValue, [switch] $Negate, [string] $Because) +function ShouldAnyElementMatch ($ActualValue, [string]$ExpectedValue, [switch] $Negate, [string] $Because) { <# .SYNOPSIS @@ -44,23 +44,22 @@ function Should-AnyElementMatch ($ActualValue, [string]$ExpectedValue, [switch] BeforeDiscovery { Add-ShouldOperator -Name AnyElementMatch ` - -InternalName 'Should-AnyElementMatch' ` - -Test ${function:Should-AnyElementMatch} ` + -InternalName 'ShouldAnyElementMatch' ` + -Test ${function:ShouldAnyElementMatch} ` -SupportsArrayInput } BeforeAll { $env:SENTRY_LOG_LEVEL = 'debug'; - function DotnetBuild([string]$Sample, [bool]$Symbols, [bool]$Sources, [string]$TargetFramework = '') + function RunDotnet([string] $action, [string]$Sample, [bool]$Symbols, [bool]$Sources, [string]$TargetFramework = 'net7.0') { $rootDir = "$(Get-Item $PSScriptRoot/../../)" - $framework = $TargetFramework -eq '' ? '' : @('-f', $TargetFramework) - Invoke-SentryServer { + $result = Invoke-SentryServer { Param([string]$url) Write-Host "Building $Sample" - dotnet build "samples/$sample/$sample.csproj" -c Release $framework --no-restore --nologo ` + dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo -v d ` /p:UseSentryCLI=true ` /p:SentryUploadSymbols=$Symbols ` /p:SentryUploadSources=$Sources ` @@ -89,49 +88,98 @@ BeforeAll { $_ } } + + if ($action -eq "build") + { + $result.ScriptOutput | Should -Contain 'Build succeeded.' + } + elseif ($action -eq "publish") + { + $result.ScriptOutput | Should -AnyElementMatch "$sample -> .*samples/$sample/bin/Release/$TargetFramework/.*/publish" + } + $result.HasErrors() | Should -BeFalse + $result } } -Describe 'CLI-integration' { - - It "uploads symbols and sources for a console app build" { - $result = DotnetBuild 'Sentry.Samples.Console.Basic' $True $True - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse +Describe 'Console apps - normal build' { + BeforeAll { + Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/' -Recurse -Verbose + } + + BeforeEach { + if (Get-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*.src.zip' -ErrorAction SilentlyContinue) + { + Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*.src.zip' + } + } + + It "uploads symbols and sources" { + $result = RunDotnet 'build' 'Sentry.Samples.Console.Basic' $True $True $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.pdb', 'Sentry.Samples.Console.Basic.pdb') - $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Console.Basic/Program.cs' + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files \(2 with embedded sources\)' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' } - It "uploads symbols for a console app build" { - $result = DotnetBuild 'Sentry.Samples.Console.Basic' $True $False - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse + It "uploads symbols" { + $result = RunDotnet 'build' 'Sentry.Samples.Console.Basic' $True $False $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.pdb', 'Sentry.Samples.Console.Basic.pdb') + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files \(2 with embedded sources\)' } - It "uploads sources for a console app build" { - $result = DotnetBuild 'Sentry.Samples.Console.Basic' $False $True - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse + It "uploads sources" { + $result = RunDotnet 'build' 'Sentry.Samples.Console.Basic' $False $True $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Console.Basic/Program.cs' $result.UploadedDebugFiles() | Should -BeNullOrEmpty } - It "uploads nothing for a console app build when disabled" { - $result = DotnetBuild 'Sentry.Samples.Console.Basic' $False $False - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @() + It "uploads nothing when disabled" { + $result = RunDotnet 'build' 'Sentry.Samples.Console.Basic' $False $False + $result.UploadedDebugFiles() | Should -BeNullOrEmpty } +} - It "uploads symbols and sources for a MAUI Android app build" { - $result = DotnetBuild 'Sentry.Samples.Maui' $True $True 'net7.0-android' - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse +Describe 'Console apps - native AOT publish' { + BeforeEach { + Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose + } + + It "uploads symbols and sources" { + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( + 'Sentry.pdb', + 'Sentry.Samples.Console.Basic.pdb') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' + } + + It "uploads symbols" { + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( + 'Sentry.pdb', + 'Sentry.Samples.Console.Basic.pdb') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' + } + + It "uploads sources" { + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( + 'Sentry.Samples.Console.Basic.src.zip') + } + + It "uploads nothing when disabled" { + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False + $result.UploadedDebugFiles() | Should -BeNullOrEmpty + } +} + +Describe 'MAUI' { + It "uploads symbols and sources" { + $result = RunDotnet 'build' 'Sentry.Samples.Maui' $True $True 'net7.0-android' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.Android.AssemblyReader.pdb', 'Sentry.Bindings.Android.pdb', @@ -142,17 +190,9 @@ Describe 'CLI-integration' { ) $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs' } - - if (![RuntimeInformation]::IsOSPlatform([OSPlatform]::OSX)) - { - # Remaining tests run on macOS only - return - } - - It "uploads symbols and sources for a MAUI iOS app build" { - $result = DotnetBuild 'Sentry.Samples.Maui' $True $True 'net7.0-ios' - $result.ScriptOutput | Should -Contain 'Build succeeded.' - $result.HasErrors() | Should -BeFalse + + It "uploads symbols and sources" -Skip:(!$IsMacOS) { + $result = RunDotnet 'build' 'Sentry.Samples.Maui' $True $True 'net7.0-ios' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'libmono-component-debugger.dylib', 'libmono-component-diagnostics_tracing.dylib', From af3bc453edd73b100140ff103dee01fd0886d640 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 18 Oct 2023 22:51:26 +0200 Subject: [PATCH 02/17] no need for debug log in the cli integration test --- test/sentry-cli-integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index bdaa2271c6..9f3bb7b968 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -59,7 +59,7 @@ BeforeAll { $result = Invoke-SentryServer { Param([string]$url) Write-Host "Building $Sample" - dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo -v d ` + dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo ` /p:UseSentryCLI=true ` /p:SentryUploadSymbols=$Symbols ` /p:SentryUploadSources=$Sources ` From b46f9f78df52139c69a488131220a50948a23db7 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 18 Oct 2023 22:52:38 +0200 Subject: [PATCH 03/17] fix maui test names --- test/sentry-cli-integration.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 9f3bb7b968..4a2598f5b3 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -178,7 +178,7 @@ Describe 'Console apps - native AOT publish' { } Describe 'MAUI' { - It "uploads symbols and sources" { + It "uploads symbols and sources for an Android build" { $result = RunDotnet 'build' 'Sentry.Samples.Maui' $True $True 'net7.0-android' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.Android.AssemblyReader.pdb', @@ -191,7 +191,7 @@ Describe 'MAUI' { $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs' } - It "uploads symbols and sources" -Skip:(!$IsMacOS) { + It "uploads symbols and sources for an iOS build" -Skip:(!$IsMacOS) { $result = RunDotnet 'build' 'Sentry.Samples.Maui' $True $True 'net7.0-ios' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'libmono-component-debugger.dylib', From bad4a6983d463e06b37f4c755d0fdb8d08424ced Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 19 Oct 2023 16:47:45 +0200 Subject: [PATCH 04/17] comments --- src/Sentry/buildTransitive/Sentry.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index 4967fe6664..a28b827034 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -126,7 +126,8 @@ true $(PublishDir) - + CopyNativeBinary From 90d4ff98aadb5c98e4bc6eeaf060b312dff7af42 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 19 Oct 2023 20:39:24 +0200 Subject: [PATCH 05/17] improve sentry-cli test script --- test/sentry-cli-integration.Tests.ps1 | 61 ++++++++++++++++----------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 4a2598f5b3..98551e73ec 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -35,6 +35,10 @@ function ShouldAnyElementMatch ($ActualValue, [string]$ExpectedValue, [switch] $ $failureMessage = "Expected string '$ExpectedValue' to match any element in collection @($($ActualValue -join ', '))$(if($Because) { " because $Because"})." } } + else + { + $failureMessage = $null + } return [pscustomobject]@{ Succeeded = $succeeded @@ -58,34 +62,41 @@ BeforeAll { $result = Invoke-SentryServer { Param([string]$url) - Write-Host "Building $Sample" - dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo ` - /p:UseSentryCLI=true ` - /p:SentryUploadSymbols=$Symbols ` - /p:SentryUploadSources=$Sources ` - /p:SentryOrg=org ` - /p:SentryProject=project ` - /p:SentryUrl=$url ` - /p:SentryAuthToken=dummy ` - | ForEach-Object { - if ($_ -match "^Time Elapsed ") - { - "Time Elapsed [value removed]" - } - elseif ($_ -match "\[[0-9/]+\]") - { - # Skip lines like `[102/103] Sentry.Samples.Maui.dll -> Sentry.Samples.Maui.dll.so` + Write-Host "::group::Building $Sample" + try + { + dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo ` + /p:UseSentryCLI=true ` + /p:SentryUploadSymbols=$Symbols ` + /p:SentryUploadSources=$Sources ` + /p:SentryOrg=org ` + /p:SentryProject=project ` + /p:SentryUrl=$url ` + /p:SentryAuthToken=dummy ` + | ForEach-Object { + if ($_ -match "^Time Elapsed ") + { + "Time Elapsed [value removed]" + } + elseif ($_ -match "\[[0-9/]+\]") + { + # Skip lines like `[102/103] Sentry.Samples.Maui.dll -> Sentry.Samples.Maui.dll.so` + } + else + { + "$_". ` + Replace($rootDir, ''). ` + Replace('\', '/') + } } - else - { - "$_". ` - Replace($rootDir, ''). ` - Replace('\', '/') + | ForEach-Object { + Write-Host " $_" + $_ } } - | ForEach-Object { - Write-Host " $_" - $_ + finally + { + Write-Host "::endgroup::" } } From 58b8f9ddf52b32fe1476de4685470d4368c498bb Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 19 Oct 2023 21:20:57 +0200 Subject: [PATCH 06/17] native runtime restore --- test/sentry-cli-integration.Tests.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 98551e73ec..17d675e1e5 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -155,6 +155,10 @@ Describe 'Console apps - normal build' { } Describe 'Console apps - native AOT publish' { + BeforeAll { + dotnet workload restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --use-current-runtime + } + BeforeEach { Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose } @@ -163,7 +167,7 @@ Describe 'Console apps - native AOT publish' { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.pdb', - 'Sentry.Samples.Console.Basic.pdb') + ($IsWindows ? 'Sentry.Samples.Console.Basic.pdb' : 'Sentry.Samples.Console.Basic')) $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' } @@ -172,14 +176,14 @@ Describe 'Console apps - native AOT publish' { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.pdb', - 'Sentry.Samples.Console.Basic.pdb') + ($IsWindows ? 'Sentry.Samples.Console.Basic.pdb' : 'Sentry.Samples.Console.Basic')) $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' } It "uploads sources" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - 'Sentry.Samples.Console.Basic.src.zip') + $IsWindows ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') } It "uploads nothing when disabled" { From 74d7a2469d9f59e2f74546450177957a797ce321 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 19 Oct 2023 23:01:30 +0200 Subject: [PATCH 07/17] fixes and linux support --- .../Sentry.Samples.Console.Basic.csproj | 2 +- src/Sentry/buildTransitive/Sentry.targets | 12 ++-- test/sentry-cli-integration.Tests.ps1 | 66 ++++++++++++++----- 3 files changed, 60 insertions(+), 20 deletions(-) diff --git a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj index 4ae85e4b80..394937bdaa 100644 --- a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj +++ b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj @@ -4,7 +4,7 @@ Exe enable enable - net7.0 + net7.0;net8.0 true diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index a28b827034..8ae49a677f 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -149,9 +149,11 @@ - + + Condition="'$(MSBuildProjectName)' != 'Sentry' and '$(SentryCLI)' != '' and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true')"> - @(IntermediateAssembly->'$(SentryCLIUploadDirectory)%(FileName).pdb') + $(NativeBinary)$(NativeSymbolExt) + @(IntermediateAssembly->'$(SentryCLIUploadDirectory)%(FileName).pdb') @(IntermediateAssembly->'$(SentryCLIUploadDirectory)%(FileName)%(Extension)') + $([System.IO.Path]::GetDirectoryName('$(SentryCLIDebugInfoFile)')) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 17d675e1e5..7413a4eb0d 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -108,6 +108,7 @@ BeforeAll { { $result.ScriptOutput | Should -AnyElementMatch "$sample -> .*samples/$sample/bin/Release/$TargetFramework/.*/publish" } + $result.ScriptOutput | Should -Not -AnyElementMatch "Preparing upload to Sentry for project 'Sentry'" $result.HasErrors() | Should -BeFalse $result } @@ -154,9 +155,12 @@ Describe 'Console apps - normal build' { } } -Describe 'Console apps - native AOT publish' { +Describe 'Console apps - native AOT publish ()' -ForEach @( + @{ framework = "net7.0" }, + @{ framework = "net8.0" } +) { BeforeAll { - dotnet workload restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --use-current-runtime + dotnet restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --use-current-runtime } BeforeEach { @@ -164,30 +168,62 @@ Describe 'Console apps - native AOT publish' { } It "uploads symbols and sources" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - 'Sentry.pdb', - ($IsWindows ? 'Sentry.Samples.Console.Basic.pdb' : 'Sentry.Samples.Console.Basic')) - $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True 'net7.0' + $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" + if ($IsWindows) + { + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' + } + elseif ($IsLinux && $framework -eq 'net7.0') + { + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + } + else + { + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( + 'Sentry.Samples.Console.Basic', 'Sentry.Samples.Console.Basic.dbg') + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + } } It "uploads symbols" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - 'Sentry.pdb', - ($IsWindows ? 'Sentry.Samples.Console.Basic.pdb' : 'Sentry.Samples.Console.Basic')) - $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False 'net7.0' + $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" + if ($IsWindows) + { + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' + } + if ($IsLinux && $framework -eq 'net7.0') + { + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + } + else + { + $debugExtension = $IsLinux ? '.dbg' : '.dSYM' + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( + 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + } } It "uploads sources" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True 'net7.0' + $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( $IsWindows ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') } It "uploads nothing when disabled" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False 'net7.0' $result.UploadedDebugFiles() | Should -BeNullOrEmpty } } From e527e2364cded16aaa07c322de8f422c633a38a4 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 20 Oct 2023 08:03:36 +0200 Subject: [PATCH 08/17] fix CLI integration tests on windows --- test/sentry-cli-integration.Tests.ps1 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 7413a4eb0d..f190e6c65e 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -3,6 +3,8 @@ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' +Push-Location $PSScriptRoot/../ + # In CI, the module is loaded automatically if (!(Test-Path env:CI )) { @@ -167,16 +169,16 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose } - It "uploads symbols and sources" { + It "uploads symbols and sources ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True 'net7.0' $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" if ($IsWindows) { $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') - $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file \(1 with embedded sources\)' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 0 debug information files' + $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' } - elseif ($IsLinux && $framework -eq 'net7.0') + elseif ($IsLinux -and $framework -eq 'net7.0') { $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' @@ -191,7 +193,7 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } } - It "uploads symbols" { + It "uploads symbols ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False 'net7.0' $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" if ($IsWindows) @@ -199,7 +201,7 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' } - if ($IsLinux && $framework -eq 'net7.0') + elseif ($IsLinux -and $framework -eq 'net7.0') { $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' @@ -215,14 +217,14 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } } - It "uploads sources" { + It "uploads sources ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True 'net7.0' $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( $IsWindows ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') } - It "uploads nothing when disabled" { + It "uploads nothing when disabled ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False 'net7.0' $result.UploadedDebugFiles() | Should -BeNullOrEmpty } From b16d1fb9f135040b3517f977b3cbe14699e5809f Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 20 Oct 2023 08:25:19 +0200 Subject: [PATCH 09/17] fix integration tests on linux --- test/sentry-cli-integration.Tests.ps1 | 35 +++++++++------------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index f190e6c65e..b005dcd7e8 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -170,17 +170,12 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } It "uploads symbols and sources ()" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True 'net7.0' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" - if ($IsWindows) + if ($IsWindows -or ($IsLinux -and $framework -eq 'net7.0')) { - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') - $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' - } - elseif ($IsLinux -and $framework -eq 'net7.0') - { - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') + $extension = $IsLinux ? '' : '.pdb' + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @("Sentry.Samples.Console.Basic$extension") $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' } @@ -194,38 +189,32 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } It "uploads symbols ()" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False 'net7.0' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" - if ($IsWindows) + if ($IsWindows -or ($IsLinux -and $framework -eq 'net7.0')) { - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic.pdb') + $extension = $IsLinux ? '' : '.pdb' + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @("Sentry.Samples.Console.Basic$extension") $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' } - elseif ($IsLinux -and $framework -eq 'net7.0') - { - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @('Sentry.Samples.Console.Basic') - $result.ScriptOutput | Should -AnyElementMatch 'Found 1 debug information file' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' - } else { $debugExtension = $IsLinux ? '.dbg' : '.dSYM' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") - $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' } } It "uploads sources ()" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True 'net7.0' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - $IsWindows ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') + ($IsWindows -or $framework -eq 'net8.0') ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') } It "uploads nothing when disabled ()" { - $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False 'net7.0' + $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False $framework $result.UploadedDebugFiles() | Should -BeNullOrEmpty } } From bce2d77db4b9a3a1ab3af1a391ee267f6611788a Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 20 Oct 2023 09:13:52 +0200 Subject: [PATCH 10/17] fix maui test --- src/Sentry/buildTransitive/Sentry.targets | 19 +++++++++------- test/sentry-cli-integration.Tests.ps1 | 27 +++++++++++------------ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index 8ae49a677f..52170a502a 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -34,8 +34,13 @@ false false - - true + + true @@ -126,7 +131,7 @@ true $(PublishDir) - CopyNativeBinary @@ -149,11 +154,9 @@ - + + Condition="'$(SentryCLI)' != '' and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true')"> - diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index b005dcd7e8..44fb2d2449 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -68,7 +68,6 @@ BeforeAll { try { dotnet $action "samples/$sample/$sample.csproj" -c Release -f $TargetFramework --no-restore --nologo ` - /p:UseSentryCLI=true ` /p:SentryUploadSymbols=$Symbols ` /p:SentryUploadSources=$Sources ` /p:SentryOrg=org ` @@ -101,7 +100,7 @@ BeforeAll { Write-Host "::endgroup::" } } - + if ($action -eq "build") { $result.ScriptOutput | Should -Contain 'Build succeeded.' @@ -109,7 +108,7 @@ BeforeAll { elseif ($action -eq "publish") { $result.ScriptOutput | Should -AnyElementMatch "$sample -> .*samples/$sample/bin/Release/$TargetFramework/.*/publish" - } + } $result.ScriptOutput | Should -Not -AnyElementMatch "Preparing upload to Sentry for project 'Sentry'" $result.HasErrors() | Should -BeFalse $result @@ -118,16 +117,16 @@ BeforeAll { Describe 'Console apps - normal build' { BeforeAll { - Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/' -Recurse -Verbose + Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/' -Recurse -Verbose } - + BeforeEach { if (Get-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*.src.zip' -ErrorAction SilentlyContinue) { Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*.src.zip' } } - + It "uploads symbols and sources" { $result = RunDotnet 'build' 'Sentry.Samples.Console.Basic' $True $True $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( @@ -164,11 +163,11 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( BeforeAll { dotnet restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --use-current-runtime } - + BeforeEach { - Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose + Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose } - + It "uploads symbols and sources ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" @@ -184,7 +183,7 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.Samples.Console.Basic', 'Sentry.Samples.Console.Basic.dbg') $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' - $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' + $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' } } @@ -202,10 +201,10 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( $debugExtension = $IsLinux ? '.dbg' : '.dSYM' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") - $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' + $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' } } - + It "uploads sources ()" { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" @@ -230,9 +229,9 @@ Describe 'MAUI' { 'Sentry.pdb', 'Sentry.Samples.Maui.pdb' ) - $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs' + $result.ScriptOutput | Should -AnyElementMatch 'Found 6 debug information files \(6 with embedded sources\)' } - + It "uploads symbols and sources for an iOS build" -Skip:(!$IsMacOS) { $result = RunDotnet 'build' 'Sentry.Samples.Maui' $True $True 'net7.0-ios' $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( From 2ec18e16937e3a29c9e77f68eea33766054663fc Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 20 Oct 2023 12:37:50 +0200 Subject: [PATCH 11/17] fix macos CLI integration tests --- .../Sentry.Samples.Console.Basic.csproj | 4 ++- test/sentry-cli-integration.Tests.ps1 | 36 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj index 394937bdaa..1ec5769547 100644 --- a/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj +++ b/samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj @@ -5,7 +5,9 @@ enable enable net7.0;net8.0 - true + + + true diff --git a/test/sentry-cli-integration.Tests.ps1 b/test/sentry-cli-integration.Tests.ps1 index 44fb2d2449..d3aba9e0aa 100644 --- a/test/sentry-cli-integration.Tests.ps1 +++ b/test/sentry-cli-integration.Tests.ps1 @@ -161,14 +161,16 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( @{ framework = "net8.0" } ) { BeforeAll { - dotnet restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --use-current-runtime + $runtime = $IsWindows ? 'win-x64' : $IsLinux ? 'linux-x64' : "osx-$(uname -m)" + Write-Host "Running dotnet restore for Sentry.Samples.Console.Basic, runtime: $runtime" + dotnet restore samples/Sentry.Samples.Console.Basic/Sentry.Samples.Console.Basic.csproj --runtime $runtime } BeforeEach { Remove-Item 'samples/Sentry.Samples.Console.Basic/bin/Release/*/*/publish' -Recurse -Verbose } - It "uploads symbols and sources ()" { + It "uploads symbols and sources ()" -Skip:($IsMacOS -and $framework -eq 'net7.0') { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" if ($IsWindows -or ($IsLinux -and $framework -eq 'net7.0')) @@ -180,14 +182,16 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } else { - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - 'Sentry.Samples.Console.Basic', 'Sentry.Samples.Console.Basic.dbg') + # On macOS, only the dwarf is uploaded from dSYM so it has the same name as the actual executable. + $debugExtension = $IsLinux ? '.dbg' : '' + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be (@( + 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") | Sort-Object -Unique) $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' $result.ScriptOutput | Should -AnyElementMatch 'Resolved source code for 1 debug information file' } } - It "uploads symbols ()" { + It "uploads symbols ()" -Skip:($IsMacOS -and $framework -eq 'net7.0') { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $True $False $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" if ($IsWindows -or ($IsLinux -and $framework -eq 'net7.0')) @@ -198,21 +202,26 @@ Describe 'Console apps - native AOT publish ()' -ForEach @( } else { - $debugExtension = $IsLinux ? '.dbg' : '.dSYM' - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") + # On macOS, only the dwarf is uploaded from dSYM so it has the same name as the actual executable. + $debugExtension = $IsLinux ? '.dbg' : '' + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be (@( + 'Sentry.Samples.Console.Basic', "Sentry.Samples.Console.Basic$debugExtension") | Sort-Object -Unique) $result.ScriptOutput | Should -AnyElementMatch 'Found 2 debug information files' } } - It "uploads sources ()" { + It "uploads sources ()" -Skip:($IsMacOS -and $framework -eq 'net7.0') { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $True $framework $result.ScriptOutput | Should -AnyElementMatch "Preparing upload to Sentry for project 'Sentry.Samples.Console.Basic'" - $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @( - ($IsWindows -or $framework -eq 'net8.0') ? 'Sentry.Samples.Console.Basic.src.zip' : 'Sentry.Samples.Console.src.zip') + $sourceBundle = 'Sentry.Samples.Console.Basic.src.zip' + if ($IsMacOS -or ($IsLinux -and $framework -eq 'net7.0')) + { + $sourceBundle = 'Sentry.Samples.Console.src.zip' + } + $result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @($sourceBundle) } - It "uploads nothing when disabled ()" { + It "uploads nothing when disabled ()" -Skip:($IsMacOS -and $framework -eq 'net7.0') { $result = RunDotnet 'publish' 'Sentry.Samples.Console.Basic' $False $False $framework $result.UploadedDebugFiles() | Should -BeNullOrEmpty } @@ -253,6 +262,7 @@ Describe 'MAUI' { 'Sentry.Samples.Maui', 'Sentry.Samples.Maui.pdb' ) - $result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs' + $nonZeroNumberRegex = '[1-9][0-9]*'; + $result.ScriptOutput | Should -AnyElementMatch "Found $nonZeroNumberRegex debug information files \($nonZeroNumberRegex with embedded sources\)" } } From 1dfe043e9df4c277c3a66eb06f440d03150cbc00 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 20 Oct 2023 13:41:59 +0200 Subject: [PATCH 12/17] don't specify UseSentryCLI explicitly --- Directory.Build.props | 5 ----- benchmarks/Directory.Build.props | 1 - build.cmd | 1 - build.sh | 1 - samples/Directory.Build.props | 5 ----- src/Sentry/buildTransitive/Sentry.targets | 4 ++-- test/Directory.Build.props | 5 ----- test/sentry-cli-integration.Tests.ps1 | 1 + 8 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3b12ca17d5..5e8a9b3c2c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -50,11 +50,6 @@ true - - - false - - - false false diff --git a/build.cmd b/build.cmd index 8ae96e27aa..01c0cea7e6 100644 --- a/build.cmd +++ b/build.cmd @@ -1,3 +1,2 @@ -set UseSentryCLI=false dotnet build Sentry.sln -c Release dotnet test Sentry.sln -c Release --no-build diff --git a/build.sh b/build.sh index fdead9b9f3..01c0cea7e6 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,2 @@ -export UseSentryCLI=false dotnet build Sentry.sln -c Release dotnet test Sentry.sln -c Release --no-build diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 59e07989bb..927ac00a5b 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -6,11 +6,6 @@ false - - - false - - + Condition="'$(SentryCLI)' != '' and '$(SentryUploadAndroidProguardMapping)' == 'true' And '$(AndroidProguardMappingFile)' != ''"> diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 0b3d74d32c..7010ce8f21 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -9,11 +9,6 @@ true - - - false - - + true diff --git a/src/Sentry/buildTransitive/Sentry.targets b/src/Sentry/buildTransitive/Sentry.targets index e15d2874c7..a5c77238d3 100644 --- a/src/Sentry/buildTransitive/Sentry.targets +++ b/src/Sentry/buildTransitive/Sentry.targets @@ -35,7 +35,7 @@ false + We're explicitly skipping uploads for Sentry projects because they interfere with CLI integration test asserts. -->