-
-
Notifications
You must be signed in to change notification settings - Fork 12
test: Android end-to-end integration tests #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
limbonaut
wants to merge
34
commits into
main
Choose a base branch
from
test/android-end-to-end
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2f19d0a
Enable scope sync on Android
limbonaut ea54a49
Adapt Invoke routine for Android
limbonaut 5f24911
Add delay before crash capture and disable debug mode
limbonaut 8a496be
Fix platform checks in common tests
limbonaut 4aa4a56
Skip exit code check on Android platform
limbonaut 36616a7
Skip threads check on Android platform
limbonaut 26a4a0f
More lenient stack frame regex matching
limbonaut d3a34e2
Use TestSetup.Platform for OS tag validation
limbonaut 4e91fb7
Skip app context check for Android crashes
limbonaut 89ffaca
Remove device context memory and arch assertions
limbonaut 0d60346
Skip Godot context tests on Android crashes
limbonaut 9ea85f3
Work around intent issues
limbonaut de3b009
Bump app-runner
limbonaut 36287f7
Fix check
limbonaut c1aad1d
Ensure SDK has time to flush events before the CLI process exits
limbonaut 1a14348
Fix FRAME tests on Android
limbonaut 987ca71
Simplify condition
limbonaut 79c8201
Update stack trace frame regex pattern to be more specific
limbonaut 702289b
Fix Android platform detection
limbonaut d97a28e
Add Sauce Labs credentials and Android testing support
limbonaut be5d3de
Bump app-runner
limbonaut 17d768c
Fix Android platform matching
limbonaut 79c07ff
Refactor tests to use helpers
limbonaut 6da6ad3
Add export step for Android test builds on SauceLabs
limbonaut 4070c43
Disconnect device after all tests
limbonaut ddd62e7
Fix name
limbonaut 56c9e27
Ignore import errors
limbonaut 317bb47
Add --disable-crash-handler flag to export
limbonaut 3bd3630
Clarify comment
limbonaut 3107153
Update CONTRIBUTING
limbonaut ddd0285
Use any S23 device
limbonaut bd73bb3
Standardize common test case parameters
limbonaut 69664b9
Improve comments and fix quote handling in Android extras
limbonaut beadc75
Corrections
limbonaut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,128 +2,149 @@ | |
| # and behaviors across different test suites for consistent integration testing. | ||
| # | ||
| # Available parameters: | ||
| # - $SentryEvent: The Sentry event object retrieved from the REST API containing error/message details | ||
| # - $TestSetup: Object containing test setup parameters | ||
| # - $TestType: String indicating the type of test being run (e.g., "crash-capture", "message-capture") | ||
| # - $SentryEvent: The Sentry event object retrieved from the REST API containing error/message details | ||
| # - $RunResult: Object containing the results of running the test application, including Output and ExitCode | ||
|
|
||
| $CommonTestCases = @( | ||
| @{ Name = "Outputs event ID"; TestBlock = { | ||
| param($RunResult) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $eventId = Get-EventIds -appOutput $RunResult.Output -expectedCount 1 | ||
| $eventId | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Captures event in sentry.io"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Has title"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.title | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Has correct release version"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.release.version | Should -Be "[email protected]" | ||
| } | ||
| } | ||
| @{ Name = "Has correct platform"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.platform | Should -Not -BeNullOrEmpty | ||
| if ($IsLinux -or $IsWindows) { | ||
| $SentryEvent.platform | Should -Be "native" | ||
| } elseif ($IsMacOS) { | ||
| $SentryEvent.platform | Should -Be "cocoa" | ||
|
|
||
| $expectedPlatform = @{ | ||
| "Windows" = "native" | ||
| "Linux" = "native" | ||
| "macOS" = "cocoa" | ||
| } | ||
|
|
||
| if ($expectedPlatform.ContainsKey($TestSetup.Platform)) { | ||
| $SentryEvent.platform | Should -Be $expectedPlatform[$TestSetup.Platform] | ||
| } | ||
| } | ||
| } | ||
| @{ Name = "Has correct dist attribute"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.dist | Should -Be "test-dist" | ||
| } | ||
| } | ||
| @{ Name = "Has tags"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.tags | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Has correct integration test tags"; TestBlock = { | ||
| param($SentryEvent, $TestType) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| ($SentryEvent.tags | Where-Object { $_.key -eq "test.suite" }).value | Should -Be "integration" | ||
| ($SentryEvent.tags | Where-Object { $_.key -eq "test.type" }).value | Should -Be $TestType | ||
| } | ||
| } | ||
| @{ Name = "Has correct environment tag"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| ($SentryEvent.tags | Where-Object { $_.key -eq "environment" }).value | Should -Be "integration-test" | ||
| } | ||
| } | ||
| @{ Name = "Has correct OS tag"; TestBlock = { | ||
| param($SentryEvent) | ||
| if ($IsLinux) { | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| if ($TestSetup.Platform -ieq "Linux") { | ||
| $expectedOS = "Linux" | ||
| } elseif ($IsMacOS) { | ||
| } elseif ($TestSetup.Platform -ieq "macOS") { | ||
| $expectedOS = "macOS" | ||
| } else { | ||
| } elseif ($TestSetup.Platform -ieq "Windows") { | ||
| $expectedOS = "Windows" | ||
| } elseif ($TestSetup.IsAndroid) { | ||
| $expectedOS = "Android" | ||
| } elseif ($TestSetup.Platform -match "iOS") { | ||
| $expectedOS = "iOS" | ||
limbonaut marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| ($SentryEvent.tags | Where-Object { $_.key -eq "os" }).value | Should -Match $expectedOS | ||
| } | ||
| } | ||
| @{ Name = "Contains user information"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.user | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.user.username | Should -Be "TestUser" | ||
| $SentryEvent.user.email | Should -Be "[email protected]" | ||
| $SentryEvent.user.id | Should -Be "12345" | ||
| } | ||
| } | ||
| @{ Name = "Contains breadcrumbs"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.breadcrumbs | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains expected breadcrumbs"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Integration test started" } | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Context configuration finished" } | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains SDK information"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.sdk | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.sdk.name | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.sdk.version | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains app context"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
|
|
||
| if ($TestSetup.IsAndroid -and $TestType -eq "crash-capture") { | ||
| # Skip app context check for Android crashes | ||
| # Q: Bug? | ||
| return | ||
| } | ||
|
|
||
| $SentryEvent.contexts.app | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.app.app_name | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.app.app_version | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains device context"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.contexts.device | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.device.arch | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.device.free_memory | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.device.usable_memory | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains OS context"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
| $SentryEvent.contexts.os | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.os.os | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.os.name | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.os.version | Should -Not -BeNullOrEmpty | ||
| } | ||
| } | ||
| @{ Name = "Contains Godot contexts"; TestBlock = { | ||
| param($SentryEvent) | ||
| param($TestSetup, $TestType, $SentryEvent, $RunResult) | ||
|
|
||
| if ($TestSetup.IsAndroid -and $TestType -eq "crash-capture") { | ||
| # Skip Godot context tests for Android crashes | ||
| # NOTE: Contexts don't seem to be synchronized to NDK. Bug? | ||
| return | ||
| } | ||
|
|
||
| $SentryEvent.contexts.godot_engine | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.godot_engine.version | Should -Not -BeNullOrEmpty | ||
| $SentryEvent.contexts.godot_engine.version_commit | Should -Not -BeNullOrEmpty | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.