-
-
Notifications
You must be signed in to change notification settings - Fork 55
fix: Android device crash tests #2098
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
Conversation
$ApkFileName = "test.apk" | ||
$ProcessName = "com.DefaultCompany.$(GetNewProjectName)" | ||
|
||
if ($Action -eq "Build") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're no longer building with this script. Building happens in https://github.com/getsentry/sentry-unity/blob/main/.github/workflows/android-smoke-test-build.yml
$TestActivityName = "$ProcessName/com.unity3d.player.UnityPlayerActivity" | ||
$FallBackTestActivityName = "$ProcessName/com.unity3d.player.UnityPlayerGameActivity" | ||
|
||
$_ArtifactsPath = ((Test-Path env:ARTIFACTS_PATH) ? $env:ARTIFACTS_PATH : "./$BuildDir/../test-artifacts/") ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mixing relative paths ./
with absolute paths $BuildDir
. Using Join-Path
to resolve this.
# For crash tests, we expect to see a native crash log "terminating with uncaught exception of type char const*". | ||
if (($newLogs | Select-String "SmokeTester is quitting.") -or ($newLogs | Select-String "terminating with uncaught exception of type char const*")) | ||
# For crash tests, we're checking for `sentry-native` logging "crash has been captured" to reliably inform when tests finished running. | ||
if (($newLogs | Select-String "SmokeTester is quitting.") -or ($newLogs | Select-String "crash has been captured")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a log we control (from within sentry-native
) so it won't change with different versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole script is a utility script to run the scripts used by CI locally.
Remove-Item -Path $(GetNewProjectBuildPath) -Recurse -Force -Confirm:$false | ||
|
||
./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$UnityPath" -UnityVersion $UnityVersion -Platform $Platform | ||
& "./scripts/smoke-test-$($Platform -eq 'iOS' ? 'ios' : 'android').ps1" Build -IsIntegrationTest -UnityVersion $UnityVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need the Android stuff here anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That script gluing all the scripts together and letting us "run CI locally".
And no, we're not exporting the Gradle project to manually build it on a different runner. We're relying on the Android Dev environment Unity comes with.
Fixes
I'm not exactly sure when or with which version this changes but the crash log switches between
and
Replacing the
with
withdue to
.Instead of relying on the exact wording from the logs from somewhere within Unity, we're relying on the ones from
sentry-native
(so we can blame ourselves if this breaks in the future).Cleanup
With the separation into workflows in #1989 we're also no longer exporting a Gradle project that we're then building in a dedicated step. The
IsIntegrationTest
is a remnant from there.#skip-changelog.