Skip to content

Commit bd9c5ed

Browse files
yaturnerclaude
andcommitted
ADFA-4484 Fix test compilation errors and build environment
- Register :agent module in settings.gradle.kts (was missing) - Fix agent/build.gradle.kts: replace deprecated buildDir with layout.buildDirectory, import ZipInputStream at top level - Fix GitRepositoryUrlsTest: rename test containing '..' (illegal in Kotlin backtick identifiers) - Fix KeyedDebouncingActionTest: call isCancelled() as function, not property - Fix DiagnosticsFormatterTest: add explicit type to emptyList<DiagnosticItem>() - Fix BackgroundIndexerTest: add missing import for IndexingProgressListener 287 tests now pass across git-core, common, app, and lsp:indexing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 66202e6 commit bd9c5ed

6 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎agent/build.gradle.kts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import com.itsaky.androidide.build.config.BuildConfig
2+
import java.util.zip.ZipInputStream
23

34
plugins {
45
alias(libs.plugins.kotlin.android)
@@ -31,7 +32,7 @@ android {
3132
}
3233
sourceSets {
3334
getByName("androidTest") {
34-
assets.srcDirs("src/androidTest/assets", "$buildDir/generated/androidTest/assets")
35+
assets.srcDirs("src/androidTest/assets", layout.buildDirectory.dir("generated/androidTest/assets").get().asFile)
3536
}
3637
}
3738
}
@@ -43,7 +44,7 @@ val extractLlamaAarForTests by tasks.registering {
4344

4445
val v8AssetsZip = file("../app/build/outputs/assets/assets-arm64-v8a.zip")
4546
val v7AssetsZip = file("../app/build/outputs/assets/assets-armeabi-v7a.zip")
46-
val outputDir = file("$buildDir/generated/androidTest/assets/dynamic_libs")
47+
val outputDir = layout.buildDirectory.dir("generated/androidTest/assets/dynamic_libs").get().asFile
4748

4849
inputs.files(v8AssetsZip, v7AssetsZip).optional()
4950
outputs.dir(outputDir)
@@ -63,7 +64,7 @@ val extractLlamaAarForTests by tasks.registering {
6364
}
6465

6566
var extracted = false
66-
java.util.zip.ZipInputStream(assetsZip.inputStream().buffered()).use { zipIn ->
67+
ZipInputStream(assetsZip.inputStream().buffered()).use { zipIn ->
6768
val buffer = ByteArray(8 * 1024)
6869
var entry = zipIn.nextEntry
6970
while (entry != null) {

‎app/src/test/java/com/itsaky/androidide/utils/DiagnosticsFormatterTest.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class DiagnosticsFormatterTest {
217217
fun `summary files count only files with items`() {
218218
val diagnostics = mapOf(
219219
file("A.kt") to listOf(makeItem("e", DiagnosticSeverity.ERROR)),
220-
file("B.kt") to emptyList()
220+
file("B.kt") to emptyList<DiagnosticItem>()
221221
)
222222
val result = DiagnosticsFormatter.format(diagnostics)
223223
assertThat(result).contains("Files: 1")
@@ -228,7 +228,7 @@ class DiagnosticsFormatterTest {
228228
@Test
229229
fun `files with empty diagnostic list are not included in body`() {
230230
val diagnostics = mapOf(
231-
file("Empty.kt") to emptyList()
231+
file("Empty.kt") to emptyList<DiagnosticItem>()
232232
)
233233
val result = DiagnosticsFormatter.format(diagnostics)
234234
assertThat(result).doesNotContain("Empty.kt")

‎common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionTest.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class KeyedDebouncingActionTest {
192192
scope = makeScope(),
193193
debounceDuration = 50.milliseconds,
194194
action = { _, checker ->
195-
checkerWasActive = !checker.isCancelled
195+
checkerWasActive = !checker.isCancelled()
196196
}
197197
)
198198

‎git-core/src/test/java/com/itsaky/androidide/git/core/GitRepositoryUrlsTest.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class GitRepositoryUrlsTest {
5858
}
5959

6060
@Test
61-
fun `HTTPS URL without .git suffix is accepted`() {
61+
fun `HTTPS URL without git suffix is accepted`() {
6262
val result = parseGitRepositoryUrl("https://github.com/user/repo")
6363
assertThat(result).isNotNull()
6464
assertThat(result).contains("github.com")

‎lsp/indexing/src/test/kotlin/org/appdevforall/codeonthego/indexing/BackgroundIndexerTest.kt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import org.appdevforall.codeonthego.indexing.api.IndexQuery
1212
import org.appdevforall.codeonthego.indexing.api.Indexable
1313
import org.appdevforall.codeonthego.indexing.util.BackgroundIndexer
1414
import org.appdevforall.codeonthego.indexing.util.IndexingEvent
15+
import org.appdevforall.codeonthego.indexing.util.IndexingProgressListener
1516
import org.junit.After
1617
import org.junit.Before
1718
import org.junit.Test

‎settings.gradle.kts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ include(
113113
":annotation-processors-ksp",
114114
":annotations",
115115
":actions",
116+
":agent",
116117
":app",
117118
":build-info",
118119
":common",

0 commit comments

Comments
 (0)