Skip to content

Commit 1cd11cf

Browse files
Integration tests
1 parent 26d096d commit 1cd11cf

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

integration-test/cli.Tests.ps1

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ $ErrorActionPreference = 'Stop'
44
. $PSScriptRoot/common.ps1
55

66
Describe 'Console apps (<framework>) - normal build' -ForEach @(
7-
@{ framework = "net9.0" }
7+
@{ framework = $previousFramework }
8+
@{ framework = $latestFramework }
89
) {
910
BeforeAll {
1011
DotnetNew 'console' 'console-app' $framework
@@ -40,7 +41,8 @@ Describe 'Console apps (<framework>) - normal build' -ForEach @(
4041
}
4142

4243
Describe 'Console apps (<framework>) - native AOT publish' -ForEach @(
43-
@{ framework = "net9.0" }
44+
@{ framework = $previousFramework }
45+
@{ framework = $latestFramework }
4446
) {
4547
BeforeAll {
4648
DotnetNew 'console' 'console-app' $framework
@@ -106,7 +108,7 @@ Describe 'Console apps (<framework>) - native AOT publish' -ForEach @(
106108
}
107109

108110
Describe 'MAUI' -ForEach @(
109-
@{ framework = "net9.0" }
111+
@{ framework = $previousFramework }
110112
) -Skip:($env:NO_MOBILE -eq "true") {
111113
BeforeAll {
112114
RegisterLocalPackage 'Sentry.Android.AssemblyReader'
@@ -119,20 +121,8 @@ Describe 'MAUI' -ForEach @(
119121
}
120122

121123
$name = 'maui-app'
122-
# Resolve target platform versions based on the base TFM
123-
switch ($framework) {
124-
'net9.0' {
125-
$androidTpv = '35.0' # matches PreviousAndroidTfm (net9.0-android35.0)
126-
$iosTpv = '18.0' # matches PreviousIosTfm / PreviousMacCatalystTfm
127-
}
128-
'net10.0' {
129-
$androidTpv = '36.0' # matches LatestAndroidTfm (net10.0-android36.0)
130-
$iosTpv = '26' # aligns with ios26 / maccatalyst26 (no .0 in props)
131-
}
132-
default {
133-
throw "Unsupported framework '$framework' for MAUI test platform versions."
134-
}
135-
}
124+
$androidTpv = GetAndroidTpv $framework
125+
$iosTpv = GetIosTpv $framework
136126

137127
DotnetNew 'maui' $name $framework
138128

@@ -167,12 +157,14 @@ Describe 'MAUI' -ForEach @(
167157
'libxamarin-app.so',
168158
'maui-app.pdb'
169159
)
160+
$nonZeroNumberRegex = '[1-9][0-9]*';
170161
$result.ScriptOutput | Should -AnyElementMatch 'Uploaded a total of 1 new mapping files'
171-
$result.ScriptOutput | Should -AnyElementMatch 'Found 23 debug information files \(1 with embedded sources\)'
162+
$result.ScriptOutput | Should -AnyElementMatch "Found $nonZeroNumberRegex debug information files \($nonZeroNumberRegex with embedded sources\)"
172163
}
173164

174165
It "uploads symbols and sources for an iOS build" -Skip:(!$IsMacOS) {
175166
$result = RunDotnetWithSentryCLI 'build' 'maui-app' $True $True "$framework-ios$iosTpv"
167+
Write-Host "UploadedDebugFiles: $($result.UploadedDebugFiles() | Out-String)"
176168
$result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @(
177169
'libmono-component-debugger.dylib',
178170
'libmono-component-diagnostics_tracing.dylib',

integration-test/common.ps1

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# So that this works in VS Code testing integration. Otherwise the script is run within its directory.
1+
$global:previousFramework = 'net9.0'
2+
$global:latestFramework = 'net10.0'
23

4+
# So that this works in VS Code testing integration. Otherwise the script is run within its directory.
35
# In CI, the module is loaded automatically
46
if (!(Test-Path env:CI ))
57
{
@@ -58,6 +60,24 @@ BeforeAll {
5860
Push-Location $PSScriptRoot
5961
$env:SENTRY_LOG_LEVEL = 'debug';
6062

63+
function GetAndroidTpv($framework)
64+
{
65+
switch ($framework) {
66+
'net9.0' { return '35.0' } # matches PreviousAndroidTfm (net9.0-android35.0)
67+
'net10.0' { return '36.0' } # matches LatestAndroidTfm (net10.0-android36.0)
68+
default { throw "Unsupported framework '$framework' for Android target platform version." }
69+
}
70+
}
71+
72+
function GetIosTpv($framework)
73+
{
74+
switch ($framework) {
75+
'net9.0' { return '18.0' } # matches PreviousIosTfm / PreviousMacCatalystTfm
76+
'net10.0' { return '26' } # aligns with ios26 / maccatalyst26
77+
default { throw "Unsupported framework '$framework' for iOS target platform version." }
78+
}
79+
}
80+
6181
function GetSentryPackageVersion()
6282
{
6383
$proj = Join-Path $PSScriptRoot '..\src\Sentry\Sentry.csproj'
@@ -148,7 +168,7 @@ BeforeAll {
148168
}
149169
elseif ($action -eq "publish")
150170
{
151-
$result.ScriptOutput | Should -AnyElementMatch "$((Get-Item $project).Basename) -> .*$project/bin/Release/$TargetFramework/.*/publish"
171+
$result.ScriptOutput | Should -AnyElementMatch "$((Get-Item $project).Basename) -> .*$project/bin/Release/$TargetFramework/.*publish.*"
152172
}
153173
$result.ScriptOutput | Should -Not -AnyElementMatch "Preparing upload to Sentry for project 'Sentry'"
154174
$result.HasErrors() | Should -BeFalse

integration-test/runtime.Tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ $ErrorActionPreference = 'Stop'
44
. $PSScriptRoot/common.ps1
55

66
Describe 'Console app NativeAOT (<framework>)' -ForEach @(
7-
@{ framework = 'net8.0' }
7+
@{ framework = $previousFramework }
8+
@{ framework = $latestFramework }
89
) {
910
BeforeAll {
1011
$path = './console-app'

0 commit comments

Comments
 (0)