File tree Expand file tree Collapse file tree 11 files changed +35
-14
lines changed
src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui Expand file tree Collapse file tree 11 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 1717org.gradle.daemon =false
1818org.gradle.parallel =true
1919org.gradle.workers.max =2
20+ org.gradle.configuration-cache =true
21+ org.gradle.configuration-cache.parallel =true
2022
2123kotlin.incremental =false
2224
Original file line number Diff line number Diff line change 77 " main"
88 ],
99 "gitIgnoredAuthors" : [
10+ " renovate[bot]@users.noreply.github.com" ,
11+ " github-actions[bot]@users.noreply.github.com" ,
1012 " 41898282+github-actions[bot]@users.noreply.github.com"
1113 ]
1214}
Original file line number Diff line number Diff line change 3737
3838 - name : Setup Gradle
3939 uses : gradle/actions/setup-gradle@v4
40+ with :
41+ cache-encryption-key : ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4042
4143 - name : Check build-logic
42- run : ./gradlew check -p build-logic
44+ run : ./gradlew : build-logic:convention:check
4345
4446 - name : Check spotless
4547 run : ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
@@ -186,6 +188,8 @@ jobs:
186188
187189 - name : Setup Gradle
188190 uses : gradle/actions/setup-gradle@v4
191+ with :
192+ cache-encryption-key : ${{ secrets.GRADLE_ENCRYPTION_KEY }}
189193
190194 - name : Build projects and run instrumentation tests
191195 uses : reactivecircus/android-emulator-runner@v2
Original file line number Diff line number Diff line change 3636
3737 - name : Setup Gradle
3838 uses : gradle/actions/setup-gradle@v4
39+ with :
40+ cache-encryption-key : ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3941
4042 - name : Setup Android SDK
4143 uses : android-actions/setup-android@v3
4446 run : yes | sdkmanager --licenses || true
4547
4648 - name : Check build-logic
47- run : ./gradlew check -p build-logic
49+ run : ./gradlew : build-logic:convention:check
4850
4951 - name : Setup GMD
5052 run : ./gradlew :benchmarks:pixel6Api33Setup
5759 run : ./gradlew :app:generateReleaseBaselineProfile
5860 -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile
5961 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
60- --stacktrace
62+ --stacktrace
Original file line number Diff line number Diff line change 3333
3434 - name : Setup Gradle
3535 uses : gradle/actions/setup-gradle@v4
36+ with :
37+ cache-encryption-key : ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3638
3739 - name : Setup Android SDK
3840 uses : android-actions/setup-android@v3
Original file line number Diff line number Diff line change @@ -116,15 +116,16 @@ dependencies {
116116 testImplementation(projects.sync.syncTest)
117117 testImplementation(libs.kotlin.test)
118118
119+ testDemoImplementation(libs.androidx.navigation.testing)
119120 testDemoImplementation(libs.robolectric)
120121 testDemoImplementation(libs.roborazzi)
121122 testDemoImplementation(projects.core.screenshotTesting)
123+ testDemoImplementation(projects.core.testing)
122124
123125 androidTestImplementation(projects.core.testing)
124126 androidTestImplementation(projects.core.dataTest)
125127 androidTestImplementation(projects.core.datastoreTest)
126128 androidTestImplementation(libs.androidx.test.espresso.core)
127- androidTestImplementation(libs.androidx.navigation.testing)
128129 androidTestImplementation(libs.androidx.compose.ui.test)
129130 androidTestImplementation(libs.hilt.android.testing)
130131 androidTestImplementation(libs.kotlin.test)
Original file line number Diff line number Diff line change @@ -216,12 +216,12 @@ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.0
216216org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0
217217org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0
218218org.jetbrains.kotlin:kotlin-stdlib:2.1.0
219- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9 .0
220- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9 .0
221- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9 .0
222- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9 .0
223- org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.9 .0
224- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.9 .0
219+ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10 .0
220+ org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10 .0
221+ org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10 .0
222+ org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10 .0
223+ org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.10 .0
224+ org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10 .0
225225org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.1
226226org.jetbrains.kotlinx:kotlinx-datetime:0.6.1
227227org.jetbrains.kotlinx:kotlinx-serialization-bom:1.7.3
Original file line number Diff line number Diff line change @@ -31,22 +31,27 @@ import com.google.samples.apps.nowinandroid.core.testing.repository.TestNewsRepo
3131import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository
3232import com.google.samples.apps.nowinandroid.core.testing.util.TestNetworkMonitor
3333import com.google.samples.apps.nowinandroid.core.testing.util.TestTimeZoneMonitor
34+ import dagger.hilt.android.testing.HiltAndroidTest
35+ import dagger.hilt.android.testing.HiltTestApplication
3436import kotlinx.coroutines.flow.collect
3537import kotlinx.coroutines.launch
3638import kotlinx.coroutines.test.UnconfinedTestDispatcher
3739import kotlinx.coroutines.test.runTest
3840import kotlinx.datetime.TimeZone
3941import org.junit.Rule
4042import org.junit.Test
43+ import org.junit.runner.RunWith
44+ import org.robolectric.RobolectricTestRunner
45+ import org.robolectric.annotation.Config
4146import kotlin.test.assertEquals
4247import kotlin.test.assertTrue
4348
4449/* *
4550 * Tests [NiaAppState].
46- *
47- * Note: This could become an unit test if Robolectric is added to the project and the Context
48- * is faked.
4951 */
52+ @RunWith(RobolectricTestRunner ::class )
53+ @Config(application = HiltTestApplication ::class )
54+ @HiltAndroidTest
5055class NiaAppStateTest {
5156
5257 @get:Rule
Original file line number Diff line number Diff line change 22org.gradle.parallel =true
33org.gradle.caching =true
44org.gradle.configureondemand =true
5+ org.gradle.configuration-cache =true
6+ org.gradle.configuration-cache.parallel =true
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ org.gradle.caching=true
3939
4040# Enable configuration caching between builds.
4141org.gradle.configuration-cache =true
42+ org.gradle.configuration-cache.parallel =true
4243# This option is set because of https://github.com/google/play-services-plugins/issues/246
4344# to generate the Configuration Cache regardless of incompatible tasks.
4445# See https://github.com/android/nowinandroid/issues/1022 before using it.
You can’t perform that action at this time.
0 commit comments