Speed up runtime state refresh

This commit is contained in:
Joe Tretter
2026-06-24 17:44:53 -05:00
parent 0554c736e4
commit 1c15297ae6
7 changed files with 180 additions and 22 deletions

View File

@@ -22,4 +22,21 @@ class GitRepositoryRuntimeInstrumentedTest {
assertTrue(updatedRepo.initialized)
assertTrue(level.validator(updatedRepo, "git init"))
}
@Test
fun nativeGitRuntimeCompletesConfigLevelOnDevice() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val runtime = GitRepositoryRuntime(context)
val level = configLevel()
assertTrue(runtime.unavailableMessage(), runtime.isNativeGitAvailable())
val repo = runtime.prepareLevel(level)
val (namedRepo, _) = runtime.execute(level, repo, "git config user.name GitHug")
val (configuredRepo, _) = runtime.execute(level, namedRepo, "git config user.email githug@example.com")
assertTrue(configuredRepo.config["user.name"].orEmpty().isNotBlank())
assertTrue(configuredRepo.config["user.email"].orEmpty().isNotBlank())
assertTrue(level.validator(configuredRepo, "git config user.email githug@example.com"))
}
}