WIP: Tests for the android-release-symbols branch #4227
+55
−7
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.
Tests to complete #4221:
Ideally we'd find a way to test this properly, since it snuck through our existing tests. I spent some time investigating a way to use the bundletool to split the AAB into device specific APKs (mimicking what happens when installing the app on a device)... and this might work but there are some subtleties/complexities.
When our current tests are running on an actual Android Device, they just get an Assembly Reader for the currently running application:
sentry-dotnet/test/Sentry.Android.AssemblyReader.Tests/AndroidAssemblyReaderTests.cs
Lines 26 to 29 in 13d4a9f
I would expect, for a release build, that we would see the behaviour we see when running Sentry.Samples.Maui to a simulator in release mode... but we don't. So I'm guessing xharness takes some shortcuts or hosts the test app slightly differently. At the very least then, if we built some tests like this (using split APKs from the bundletool) we'd have to disable them when running on an Android device.
Also the bundle tool outputs a single
*.apks
file (APK Set). It's basically a zip and we can unpack it and it contains three files:toc.pb
splits/base-master.apk
splits/base-x86_64.apk
Curiously, these are not named
base.apk
andsplit_config.x86_64.apk
... which is what I'm seeing when an app is actually installed on a device/simulator.All in all, I wasn't building a lot of confidence that the tests were going to be useful... but this PR contains the preliminary work - build targets that use the bundletool to split the APKs.
#skip-changelog