1.7.1: build modernization, Kover coverage gate, Job-returning async API#8
Merged
Conversation
…est coverage
Build & tooling
- Make gradle/libs.versions.toml use version.ref consistently (all versions
declared at the top)
- Migrate to AGP 9 new DSL: configure<ApplicationExtension>/<LibraryExtension>
and move the kotlin {} block to top level
- Drop deprecated gradle.properties flags now defaulted in AGP 9
(newDsl, resvalues, enableAppCompileTimeRClass, usesSdkInManifest.disallowed,
r8.optimizedResourceShrinking, sdk.defaultTargetSdkToCompileSdkIfUnset)
- Bump Gradle wrapper 9.4.1 -> 9.5.0
Coverage
- Add Kover, aggregating :PrefsHelper into :app (where the tests live), with a
report filter focusing the metric on the library
Library
- BaseDataStoreHelper.writeXxxAsync (+ removeKeyAsync / writeValueAsync) now
return the Job so callers can join() to await fire-and-forget writes
- Use the kotlin.time Duration API for withTimeoutOrNull
Tests
- Backfill property-delegate coverage on both helpers (long/boolean/double/date/
temporal/nullable string + enum) and *WithDefault read coverage on DataStore
- Replace racy fixed delays with deterministic awaits (join() for direct async
writes, value/flow polling for delegate writes)
- Duration API for delay/withTimeout, joinAll() for concurrent writes
Docs
- Fix CLAUDE.md test commands to target :app and document the Kover report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…overage gate
Kover can't instrument on-device tests, so the instrumented BaseDataStoreHelperTest
contributed ~0% to coverage — making an aggregate koverVerify floor impossible.
Move it to the JVM under Robolectric so Kover measures both helpers.
- Move BaseDataStoreHelperTest androidTest -> test; it runs under Robolectric via
the AndroidJUnit4 delegating runner (no test changes needed). No emulator now.
- Pin Robolectric SDK to 36 (targetSdk 37 has no image yet) via robolectric.properties
- app: enable unitTests.isIncludeAndroidResources, add Robolectric + ext-junit as
testImplementation, drop the now-dead androidTest/compose-test deps, and revert the
pointless enableAndroidTestCoverage flag
- Add Kover coverage floor: reports.verify minBound(70), scoped to com.duck.prefshelper.*
(the sample app's consumer prefs aren't the code under test)
- Make the flow-emits tests deterministic: confirm the write landed via awaitValue,
then assert the flow's emission, instead of a racy withTimeout(flow.first{})
- Remove orphaned compose-ui-test-* catalog entries
- CI: .github/workflows/ci.yml runs :app:testDebugUnitTest + koverVerifyDebug on a
plain ubuntu runner (no emulator) on PRs to master and pushes to master
- Docs: update CLAUDE.md test/coverage commands and add a gotcha explaining the
Robolectric/Kover rationale
Verified locally: 166/166 tests pass, koverVerifyDebug green at 76.5% line coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the nullable longPref/doublePref/booleanPref/enumPref delegate overloads on BaseDataStoreHelper, which had no test exercising them (the harness only declared the non-null variants). Each: round-trip + null-removal, asserted via awaitValue. Library line coverage 76.5% -> 82.6% (koverVerifyDebug floor remains 70). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release prep for 1.7.1. Three commits — build/tooling modernization, a real CI coverage gate, and a small library API addition. Validated locally: 174 tests pass,
koverVerifyDebuggreen at 82.6% line coverage (floor 70).Build & tooling
libs.versions.tomlnow usesversion.refconsistently (all versions declared at the top)configure<ApplicationExtension>/<LibraryExtension>,kotlin {}moved to top levelgradle.propertiesflags now defaulted in AGP 9 (newDsl,resvalues,enableAppCompileTimeRClass,usesSdkInManifest.disallowed,r8.optimizedResourceShrinking,sdk.defaultTargetSdkToCompileSdkIfUnset)Library
BaseDataStoreHelper.writeXxxAsync(+removeKeyAsync/writeValueAsync) now return theJobso callers can.join()to await fire-and-forget writes. Delegate setters still discard it (property setters returnUnit).kotlin.timeDurationAPI forwithTimeoutOrNullTests & coverage
com.duck.prefshelper.*, aggregated into:app(where the tests live), with akoverVerifyfloor ofminBound(70)BaseDataStoreHelperTestto the JVM under Robolectric (androidTest → test). Kover can't instrument on-device tests, so this is what makes the coverage gate meaningful — and it drops the emulator requirement entirely. Robolectric SDK pinned to 36 (targetSdk 37has no image yet).*WithDefaultread coveragedelays with deterministic awaits (.join()for direct async writes;awaitValuepolling for delegate writes)CI / merge gate
.github/workflows/ci.yml—Tests & coverage gatejob runs:app:testDebugUnitTest :app:koverXmlReportDebug :app:koverVerifyDebugon a plainubuntu-latestrunner (no emulator), on PRs tomasterand pushes tomastermasterbranch protection now requires this check to pass before mergeDocs
CLAUDE.md: corrected test/coverage commands (all JVM now), added a gotcha explaining the Robolectric/Kover rationaleREADME.mdreviewed — still accurate (delegate-first), no changes needed🤖 Generated with Claude Code