Run Android Junit
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với shared/src/androidTest/kotlin/com/jetbrains/kmm/shared/androidTest.kt và kiểm tra thiết lập kiểm thử Android cùng các tác vụ Gradle được tạo. Chạy ./gradlew :shared:tasks và so sánh các tác vụ unit-test và connected-test hiện có với hành vi Android JUnit mong đợi. Được xem là hoàn tất khi các kiểm thử Android của shared được nhận diện và chạy trên JVM thông qua cấu hình JUnit thay vì trên thiết bị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Kotlin
- Star
- 1.1k
- Fork
- 203
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Kotlin/kmp-basic-sample
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Kotlin/kmp-basic-sample#84 ·
-
Support for webĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Kotlin/kmp-basic-sample#82 ·
-
Memory Issue on iOS platform.Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Kotlin/kmp-basic-sample#81 ·
-
ERROR when build in iosĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Kotlin/kmp-basic-sample#75 ·
-
Start using version catalogsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Kotlin/kmp-basic-sample#71 ·
Tất cả issue của Kotlin/kmp-basic-sample
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mobile-dev-inc/Maestro#3646 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GetStream/stream-chat-android#6762 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SimonHalvdansson/Harmonic-HN#363 ·