Skip to content

Commit

Permalink
[wip] Fix failing compose tests with AppNotIdleException
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Jul 30, 2023
1 parent 49fc301 commit 25a5c93
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 26 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ buildscript {

}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10'
classpath "org.jetbrains.kotlin:kotlin-serialization:1.8.10"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22'
classpath "org.jetbrains.kotlin:kotlin-serialization:1.8.22"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.45'
classpath deps.spotless
classpath deps.kotlin_coveralls_plugin
Expand Down
22 changes: 11 additions & 11 deletions android/deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def versions = [:]
versions.activity = '1.2.1'
versions.android_gradle_plugin = '7.1.2'
versions.appcompat = '1.4.1'
versions.atsl_core = '1.4.1-alpha04'
versions.atsl_expresso = '3.5.0'
versions.atsl_junit = '1.1.3'
versions.atsl_rules = '1.4.0'
versions.atsl_runner = '1.4.0'
versions.atsl_core = '1.5.0'
versions.atsl_expresso = '3.5.1'
versions.atsl_junit = '1.1.5'
versions.atsl_rules = '1.5.0'
versions.atsl_runner = '1.5.2'
versions.caffeine = '2.9.0'
versions.constraint_layout = '1.1.3'
versions.coroutines = '1.6.4'
versions.coroutines = '1.7.3'
versions.core = '1.7.0'
versions.cql_engine = '1.3.14-SNAPSHOT'
versions.desugar = '1.1.5'
Expand All @@ -31,13 +31,13 @@ versions.fhir_protos = '0.6.1'
versions.guava = '28.2-android'
versions.hapi_r4 = '5.3.0'
versions.junit5_api = '5.9.3'
versions.kotlin = '1.8.10'
versions.kotlin = '1.8.22'
versions.lifecycle = '2.2.0'
versions.material = '1.5.0'
versions.okhttp_logging_interceptor = '4.0.0'
versions.recyclerview = '1.1.0'
versions.retrofit = '2.7.2'
versions.robolectric = '4.9-alpha-1'
versions.robolectric = '4.9.2'
versions.room = '2.4.2'
versions.spotless = '5.11.0'
versions.truth = '1.0.1'
Expand All @@ -48,11 +48,11 @@ versions.jacoco_tool = '0.8.7'
versions.ktlint = '0.41.0'
versions.joda_time = '2.10.5'
versions.timber = '4.7.1'
versions.mockk = '1.12.4'
versions.mockk = '1.13.5'
versions.dokka = '1.5.0'
versions.androidx_test = '2.1.0'
versions.androidx_test = '2.2.0'
versions.accompanist_swiperefresh = '0.26.4-beta'
versions.compose = '1.3.3'
versions.compose = '1.4.3'
ext.versions = versions

def deps = [:]
Expand Down
23 changes: 20 additions & 3 deletions android/engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
viewBinding true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.2'
kotlinCompilerExtensionVersion '1.4.8'
}

//CQL
Expand Down Expand Up @@ -87,6 +87,22 @@ android {
includeAndroidResources = true
returnDefaultValues = true
all {
testLogging {
// set options for log level LIFECYCLE
events "failed"
exceptionFormat "full"

// set options for log level DEBUG
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}

// remove standard output/error logging from --info builds
// by assigning only 'failed' and 'skipped' events
info.events = ["failed", "skipped"]
}

minHeapSize = "4608m"
maxHeapSize = "4608m"
beforeTest { testDescriptor ->
Expand Down Expand Up @@ -183,7 +199,7 @@ dependencies {
api("androidx.work:work-runtime-ktx:2.8.0")
testApi 'androidx.work:work-testing:2.8.0'

def coroutineVersion = '1.6.4'
def coroutineVersion = '1.7.3'
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion")
api("org.smartregister:contrib-barcode:0.1.0-beta3-preview5-SNAPSHOT"){
Expand Down Expand Up @@ -243,6 +259,7 @@ dependencies {
testRuntimeOnly deps.junit5_engine
testRuntimeOnly deps.junit5_engine_vintage
testImplementation deps.robolectric
testImplementation deps.atsl.core
testImplementation deps.atsl.ext_junit
testImplementation deps.atsl.ext_junit_ktx
testImplementation deps.coroutines.test
Expand All @@ -254,7 +271,7 @@ dependencies {
androidTestImplementation deps.atsl.ext_junit
androidTestImplementation deps.atsl.espresso
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutineVersion"
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation deps.atsl.ext_junit
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.atsl_expresso"
implementation deps.work.runtime
testImplementation group: 'org.json', name: 'json', version: '20210307'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ internal class CircularProgressBarKtTest : RobolectricTest() {

@get:Rule val composeRule = createComposeRule()

// TODO: Fix https://github.com/robolectric/robolectric/issues/7055

@Test
fun testCircularProgressBarWithText() {
composeRule.setContent { CircularProgressBar(text = textSyncing) }
Expand Down
22 changes: 20 additions & 2 deletions android/quest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion '1.4.2'
kotlinCompilerExtensionVersion '1.4.8'
}

testOptions {
Expand All @@ -120,6 +120,23 @@ android {
includeAndroidResources = true
returnDefaultValues = true
all {

testLogging {
// set options for log level LIFECYCLE
events "failed"
exceptionFormat "full"

// set options for log level DEBUG
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}

// remove standard output/error logging from --info builds
// by assigning only 'failed' and 'skipped' events
info.events = ["failed", "skipped"]
}

beforeTest { testDescriptor ->
println "${testDescriptor.className} > ${testDescriptor.name} STARTED"
}
Expand Down Expand Up @@ -201,14 +218,15 @@ dependencies {
testRuntimeOnly deps.junit5_engine
testRuntimeOnly deps.junit5_engine_vintage
testImplementation deps.robolectric
testImplementation deps.atsl.core
testImplementation deps.atsl.ext_junit
testImplementation deps.atsl.ext_junit_ktx
testImplementation deps.coroutines.test
testImplementation deps.androidx.core_test
debugImplementation deps.fragment_testing
releaseImplementation deps.fragment_testing
testImplementation deps.mockk
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'

// analytics
implementation platform('com.google.firebase:firebase-bom:31.2.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,8 @@ data class Property(

@Stable @Serializable data class DynamicColor(val valueEqual: String, val useColor: String)

enum class FontWeight {
enum class FontWeight(val weight: Int) {
LIGHT(300),
NORMAL(400),
BOLD(700);

val weight: Int

constructor(weight: Int) {
this.weight = weight
}
BOLD(700)
}

0 comments on commit 25a5c93

Please sign in to comment.