Skip to content

Commit 6226708

Browse files
committed
Fix variable declarations in test script
1 parent a32ab71 commit 6226708

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
secrets: inherit
206206
strategy:
207207
fail-fast: false
208-
max-parallel: 2
208+
max-parallel: 1
209209
matrix:
210210
unreal: ['5.4', '5.5', '5.6', '5.7']
211211
uses: ./.github/workflows/integration-test-android.yml

integration-test/Integration.Android.Tests.ps1

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,19 @@ Describe 'Sentry Unreal Android Integration Tests (<Platform>)' -ForEach $TestTa
170170
BeforeAll {
171171
# Crash event is sent during the MESSAGE run (Run 2)
172172
# But the crash_id comes from the CRASH run (Run 1)
173-
$CrashResult = $global:AndroidCrashResult
174-
$CrashEvent = $null
173+
$script:CrashResult = $global:AndroidCrashResult
174+
$script:CrashEvent = $null
175175

176176
# Parse crash event ID from crash run output
177-
$eventIds = Get-EventIds -AppOutput $CrashResult.Output -ExpectedCount 1
177+
$eventIds = Get-EventIds -AppOutput $script:CrashResult.Output -ExpectedCount 1
178178

179179
if ($eventIds -and $eventIds.Count -gt 0) {
180180
Write-Host "Crash ID captured: $($eventIds[0])" -ForegroundColor Cyan
181181
$crashId = $eventIds[0]
182182

183183
# Fetch crash event using the tag (event was sent during message run)
184184
try {
185-
$CrashEvent = Get-SentryTestEvent -TagName 'test.crash_id' -TagValue "$crashId"
185+
$script:CrashEvent = Get-SentryTestEvent -TagName 'test.crash_id' -TagValue "$crashId"
186186
Write-Host "Crash event fetched from Sentry successfully" -ForegroundColor Green
187187
}
188188
catch {
@@ -195,60 +195,60 @@ Describe 'Sentry Unreal Android Integration Tests (<Platform>)' -ForEach $TestTa
195195
}
196196

197197
It "Should output event ID before crash" {
198-
$eventIds = Get-EventIds -AppOutput $CrashResult.Output -ExpectedCount 1
198+
$eventIds = Get-EventIds -AppOutput $script:CrashResult.Output -ExpectedCount 1
199199
$eventIds | Should -Not -BeNullOrEmpty
200200
$eventIds.Count | Should -Be 1
201201
}
202202

203203
It "Should capture crash event in Sentry (uploaded during next run)" {
204-
$CrashEvent | Should -Not -BeNullOrEmpty
204+
$script:CrashEvent | Should -Not -BeNullOrEmpty
205205
}
206206

207207
It "Should have correct event type and platform" {
208-
$CrashEvent.type | Should -Be 'error'
209-
$CrashEvent.platform | Should -Be 'native'
208+
$script:CrashEvent.type | Should -Be 'error'
209+
$script:CrashEvent.platform | Should -Be 'native'
210210
}
211211

212212
It "Should have exception information" {
213-
$CrashEvent.exception | Should -Not -BeNullOrEmpty
214-
$CrashEvent.exception.values | Should -Not -BeNullOrEmpty
213+
$script:CrashEvent.exception | Should -Not -BeNullOrEmpty
214+
$script:CrashEvent.exception.values | Should -Not -BeNullOrEmpty
215215
}
216216

217217
It "Should have stack trace" {
218-
$exception = $CrashEvent.exception.values[0]
218+
$exception = $script:CrashEvent.exception.values[0]
219219
$exception.stacktrace | Should -Not -BeNullOrEmpty
220220
$exception.stacktrace.frames | Should -Not -BeNullOrEmpty
221221
}
222222

223223
It "Should have user context" {
224-
$CrashEvent.user | Should -Not -BeNullOrEmpty
225-
$CrashEvent.user.username | Should -Be 'TestUser'
226-
$CrashEvent.user.email | Should -Be '[email protected]'
227-
$CrashEvent.user.id | Should -Be '12345'
224+
$script:CrashEvent.user | Should -Not -BeNullOrEmpty
225+
$script:CrashEvent.user.username | Should -Be 'TestUser'
226+
$script:CrashEvent.user.email | Should -Be '[email protected]'
227+
$script:CrashEvent.user.id | Should -Be '12345'
228228
}
229229

230230
It "Should have test.crash_id tag for correlation" {
231-
$tags = $CrashEvent.tags
231+
$tags = $script:CrashEvent.tags
232232
$crashIdTag = $tags | Where-Object { $_.key -eq 'test.crash_id' }
233233
$crashIdTag | Should -Not -BeNullOrEmpty
234234
$crashIdTag.value | Should -Not -BeNullOrEmpty
235235
}
236236

237237
It "Should have integration test tag" {
238-
$tags = $CrashEvent.tags
238+
$tags = $script:CrashEvent.tags
239239
($tags | Where-Object { $_.key -eq 'test.suite' }).value | Should -Be 'integration'
240240
}
241241

242242
It "Should have breadcrumbs from before crash" {
243-
$CrashEvent.breadcrumbs | Should -Not -BeNullOrEmpty
244-
$CrashEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
243+
$script:CrashEvent.breadcrumbs | Should -Not -BeNullOrEmpty
244+
$script:CrashEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
245245
}
246246
}
247247

248248
Context "Message Capture Tests" {
249249
BeforeAll {
250-
$MessageResult = $global:AndroidMessageResult
251-
$MessageEvent = $null
250+
$script:MessageResult = $global:AndroidMessageResult
251+
$script:MessageEvent = $null
252252

253253
# Parse event ID from output
254254
$eventIds = Get-EventIds -AppOutput $MessageResult.Output -ExpectedCount 1
@@ -258,7 +258,7 @@ Describe 'Sentry Unreal Android Integration Tests (<Platform>)' -ForEach $TestTa
258258

259259
# Fetch event from Sentry (with polling)
260260
try {
261-
$MessageEvent = Get-SentryTestEvent -EventId $eventIds[0]
261+
$script:MessageEvent = Get-SentryTestEvent -EventId $eventIds[0]
262262
Write-Host "Message event fetched from Sentry successfully" -ForegroundColor Green
263263
}
264264
catch {
@@ -283,32 +283,32 @@ Describe 'Sentry Unreal Android Integration Tests (<Platform>)' -ForEach $TestTa
283283
}
284284

285285
It "Should capture message event in Sentry" {
286-
$MessageEvent | Should -Not -BeNullOrEmpty
286+
$script:MessageEvent | Should -Not -BeNullOrEmpty
287287
}
288288

289289
It "Should have correct platform" {
290290
# Android events are captured from Java layer, so platform is 'java' not 'native'
291-
$MessageEvent.platform | Should -Be 'java'
291+
$script:MessageEvent.platform | Should -Be 'java'
292292
}
293293

294294
It "Should have message content" {
295-
$MessageEvent.message | Should -Not -BeNullOrEmpty
296-
$MessageEvent.message.formatted | Should -Match 'Integration test message'
295+
$script:MessageEvent.message | Should -Not -BeNullOrEmpty
296+
$script:MessageEvent.message.formatted | Should -Match 'Integration test message'
297297
}
298298

299299
It "Should have user context" {
300-
$MessageEvent.user | Should -Not -BeNullOrEmpty
301-
$MessageEvent.user.username | Should -Be 'TestUser'
300+
$script:MessageEvent.user | Should -Not -BeNullOrEmpty
301+
$script:MessageEvent.user.username | Should -Be 'TestUser'
302302
}
303303

304304
It "Should have integration test tag" {
305-
$tags = $MessageEvent.tags
305+
$tags = $script:MessageEvent.tags
306306
($tags | Where-Object { $_.key -eq 'test.suite' }).value | Should -Be 'integration'
307307
}
308308

309309
It "Should have breadcrumbs" {
310-
$MessageEvent.breadcrumbs | Should -Not -BeNullOrEmpty
311-
$MessageEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
310+
$script:MessageEvent.breadcrumbs | Should -Not -BeNullOrEmpty
311+
$script:MessageEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
312312
}
313313
}
314314
}

0 commit comments

Comments
 (0)