-
Notifications
You must be signed in to change notification settings - Fork 181
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
Run Android Junit #59
Comments
As answered within the Android bug tracker, it seems to be a name conflict: AndroidTest is reserved for Instrumented Test by the Android plugin and cannot be used for Unit Test as all the other Platforms. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using this project as a base to understand how to run JUnit Android test within the shared Library: https://github.com/Kotlin/kmm-sample/blob/master/shared/src/androidTest/kotlin/com/jetbrains/kmm/shared/androidTest.kt
Cross-posting from Android Studio issue: https://issuetracker.google.com/issues/191287536
I'm not sure if it's a code issue (so a modification on this code base), or a IDE issue.
Goal: run with JUnit the tests with the Android configuration on the shared module.
Issue: the junit test folder is not recognized as such with Android, it seems to be override by an Android Connected test.
Symptoms:
1- "No Task Available"
by right-click on the folder, clicking on "Run test", it creates a configuration that does not work.
The issue seems to be that Android Studio doesn't recognised "kotlin" as a valid language for testing. By renaming the folder "kotlin" within the test to "java", it is now possible to run it.
2- Test run on device, not on JUnit
By trying to manually setup a JUnit configuration, the module Android Test does not appear.
By running the CLI "./gradlew :shared:tasks", I am missing some configurations (it should contains "androidTest" - Executes unit tests for target Android.):
The text was updated successfully, but these errors were encountered: