Run Android Junit
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Empieza con shared/src/androidTest/kotlin/com/jetbrains/kmm/shared/androidTest.kt e inspecciona la configuración de pruebas de Android y las tareas de Gradle generadas. Ejecuta ./gradlew :shared:tasks y compara las tareas unit-test y connected-test disponibles con el comportamiento esperado de Android JUnit. Se considera terminado cuando las pruebas de Android de shared se reconocen y se ejecutan en la JVM mediante una configuración de JUnit, en lugar de en un dispositivo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- when started the test, it will try to run it by starting the emulator. It should instead run it on the JVM like any other android JUnit test. It's because the "Run/Debug configuration" is using a "Android Instrumented Tests" instead of "JUnit" configuration.
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.):
Verification tasks
------------------
allTests - Runs the tests for all targets and create aggregated report
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
iosX64Test - Executes Kotlin/Native unit tests for target iosX64.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
Build: AI-203.7717.56.2031.7435690, 202106072248,
AI-203.7717.56.2031.7435690, JRE 11.0.10+0-b96-7281165x64 JetBrains s.r.o., OS Mac OS X(x86_64) v11.2.3, screens 3584.0x2240.0; Retina
AS: Arctic Fox | 2020.3.1 Beta 4; Kotlin plugin: 203-1.5.10-release-891-AS7717.8; Android Gradle Plugin: 4.0.1; Gradle: 6.5; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
- Lenguaje dominante
- Kotlin
- Estrellas
- 1.1k
- Forks
- 204
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kotlin/kmp-basic-sample
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Kotlin/kmp-basic-sample#84 ·
-
Support for webAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Kotlin/kmp-basic-sample#82 ·
-
Memory Issue on iOS platform.Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Kotlin/kmp-basic-sample#81 ·
-
ERROR when build in iosAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Kotlin/kmp-basic-sample#75 ·
-
Start using version catalogsAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Kotlin/kmp-basic-sample#71 ·
Todos los issues de Kotlin/kmp-basic-sample
Issues similares
-
Meta request
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
keiyoushi/extensions-source#19500 ·
Los mantenedores suelen responder en 1 día
-
go 🏃 testing 🧪
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
valkey-io/valkey-glide#7239 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ethereum-lists/chains#8788 ·
Los mantenedores suelen responder en 1 día
-
documentation P1
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/kotlin-sdk#1050 ·
Los mantenedores suelen responder en 2 días