2026-03-12 21:23:25 -05:00
<!--
- Copyright (c) 2026 Meshtastic LLC
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see < https: // www . gnu . org / licenses /> .
-->
2026-04-01 07:14:26 -05:00
# Decision: Testing Consolidation — `core:testing` Module
2026-03-12 21:23:25 -05:00
**Date:** 2026-03-11
**Status:** Implemented
2026-04-01 07:14:26 -05:00
## Context
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
Each KMP module independently declared scattered test dependencies (`junit` , `mockk` , `coroutines-test` , `turbine` ), leading to version drift and duplicated test doubles across modules.
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
## Decision
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
Created `core:testing` as a lightweight shared module for test doubles, fakes, and utilities. It depends only on `core:model` and `core:repository` (no heavy deps like `core:database` ). All modules declare `implementation(projects.core.testing)` in `commonTest` to get a unified test dependency set.
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
## Consequences
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
- **Single source** for test fakes (`FakeRadioController` , `FakeNodeRepository` , `TestDataFactory` )
- **Clean dependency graph** — `core:testing` is lightweight; heavy modules depend on it in test scope, not vice versa
- **No production leakage** — only declared in `commonTest` , never in release artifacts
- **Reduced maintenance** — updating test libraries touches one `build.gradle.kts`
2026-03-12 21:23:25 -05:00
2026-04-01 07:14:26 -05:00
See [`core/testing/README.md` ](../../core/testing/README.md ) for usage guide and API reference.