Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
[ID: 558956]
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
In trying to sethttps://developer.android.com/training/testing/local-tests#error in agp-kmp I have found it does not prevent the reported test errors.
unitTests.returnDefaultValues = true
as perIn normal AGP, you set this on
UnitTestOptions
through aCommonExtension
. I believe in AGP-KMP, you are supposed to set this directly onKotlinMultiplatformAndroidTestOnJvm
. However, I have tried settingin both
build.gradle
andbuildSrc
(where I can watch it be applied in the debugger) and it doesn't appear to fix the issue.This problem is observed when applying the diff in this file to androidx, and running
:compose:runtime:runtime:testAndroidTestOnJvm
.My best guess is that
isReturnDefaultValues
is not propagating properly at some point? As mentioned in chat, there are apparently no tests for this case.Perhaps related is that , and privately in ?
returnDefaultValues
appears to be defined in two places, publicly in DSL inKotlinMultiplatformAndroidTestOnJvm
KmpUnitTestOptionsDslInfoImpl
The simplest workaround would normally be to add
robolectric
to theandroidUnitTest
sourceSet and tests in question, but in the case I've been looking at (compose-runtime
) several of the tests are defined at thecommon
level, and we can't add the robolectric test runner in a non-jvmcommon
sourceSet.