-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Compose Compiler plugin update causing compose instrumented test to fail #736
Comments
I'm also seeing another test failing that's asserting Semantics tree on 4.5.1 (Test passes)
4.10.0 (Test fails)
|
Hey @devPalacio thanks for the detailed report, much appreciated. We'll take a look and follow up here. cc @markushi |
@devPalacio thanks for the detailed report, sorry to hear it's not working as expected. Just to confirm: Your Composables behave correctly when running on a device, it's "only" your test code which doesn't work as expected, right? |
Yea the composables don't seem to have any behavior change in app, just the node matching in tests has changed. I found a workaround for the second failing test I mentioned. I had to switch my matcher from |
One thing I'm noticing is the tree is not being trimmed as effectively with the newer version of Sentry. Things like zero height spacers seem to be preserved since they now have a SentryTag applied. With this deeper hierarchy, is there any concerns that performance of larger composables will be affected negatively? |
Gradle Version
8.7
AGP Version
8.5.0
Code Minifier/Optimizer
None
Version
4.10.0
Sentry SDK Version
7.12.0
Steps to Reproduce
I have a simple compose test that started failing when updating Sentry from 4.5.1/7.9.0 to the latest version. It's a fairly basic
AndroidComposeRule
test that renders a search bar composable with the test tagsearchbar
, and usinghasParent
asserts that it's focused. I believe this regression was introduced with the K2 compiler changes.A workaround I found is to use
hasAnyAncestor
but I'd like to understand why the tree changed and if it was intentional.Kotlin Version: 1.9.23
Compose BOM: 2024.05.00
Compose Compiler: 1.5.13
Expected Result
Test passes. Here's the semantic nodes of the passing test on 4.5.1/7.9.0
Actual Result
Here's the result on the latest Sentry versions
Test is failing with
The text was updated successfully, but these errors were encountered: