Repository navigation
Conversation
Code Coverage
|
Coverage (unit tests)Compared against
Line and branch coverage from unit test reports. History is recorded on the |
9f260d3 to
bab4d05
Compare
7741e9d to
b0fbce9
Compare
…ring and WmsTileOverlay
| tasks.withType<Test>().configureEach { | ||
| javaLauncher.set(javaToolchains.launcherFor { | ||
| languageVersion.set(JavaLanguageVersion.of(21)) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Could you elaborate on why do we need to force a Java 21 launcher for the tests? If the CI runners don't provide JDK 21 (or toolchain auto-provisioning isn't enabled), this could be what is breaking the build. Would it make sense to align it with the toolchain the rest of the project uses?
| testImplementation(libs.mockk) | ||
| testImplementation(libs.androidx.test.compose.ui) | ||
| testImplementation(libs.androidx.activity.compose) | ||
| testImplementation(libs.androidx.test.core) | ||
| testImplementation(libs.kotlinx.coroutines.test) |
There was a problem hiding this comment.
I can't see mockk or kotlinx-coroutines-test used in any of the new tests. Should we drop them until we actually need them?
| android:name="androidx.activity.ComponentActivity" | ||
| android:exported="true" /> | ||
| </application> | ||
| </manifest> |
There was a problem hiding this comment.
I wonder if we could avoid shipping a debug manifest in the library just for the tests. The androidx.compose.ui:ui-test-manifest artefact registers ComponentActivity for us. What do you think?
| assertThat(tileUrl).isEqualTo( | ||
| URL("https://example.com/wms?bbox=-${worldSize},0.0,0.0,${worldSize}&zoom=1") | ||
| ) |
There was a problem hiding this comment.
URL.equals() can do host name resolution, which makes this test depend on the network (see the note here). Shouldn't we favour comparing the string representation?
| assertThat(tileUrl).isEqualTo( | |
| URL("https://example.com/wms?bbox=-${worldSize},0.0,0.0,${worldSize}&zoom=1") | |
| ) | |
| assertThat(tileUrl?.toString()).isEqualTo( | |
| "https://example.com/wms?bbox=-${worldSize},0.0,0.0,${worldSize}&zoom=1" | |
| ) |
| import org.robolectric.RobolectricTestRunner | ||
| import org.robolectric.annotation.Config | ||
|
|
||
| // [START maps_compose_utils_clustering_test] |
There was a problem hiding this comment.
Just to understand it: are these [START ...]/[END ...] region tags meant to be pulled into some documentation? If not, I would remove them from the tests.
bab4d05 to
d74586e
Compare
b0fbce9 to
8b96198
Compare
Description
Stacked PR on top of #1003 (
feature/robolectric-widgets-tests), which stacks on #1001 (feature/robolectric-tests).Introduces comprehensive JVM unit and Compose integration tests for
maps-compose-utilsusing Robolectric and the local shadow library, raising module line coverage from 2.04% to 69.19% (instruction coverage from 0.78% to 64.11%). Across all three published library modules (maps-compose,maps-compose-widgets,maps-compose-utils), total JVM line coverage reaches 44.95%.Summary of Changes
robolectric,truth,mockk,androidx.test.compose.ui,maps.robolectric.shadows) tomaps-compose-utils/build.gradle.kts.ComponentActivityfor Robolectric Compose rule hosting.WmsTileOverlayTest.ktverifyingWmsTileOverlaycomposable rendering, tile overlay attributes (transparency, fade-in, visibility, z-index), and tile cache clearing.WmsUrlTileProviderTest.ktcovering valid URL formatting and malformed URL handling.ClusteringTest.ktcovering:ClusteringMarkerPropertiescomposition local propagation and mutation.Clusteringdefault renderer marker placement and manager callbacks.clusterContent,clusterItemContent,clusterItemDecoration).rememberClusterManagerandrememberClusterRendererlifecycle initialization.cc @LoyalAbbas @kikoso