2026-03-10 12:29:47 -05:00
# Testing and CI Playbook
Use this matrix to choose the right verification depth for a change.
## 1) Baseline local verification order
Run in this order for routine changes:
```bash
./gradlew clean
./gradlew spotlessCheck
./gradlew spotlessApply
./gradlew detekt
./gradlew assembleDebug
./gradlew test
```
Notes:
- This order aligns with repository guidance in `AGENTS.md` and `.github/copilot-instructions.md` .
2026-03-17 15:35:39 -05:00
- CI runs host verification and Android build/device verification in separate jobs inside `.github/workflows/reusable-check.yml` .
2026-03-10 12:29:47 -05:00
## 2) Change-type matrix
- `docs-only` changes:
- Usually no Gradle run required.
- If you touched code examples or command docs, at least run `spotlessCheck` if practical.
2026-03-12 21:23:25 -05:00
- If you changed architecture, CI, validation commands, or agent workflow guidance, update the mirrored docs in `AGENTS.md` , `.github/copilot-instructions.md` , `GEMINI.md` , and `docs/kmp-status.md` in the same slice.
2026-03-10 12:29:47 -05:00
- `UI text/resource` changes:
- `spotlessCheck` , `detekt` , `assembleDebug` .
- `feature/commonMain logic` changes:
- `spotlessCheck` , `detekt` , `test` , `assembleDebug` .
- `navigation/DI wiring` changes (app graph, Koin module/wrapper changes):
2026-03-31 16:25:37 -05:00
- `spotlessCheck` , `detekt` , `assembleDebug` , `test` , plus `testFdroidDebugUnitTest` and `testGoogleDebugUnitTest` when available locally.
- If touching any KMP module, also run `kmpSmokeCompile` .
2026-03-10 12:29:47 -05:00
- `worker/service/background` changes:
- `spotlessCheck` , `detekt` , `assembleDebug` , `test` , and targeted tests around WorkManager/service behavior.
- `BLE/networking/core repository` changes:
- `spotlessCheck` , `detekt` , `assembleDebug` , `test` .
## 3) Flavor and instrumentation checks
Run these when relevant to map/provider/flavor-specific behavior:
```bash
./gradlew lintFdroidDebug lintGoogleDebug
./gradlew testFdroidDebug
./gradlew testGoogleDebug
./gradlew connectedAndroidTest
```
## 4) CI parity checks
Current reusable check workflow includes:
- `spotlessCheck detekt`
2026-03-17 15:35:39 -05:00
- Android lint for all directly runnable Android modules:
`app:lintFdroidDebug app:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug mesh_service_example:lintDebug`
2026-04-01 15:21:25 -05:00
*(Note: `mesh_service_example:lintDebug` is temporary — the module is deprecated and will be
removed along with its CI tasks in a future release.)*
2026-03-17 15:35:39 -05:00
- Host tests plus coverage aggregation:
2026-03-21 11:54:17 -05:00
`test koverXmlReport app:koverXmlReportFdroidDebug app:koverXmlReportGoogleDebug core:api:koverXmlReportDebug core:barcode:koverXmlReportFdroidDebug core:barcode:koverXmlReportGoogleDebug mesh_service_example:koverXmlReportDebug desktop:koverXmlReport`
2026-04-01 15:21:25 -05:00
*(Note: `mesh_service_example:koverXmlReportDebug` is temporary — see above.)*
2026-03-31 16:25:37 -05:00
- KMP smoke compile lifecycle task (auto-discovers KMP modules and runs JVM + iOS simulator compile checks):
`kmpSmokeCompile`
2026-03-17 15:35:39 -05:00
- Android build tasks:
`app:assembleFdroidDebug app:assembleGoogleDebug mesh_service_example:assembleDebug`
2026-04-01 15:21:25 -05:00
*(Note: `mesh_service_example:assembleDebug` is temporary — see above.)*
2026-03-17 15:35:39 -05:00
- Instrumented tests (when emulator tests are enabled):
`app:connectedFdroidDebugAndroidTest app:connectedGoogleDebugAndroidTest core:barcode:connectedFdroidDebugAndroidTest core:barcode:connectedGoogleDebugAndroidTest`
- Coverage uploads happen once from the host job; instrumented test results upload once from the first Android matrix API to avoid duplicate reporting.
2026-03-10 12:29:47 -05:00
Reference: `.github/workflows/reusable-check.yml`
PR workflow note:
2026-03-17 15:35:39 -05:00
- `.github/workflows/pull-request.yml` ignores docs-only changes (`**/*.md` , `docs/**` ), so doc-only PRs may skip Android CI by design.
2026-04-01 15:21:25 -05:00
- PR change detection includes workflow/build/config paths such as `.github/workflows/**` , `desktop/**` , `mesh_service_example/**` (deprecated, will be removed), `config/**` , `gradle/**` , `settings.gradle.kts` , and `test.gradle.kts` .
2026-03-17 15:35:39 -05:00
- Android CI on PRs runs with `run_instrumented_tests: false` ; merge queue keeps the full emulator matrix on API 26 and 35.
- Gradle cache writes are enabled for trusted refs/events (`main` , `merge_group` , and `gh-readonly-queue/*` ); other refs run in read-only cache mode.
2026-03-10 12:29:47 -05:00
## 5) Practical guidance for agents
- Start with the smallest set that validates your touched area.
2026-03-12 21:23:25 -05:00
- Keep documentation continuously in sync with architecture, CI, and workflow changes; do not defer doc fixes to a later PR.
2026-03-10 12:29:47 -05:00
- If modifying cross-module contracts (routes, repository interfaces, DI graph), run the broader baseline.
- If unable to run full validation locally, report exactly what ran and what remains.