Enable test fixtures and migrate datastore test setup

pull/1834/head
Eugen Martynov 6 months ago
parent e308246131
commit dac28609d0
No known key found for this signature in database

@ -111,10 +111,10 @@ dependencies {
kspTest(libs.hilt.compiler)
testImplementation(projects.core.dataTest)
testImplementation(projects.core.datastoreTest)
testImplementation(libs.hilt.android.testing)
testImplementation(projects.sync.syncTest)
testImplementation(libs.kotlin.test)
testImplementation(testFixtures(projects.core.datastore))
testDemoImplementation(libs.androidx.navigation.testing)
testDemoImplementation(libs.robolectric)
@ -124,11 +124,11 @@ dependencies {
androidTestImplementation(projects.core.testing)
androidTestImplementation(projects.core.dataTest)
androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.hilt.android.testing)
androidTestImplementation(libs.kotlin.test)
androidTestImplementation(testFixtures(projects.core.datastore))
baselineProfile(projects.benchmarks)
}

@ -40,6 +40,6 @@ dependencies {
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.kotlinx.serialization.json)
testImplementation(projects.core.datastoreTest)
testImplementation(testFixtures(projects.core.datastore))
testImplementation(projects.core.testing)
}

@ -1,3 +0,0 @@
# :core:datastore-test module
## Dependency graph
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_test.svg)

@ -1,29 +0,0 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.nowinandroid.android.library)
alias(libs.plugins.nowinandroid.hilt)
}
android {
namespace = "com.google.samples.apps.nowinandroid.core.datastore.test"
}
dependencies {
implementation(libs.hilt.android.testing)
implementation(projects.core.common)
implementation(projects.core.datastore)
}

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest />

@ -25,6 +25,9 @@ android {
consumerProguardFiles("consumer-proguard-rules.pro")
}
namespace = "com.google.samples.apps.nowinandroid.core.datastore"
@Suppress("UnstableApiUsage")
testFixtures.enable = true
}
dependencies {
@ -34,6 +37,7 @@ dependencies {
implementation(projects.core.common)
testImplementation(projects.core.datastoreTest)
testImplementation(libs.kotlinx.coroutines.test)
testFixturesImplementation(libs.hilt.android.testing)
}

@ -63,3 +63,8 @@ roborazzi.test.verify=true
# Prevent uninstall app after instrumented tests
# https://issuetracker.google.com/issues/295039976
android.injected.androidTest.leaveApksInstalledAfterRun=true
# Test fixture introduction
# https://medium.com/@emartynov/android-project-test-fixtures-dec50c5d8533
# TODO: Add real documentation
android.experimental.enableTestFixturesKotlinSupport=true

@ -55,7 +55,6 @@ include(":core:data-test")
include(":core:database")
include(":core:datastore")
include(":core:datastore-proto")
include(":core:datastore-test")
include(":core:designsystem")
include(":core:domain")
include(":core:model")

Loading…
Cancel
Save