Skip to content

Commit 060eb5f

Browse files
committed
Run iOS integration tests in Release and Debug modes
1 parent 49a7334 commit 060eb5f

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

integration-test/ios.Tests.ps1

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ BeforeDiscovery {
1111
$script:simulator = Get-IosSimulatorUdid -PreferredStates @('Booted')
1212
}
1313

14-
Describe 'iOS app (<tfm>)' -ForEach @(
15-
@{ tfm = "net9.0-ios18.0" }
14+
Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(
15+
@{ tfm = "net9.0-ios18.0"; configuration = "Release" }
16+
@{ tfm = "net9.0-ios18.0"; configuration = "Debug" }
1617
) -Skip:(-not $script:simulator) {
1718
BeforeAll {
1819
. $PSScriptRoot/../scripts/device-test-utils.ps1
@@ -26,7 +27,7 @@ Describe 'iOS app (<tfm>)' -ForEach @(
2627

2728
Write-Host "::group::Build Sentry.Maui.Device.IntegrationTestApp.csproj"
2829
dotnet build Sentry.Maui.Device.IntegrationTestApp.csproj `
29-
--configuration Release `
30+
--configuration $configuration `
3031
--framework $tfm `
3132
--runtime $rid
3233
| ForEach-Object { Write-Host $_ }
@@ -35,9 +36,9 @@ Describe 'iOS app (<tfm>)' -ForEach @(
3536

3637
function InstallIosApp
3738
{
38-
Write-Host "::group::Install bin/Release/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app"
39+
Write-Host "::group::Install bin/$configuration/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app"
3940
xcrun simctl install $simulator `
40-
bin/Release/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app
41+
bin/$configuration/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app
4142
| ForEach-Object { Write-Host $_ }
4243
Write-Host '::endgroup::'
4344
$LASTEXITCODE | Should -Be 0
@@ -86,7 +87,7 @@ Describe 'iOS app (<tfm>)' -ForEach @(
8687
UninstallIosApp
8788
}
8889

89-
It 'captures managed crash' {
90+
It 'captures managed crash (<configuration>)' {
9091
$result = Invoke-SentryServer {
9192
param([string]$url)
9293
RunIosApp -Dsn $url -TestArg "Managed"
@@ -97,9 +98,10 @@ Describe 'iOS app (<tfm>)' -ForEach @(
9798
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`""
9899
# TODO: fix redundant SIGABRT (#3954)
99100
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`"" } | Should -Throw
101+
{ $result.Envelopes() | Should -HaveCount 1 } | Should -Throw
100102
}
101103

102-
It 'captures native crash' {
104+
It 'captures native crash (<configuration>)' {
103105
$result = Invoke-SentryServer {
104106
param([string]$url)
105107
RunIosApp -Dsn $url -TestArg "Native"
@@ -109,9 +111,10 @@ Describe 'iOS app (<tfm>)' -ForEach @(
109111
$result.HasErrors() | Should -BeFalse
110112
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"EXC_[A-Z_]+`""
111113
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`""
114+
$result.Envelopes() | Should -HaveCount 1
112115
}
113116

114-
It 'captures null reference exception' {
117+
It 'captures null reference exception (<configuration>)' {
115118
$result = Invoke-SentryServer {
116119
param([string]$url)
117120
RunIosApp -Dsn $url -TestArg "NullReferenceException"
@@ -120,7 +123,12 @@ Describe 'iOS app (<tfm>)' -ForEach @(
120123

121124
$result.HasErrors() | Should -BeFalse
122125
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`""
123-
# TODO: fix redundant EXC_BAD_ACCESS (#3954)
124-
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`"" } | Should -Throw
126+
# TODO: fix redundant EXC_BAD_ACCESS in Release (#3954)
127+
if ($configuration -eq 'Release') {
128+
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`"" } | Should -Throw
129+
} else {
130+
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`""
131+
$result.Envelopes() | Should -HaveCount 1
132+
}
125133
}
126134
}

0 commit comments

Comments
 (0)