:core:testing
July 21, 2026 · View on GitHub
Purpose
Owns shared JVM test fixtures, dispatcher helpers, and architecture guards used by core and feature modules. It is a test-support module and is not shipped in the app APK.
Public API
MainDispatcherExtensioninstalls a test main dispatcher for a test scope.TestFixturesprovides minimal podcast and episode builders.- Test dependencies such as JUnit Jupiter, coroutines-test, Turbine, and MockWebServer are exposed for modules that declare
testImplementation(projects.core.testing). - Architecture guards under
src/testvalidate project structure and dependency rules.
Internal structure
src/main/java/cx/aswin/boxlore/core/testing/
MainDispatcherExtension.kt
TestFixtures.kt
src/test/java/cx/aswin/boxlore/core/testing/architecture/
ArchitectureGuardTest.kt
GlossaryCoverageGuardTest.kt # CSV ↔ AnalyticsGlossary ↔ emission inventory
Dependencies
- Project dependencies:
:core:model. - Libraries exposed for tests: JUnit Jupiter, coroutines-test, Turbine, and MockWebServer.
- Test-only libraries: Konsist.
- Reverse-edge rule: production modules may use this only from test configurations.
Threading / lifecycle
MainDispatcherExtensionswapsDispatchers.Mainfor the duration of each test and restores it afterward.- No Android application or activity lifecycle objects are owned here.
Persistence & identity
- No app persistence is owned here.
- Architecture tests read project files such as
settings.gradle.ktsand module README locations but do not define app storage identity.
Testing notes
- Run this module to execute architecture guards.
- Guards cover feature isolation, selected singleton allowlists, catalog-to-designsystem boundaries, direct database access restrictions, and README presence for included app/core/feature modules.
GlossaryCoverageGuardTestasserts everydocs/analytics/event_glossary.csvname is inAnalyticsGlossary, and every name has a row indocs/analytics/glossary_emission_coverage.csvwith modeemission:*,sdk_backed:*, orperson_props_only(opens/installs must not be dual-counted as custom emits).- Do not add
api(projects.core.analytics)here —:core:analyticsalreadytestImplementations this module (cycle risk). Emission suites live in:core:analytics.
./gradlew :core:testing:testDebugUnitTest
CI relevance
unit-tests.ymlruns the architecture guards with the root JVM suite.- The guards complement shell-based architecture checks under
scripts/ci.