Skip to content

Commit 0c46b24

Browse files
committed
Upgrade test libs and migrate to toml
1 parent 480f242 commit 0c46b24

File tree

6 files changed

+66
-39
lines changed

6 files changed

+66
-39
lines changed

app/build.gradle.kts

+18-20
Original file line numberDiff line numberDiff line change
@@ -185,29 +185,27 @@ dependencies {
185185

186186
// anything less than 'implementation' fails tests run with gradlew
187187
testImplementation(aospLibs)
188-
testImplementation("androidx.test.ext:junit:1.1.5")
189-
testImplementation("org.slf4j:slf4j-simple:2.0.3")
190-
testImplementation("org.robolectric:robolectric:4.12.2")
191-
testImplementation("org.hamcrest:hamcrest:2.2")
192-
testImplementation("org.junit.jupiter:junit-jupiter-api:${libs.versions.junit5.get()}")
193-
testImplementation("org.junit.jupiter:junit-jupiter-params:${libs.versions.junit5.get()}")
194-
testImplementation("io.mockk:mockk:${libs.versions.mockk.get()}")
195-
testImplementation(
196-
"org.jetbrains.kotlinx:kotlinx-coroutines-test:${libs.versions.coroutines.get()}"
197-
)
198-
testImplementation("app.cash.turbine:turbine:1.0.0")
199-
testImplementation("org.bitcoinj:bitcoinj-core:0.16.2")
200-
testImplementation("com.github.luben:zstd-jni:1.5.6-5")
201-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${libs.versions.junit5.get()}")
202-
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:${libs.versions.junit5.get()}")
188+
testImplementation(libs.androidx.junit)
189+
testImplementation(libs.slf4j.simple)
190+
testImplementation(libs.robolectric)
191+
testImplementation(libs.hamcrest)
192+
testImplementation(libs.junit.jupiter.api)
193+
testImplementation(libs.junit.jupiter.params)
194+
testImplementation(libs.mockk)
195+
testImplementation(libs.kotlinx.coroutines.test)
196+
testImplementation(libs.turbine)
197+
testImplementation(libs.bitcoinj.core)
198+
testImplementation(libs.zstd.jni)
199+
testRuntimeOnly(libs.junit.jupiter.engine)
200+
testRuntimeOnly(libs.junit.vintage.engine)
203201

204202
androidTestImplementation(aospLibs)
205203
androidTestImplementation(kotlin("test"))
206-
androidTestImplementation("androidx.test:runner:1.4.0")
207-
androidTestImplementation("androidx.test:rules:1.4.0")
208-
androidTestImplementation("androidx.test.ext:junit:1.1.3")
209-
androidTestImplementation("io.mockk:mockk-android:1.13.8")
210-
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0")
204+
androidTestImplementation(libs.androidx.runner)
205+
androidTestImplementation(libs.androidx.rules)
206+
androidTestImplementation(libs.androidx.junit)
207+
androidTestImplementation(libs.mockk.android)
208+
androidTestImplementation(libs.androidx.uiautomator)
211209
}
212210

