Skip to content

Commit d79436c

Browse files
committed
Fix empty --device argument
1 parent 43b57c7 commit d79436c

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

scripts/ios-integration.Tests.ps1

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Describe 'MAUI app' {
88
It 'Produces the expected exceptions' {
99
$result = Invoke-SentryServer {
1010
Param([string]$url)
11+
$dsn = $url.Replace('http://', 'http://key@') + '/0'
1112

1213
Push-Location $PSScriptRoot/../samples/Sentry.Samples.Maui
1314
try
@@ -17,7 +18,17 @@ Describe 'MAUI app' {
1718
$arch = ($(uname -m) -eq 'arm64') ? 'arm64' : 'x64'
1819
$rid = "iossimulator-$arch"
1920
$udid = Get-IosSimulatorUdid -IosVersion '18.5' -Verbose
20-
$dsn = $url.Replace('http://', 'http://key@') + '/0'
21+
22+
$arguments = @(
23+
"-v",
24+
"--target=$target",
25+
"--output-directory=test_output"
26+
)
27+
if ($udid) {
28+
$arguments += @("--device=$udid")
29+
} else {
30+
Write-Host "No suitable simulator found; proceeding without a specific --device"
31+
}
2132

2233
Write-Host "::group::Build"
2334
$env:SENTRY_DSN = $dsn
@@ -29,42 +40,30 @@ Describe 'MAUI app' {
2940
Write-Host '::endgroup::'
3041

3142
Write-Host "::group::Install"
32-
xharness apple install -v `
33-
--target $target `
34-
--app bin/Release/$tfm/$rid/Sentry.Samples.Maui.app `
35-
--device $udid `
36-
--output-directory=test_output
43+
xharness apple install $arguments `
44+
--app bin/Release/$tfm/$rid/Sentry.Samples.Maui.app
3745
| ForEach-Object { Write-Host $_ }
3846
Write-Host '::endgroup::'
3947

4048
Write-Host "::group::Crash"
41-
xharness apple just-run -v `
42-
--target $target `
49+
xharness apple just-run $arguments `
4350
--app io.sentry.dotnet.samples.maui `
44-
--device $udid `
45-
--output-directory=test_output `
4651
--set-env SENTRY_DSN=$dsn `
4752
--set-env SENTRY_CRASH_TYPE=Managed
4853
| ForEach-Object { Write-Host $_ }
4954
Write-Host '::endgroup::'
5055

5156
Write-Host "::group::Re-run"
52-
xharness apple just-run -v `
53-
--target $target `
57+
xharness apple just-run $arguments `
5458
--app io.sentry.dotnet.samples.maui `
55-
--device $udid `
56-
--output-directory=test_output `
5759
--set-env SENTRY_DSN=$dsn `
5860
--set-env SENTRY_CRASH_TYPE=Exit
5961
| ForEach-Object { Write-Host $_ }
6062
Write-Host '::endgroup::'
6163

6264
Write-Host "::group::Uninstall"
63-
xharness apple uninstall -v `
64-
--target $target `
65-
--app io.sentry.dotnet.samples.maui `
66-
--device $udid `
67-
--output-directory=test_output
65+
xharness apple uninstall $arguments `
66+
--app io.sentry.dotnet.samples.maui
6867
| ForEach-Object { Write-Host $_ }
6968
Write-Host '::endgroup::'
7069
}

0 commit comments

Comments
 (0)