Fixed
Status Update
Comments
sp...@google.com <sp...@google.com>
sp...@google.com <sp...@google.com> #2
an...@google.com <an...@google.com> #3
For Android-imposed version restrictions we should override that using AndroidLanguageFeatureProvider (and if the feature provider scheme isn't supported for a particular inspection, upstreaming a patch to add that).
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.