213211
gradle.projectsEvaluated {

app/src/androidTest/java/com/stevesoltys/seedvault/e2e/LargeRestoreTestBase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ internal interface LargeRestoreTestBase : LargeTestBase {
5353
waitUntilIdle()
5454

5555
code.forEachIndexed { index, word ->
56-
wordTextField(index).text = word
56+
wordTextField(index).setText(word)
5757
}
5858

5959
waitUntilIdle()

app/src/androidTest/java/com/stevesoltys/seedvault/e2e/LargeTestBase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ internal interface LargeTestBase : KoinComponent {
191191

192192
} else {
193193
createNewFolderButton.clickAndWaitForNewWindow()
194-
textBox.text = folderName
194+
textBox.setText(folderName)
195195
okButton.clickAndWaitForNewWindow()
196196
}
197197

contactsbackup/build.gradle.kts

+5-7
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ dependencies {
6161
implementation(aospDeps)
6262

6363
testImplementation(libs.kotlin.stdlib.jdk8)
64-
testImplementation("junit:junit:${libs.versions.junit4.get()}")
65-
testImplementation("io.mockk:mockk:${libs.versions.mockk.get()}")
64+
testImplementation(libs.junit4)
65+
testImplementation(libs.mockk)
6666

6767
androidTestImplementation(libs.kotlin.stdlib.jdk8)
68-
androidTestImplementation("androidx.test.ext:junit:1.1.5")
69-
androidTestImplementation(
70-
"androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}"
71-
)
72-
androidTestImplementation("io.mockk:mockk-android:${libs.versions.mockk.get()}")
68+
androidTestImplementation(libs.androidx.junit)
69+
androidTestImplementation(libs.androidx.espresso.core)
70+
androidTestImplementation(libs.mockk.android)
7371
}

gradle/libs.versions.toml

+35-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ targetSdk = "35"
1717
# Test versions
1818
junit4 = "4.13.2"
1919
junit5 = "5.10.2" # careful, upgrading this can change a Cipher's IV size in tests!?
20-
mockk = "1.13.4" # newer versions require kotlin > 1.8.10
21-
espresso = "3.4.0"
20+
mockk = "1.13.8"
21+
androidXjunit = "1.2.1"
22+
robolectric = "4.12.2"
23+
espresso = "3.6.1"
24+
turbine = "1.0.0"
25+
slf4jSimple = "2.0.3"
26+
hamcrest = "2.2"
27+
androidXrunner = "1.6.2"
28+
androidXrules = "1.6.1"
29+
androidXuiautomator = "2.3.0"
30+
zstdJni = "1.5.6-5"
31+
bitcoinjCore = "0.16.2"
2232

2333
# Dependency versions below this are AOSP versions.
2434
# We use "strictly" to enforce the version cannot be overriden by transitive dependencies.
@@ -117,6 +127,29 @@ squareup-okio = { module= "com.squareup.okio:okio", version.ref = "squareup-okio
117127
kotlin-logging = { module = "io.github.oshai:kotlin-logging-jvm", version.ref = "logging" }
118128
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-api" }
119129

130+
# Test dependencies
131+
junit4 = { module = "junit:junit", version.ref = "junit4" }
132+
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
133+
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit5" }
134+
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit5" }
135+
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit5" }
136+
junit-vintage-engine = { module = "org.junit.jupiter:junit-vintage-engine", version.ref = "junit5" }
137+
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidXjunit" }
138+
androidx-rules = { module = "androidx.test:rules", version.ref = "androidXrules" }
139+
androidx-runner = { module = "androidx.test:runner", version.ref = "androidXrunner" }
140+
androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidXuiautomator" }
141+
androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "room" }
142+
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
143+
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
144+
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
145+
mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" }
146+
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
147+
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }
148+
hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" }
149+
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4jSimple" }
150+
bitcoinj-core = { module = "org.bitcoinj:bitcoinj-core", version.ref = "bitcoinjCore" }
151+
zstd-jni = { module = "com.github.luben:zstd-jni", version.ref = "zstdJni" }
152+
120153
[bundles]
121154
kotlin = ["kotlin-stdlib", "kotlin-stdlib-jdk8", "kotlin-stdlib-common"]
122155
coroutines = ["kotlinx-coroutines-core-jvm", "kotlinx-coroutines-android"]

storage/lib/build.gradle.kts

+6-8
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,10 @@ dependencies {
107107

108108
ksp(group = "androidx.room", name = "room-compiler", version = libs.versions.room.get())
109109
lintChecks(libs.thirdegg.lint.rules)
110-
testImplementation("junit:junit:${libs.versions.junit4.get()}")
111-
testImplementation("io.mockk:mockk:${libs.versions.mockk.get()}")
112-
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:${libs.versions.kotlin.get()}")
113-
androidTestImplementation("androidx.test.ext:junit:1.1.5")
114-
androidTestImplementation("androidx.room:room-testing:${libs.versions.room.get()}")
115-
androidTestImplementation(
116-
"androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}"
117-
)
110+
testImplementation(libs.junit4)
111+
testImplementation(libs.mockk)
112+
testImplementation(libs.kotlin.test.junit)
113+
androidTestImplementation(libs.androidx.junit)
114+
androidTestImplementation(libs.androidx.room.testing)
115+
androidTestImplementation(libs.androidx.espresso.core)
118116
}

0 commit comments

Comments
 (0)