Modern Apps git

← Modern-Apps.git

library/work: document the real verify tasks and pin a deterministic fixture

Commit
141f7245f8c2bd15a30774b043b2a8922e2cd911
Author
Vayun Mathur <[email protected]>
When
2026-12-01 10:13 UTC (5 days ago)
Parents
4219bfc
The documented :library:work:compileDevKotlin task does not
exist for library modules; the verify section now names
compileDebugKotlin plus testDebugUnitTest. WorkHelpersTest
used UUID.randomUUID() for an unasserted carrier value,
violating the deterministic-fixture rule; it now uses a
fixed UUID constant. No behaviour change. Verified:
:library:work:testDebugUnitTest 8 tests pass; lint no
issues; detekt 0 findings.

Diff

library/work/AGENTS.md
diff --git a/library/work/AGENTS.md b/library/work/AGENTS.mdindex ae10bb7d41..d09d4bea0c 100644--- a/library/work/AGENTS.md+++ b/library/work/AGENTS.md@@ -21,6 +21,7 @@  ## Verify (this module only) ```-./gradlew :library:work:compileDevKotlin+./gradlew :library:work:compileDebugKotlin+./gradlew :library:work:testDebugUnitTest ./gradlew :library:work:lint ```
library/work/src/test/java/com/vayunmathur/library/work/WorkHelpersTest.kt
diff --git a/library/work/src/test/java/com/vayunmathur/library/work/WorkHelpersTest.kt b/library/work/src/test/java/com/vayunmathur/library/work/WorkHelpersTest.ktindex 2c56110d88..58988ee219 100644--- a/library/work/src/test/java/com/vayunmathur/library/work/WorkHelpersTest.kt+++ b/library/work/src/test/java/com/vayunmathur/library/work/WorkHelpersTest.kt@@ -1,5 +1,6 @@ package com.vayunmathur.library.work + import android.app.Application import android.app.NotificationManager import android.content.Context@@ -29,6 +30,9 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.Shadows.shadowOf +/** Fixed worker id: the value is never asserted, only carried through. */+private val FIXED_WORKER_ID: java.util.UUID = java.util.UUID.fromString("123e4567-e89b-12d3-a456-426614174000")+ /** A worker class used only as the reified type parameter of [startRepeatedTask]. */ class SampleWorker(context: Context, params: WorkerParameters) : CoroutineWorker(context, params) {     override suspend fun doWork(): Result = Result.success()@@ -118,7 +122,7 @@ class WorkHelpersTest {     }      private fun workerParams(input: androidx.work.Data): WorkerParameters = WorkerParameters(-        UUID.randomUUID(),+        FIXED_WORKER_ID,         input,         emptyList(),         WorkerParameters.RuntimeExtras(),