refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-23 20:31:48 -05:00 committed by GitHub
parent 664ebf218e
commit 96060a0a4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 621 additions and 182 deletions

View file

@ -58,6 +58,7 @@ import org.meshtastic.feature.widget.di.FeatureWidgetModule
includes =
[
org.meshtastic.app.MainKoinModule::class,
org.meshtastic.core.di.di.CoreDiModule::class,
CoreCommonModule::class,
CoreBleModule::class,
CoreBleAndroidModule::class,
@ -93,14 +94,6 @@ class AppKoinModule {
@Named("ProcessLifecycle")
fun provideProcessLifecycle(): Lifecycle = ProcessLifecycleOwner.get().lifecycle
@Single
fun provideCoroutineDispatchers(): org.meshtastic.core.di.CoroutineDispatchers =
org.meshtastic.core.di.CoroutineDispatchers(
io = kotlinx.coroutines.Dispatchers.IO,
main = kotlinx.coroutines.Dispatchers.Main,
default = kotlinx.coroutines.Dispatchers.Default,
)
@Single
fun provideBuildConfigProvider(): BuildConfigProvider = object : BuildConfigProvider {
override val isDebug: Boolean = org.meshtastic.app.BuildConfig.DEBUG

View file

@ -34,8 +34,10 @@ class FakeMeshServiceNotifications : MeshServiceNotifications {
override fun initChannels() {}
override fun updateServiceStateNotification(summaryString: String?, telemetry: Telemetry?): Notification =
mock(MockMode.autofill)
override fun updateServiceStateNotification(
state: org.meshtastic.core.model.ConnectionState,
telemetry: Telemetry?,
): Notification = mock(MockMode.autofill)
override suspend fun updateMessageNotification(
contactKey: String,