Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue/2066-performanc…
Browse files Browse the repository at this point in the history
…e-tests-load-data
  • Loading branch information
ekigamba committed Jul 17, 2023
2 parents 81a5c9a + 08724d3 commit fef6ac9
Show file tree
Hide file tree
Showing 534 changed files with 6,592 additions and 4,353 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Spotless check engine module
run: ./gradlew :engine:spotlessCheck --stacktrace && ./gradlew :engine:ktlintCheck --stacktrace
run: ./gradlew -PlocalPropertiesFile=local.properties :engine:spotlessCheck :engine:ktlintCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :engine:clean && ./gradlew :engine:fhircoreJacocoReport --stacktrace
script: ./gradlew -PlocalPropertiesFile=local.properties :engine:clean :engine:fhircoreJacocoReport --stacktrace

- name: Upload Engine module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Spotless check geowidget module
run: ./gradlew :geowidget:spotlessCheck --stacktrace
run: ./gradlew -PlocalPropertiesFile=local.properties :geowidget:spotlessCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :geowidget:clean && ./gradlew :geowidget:fhircoreJacocoReport --stacktrace
script: ./gradlew -PlocalPropertiesFile=local.properties :geowidget:clean :geowidget:fhircoreJacocoReport --stacktrace

- name: Upload Geowidget module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Spotless check quest application
run: ./gradlew :quest:spotlessCheck --stacktrace && ./gradlew :quest:ktlintCheck --stacktrace
run: ./gradlew -PlocalPropertiesFile=local.properties :quest:spotlessCheck --stacktrace :quest:ktlintCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: wget https://github.com/ekigamba/debug-jacoco-reports/releases/download/v0.0.1/resources.db && mv resources.db quest/src/androidTest/assets/ && ./gradlew :quest:clean && ./gradlew :quest:fhircoreJacocoReport --stacktrace
script: wget https://github.com/ekigamba/debug-jacoco-reports/releases/download/v0.0.1/resources.db && mv resources.db quest/src/androidTest/assets/ && ./gradlew -PlocalPropertiesFile=local.properties :quest:clean && ./gradlew -PlocalPropertiesFile=local.properties :quest:fhircoreJacocoReport --stacktrace

- name: Upload Quest module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.2.4] - 2023-06-24
### Added
- Insights feature to show stats on any _Unsynced_ Resources on the device
- Generic date service function to add or subtract days, weeks, months or years from/to current date
- Add ability to configure resource Id used to open profiles

### Fixed
- Incorrect error shown for failed authentication when the credentials are invalid.
Expand Down
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docs.smartregister.org
docs.opensrp.io
9 changes: 4 additions & 5 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-serialization:1.7.10")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.42")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3")
classpath("com.diffplug.spotless:spotless-plugin-gradle:5.11.0")
classpath("com.diffplug.spotless:spotless-plugin-gradle:6.19.0")
classpath("gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.0")
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1")
classpath("com.android.tools.build:gradle:7.1.3")
Expand Down Expand Up @@ -52,19 +52,18 @@ subprojects {
}

configure<SpotlessExtension> {
val lintVersion = "0.41.0"
val lintOptions = mapOf("indent_size" to "2", "continuation_indent_size" to "2")
val lintVersion = "0.49.0"

kotlin {
target("**/*.kt")
ktlint(lintVersion).userData(lintOptions)
ktlint(lintVersion)
ktfmt().googleStyle()
licenseHeaderFile("${project.rootProject.projectDir}/license-header.txt")
}

kotlinGradle {
target("*.gradle.kts")
ktlint(lintVersion).userData(lintOptions)
ktlint(lintVersion)
ktfmt().googleStyle()
}

Expand Down
9 changes: 7 additions & 2 deletions android/engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ android {
targetSdk = 33
testInstrumentationRunner = "org.smartregister.fhircore.engine.EngineTestRunner"
consumerProguardFiles("consumer-rules.pro")
buildConfigField(
"boolean",
"IS_NON_PROXY_APK",
"${project.hasProperty("isNonProxy") && property("isNonProxy").toString().toBoolean()}",
)
}

buildTypes {
Expand Down Expand Up @@ -69,8 +74,8 @@ android {
"META-INF/LGPL-3.0.txt",
"META-INF/sun-jaxb.episode",
"META-INF/*.kotlin_module",
"META-INF/INDEX.LIST"
)
"META-INF/INDEX.LIST",
),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ import androidx.compose.ui.test.junit4.ComposeContentTestRule
fun ComposeContentTestRule.waitUntilNodeCount(
matcher: SemanticsMatcher,
count: Int = 1,
timeoutMillis: Long = 5_000L
timeoutMillis: Long = 5_000L,
) {
this.waitUntil(timeoutMillis) { this.onAllNodes(matcher).fetchSemanticsNodes().size == count }
}

fun ComposeContentTestRule.waitUntilExists(
matcher: SemanticsMatcher,
timeoutMillis: Long = 5_000L
timeoutMillis: Long = 5_000L,
) {
return this.waitUntilNodeCount(matcher, 1, timeoutMillis)
}

fun ComposeContentTestRule.waitUntilDoesNotExist(
matcher: SemanticsMatcher,
timeoutMillis: Long = 5_000L
timeoutMillis: Long = 5_000L,
) {
return this.waitUntilNodeCount(matcher, 0, timeoutMillis)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RegisterBottomSheetFragmentViewTest {
private val navigationMenuConfigs =
listOf(
NavigationMenuConfig(id = "UniqueTag1", display = "Menu 1"),
NavigationMenuConfig(id = "UniqueTag2", display = "Menu 2")
NavigationMenuConfig(id = "UniqueTag2", display = "Menu 2"),
)

@Test
Expand All @@ -47,6 +47,7 @@ class RegisterBottomSheetFragmentViewTest {
composeRule.onNodeWithText("Menu 1", useUnmergedTree = true).assertExists().assertIsDisplayed()
composeRule.onNodeWithText("Menu 2", useUnmergedTree = true).assertExists().assertIsDisplayed()
}

@Test
fun testTitleShowsWithGivenName() {
setContent("Other services")
Expand All @@ -55,13 +56,14 @@ class RegisterBottomSheetFragmentViewTest {
.assertExists()
.assertIsDisplayed()
}

private fun setContent(title: String) {
composeRule.setContent {
RegisterBottomSheetView(
menuClickListener = mockListener,
navigationMenuConfigs = navigationMenuConfigs,
onDismiss = {},
title = title
title = title,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class PinTest {
inputMode = true,
onPinSet = {},
onShowPinError = {},
onPinEntered = { _: CharArray, _: (Boolean) -> Unit -> }
onPinEntered = { _: CharArray, _: (Boolean) -> Unit -> },
)
}
composeRule.onNodeWithTag(PIN_TEXT_FIELD_TEST_TAG).performTextInput("1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LoaderViewTest {
composeRule
.onNodeWithTag(LOADER_DIALOG_PROGRESS_MSG_TAG)
.assertTextEquals(
ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_down)
ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_down),
)
}

Expand All @@ -56,7 +56,7 @@ class LoaderViewTest {
composeRule
.onNodeWithTag(LOADER_DIALOG_PROGRESS_MSG_TAG)
.assertTextEquals(
ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_up)
ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_up),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RegisterFooterKtTest {
currentPage = 2,
pagesCount = 5,
previousButtonClickListener = {},
nextButtonClickListener = {}
nextButtonClickListener = {},
)
}

Expand All @@ -52,7 +52,7 @@ class RegisterFooterKtTest {
composeRule
.onNodeWithTag(SEARCH_FOOTER_PREVIOUS_BUTTON_TAG)
.assertTextEquals(
ApplicationProvider.getApplicationContext<Application>().getString(R.string.str_previous)
ApplicationProvider.getApplicationContext<Application>().getString(R.string.str_previous),
)

composeRule.onNodeWithTag(SEARCH_FOOTER_PAGINATION_TAG).assertExists()
Expand All @@ -62,7 +62,7 @@ class RegisterFooterKtTest {
.onNodeWithTag(SEARCH_FOOTER_PAGINATION_TAG)
.assertTextEquals(
ApplicationProvider.getApplicationContext<Application>()
.getString(R.string.str_page_info, 2, 5)
.getString(R.string.str_page_info, 2, 5),
)

composeRule.onNodeWithTag(SEARCH_FOOTER_NEXT_BUTTON_TAG).assertExists()
Expand All @@ -71,7 +71,7 @@ class RegisterFooterKtTest {
composeRule
.onNodeWithTag(SEARCH_FOOTER_NEXT_BUTTON_TAG)
.assertTextEquals(
ApplicationProvider.getApplicationContext<Application>().getString(R.string.str_next)
ApplicationProvider.getApplicationContext<Application>().getString(R.string.str_next),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,29 @@ package org.smartregister.fhircore.engine.configuration

/**
* Types of configurations supported
*
* @property name A unique name for configuration type. Typically provided in camelCase.
* @property parseAsResource Instructs that this configuration should be parsed into a FHIR resource
* (for configurations saved as Binary resource but can be directly converted to a eligible FHIR
* resource); generally a custom hard coded is used.
* (for configurations saved as Binary resource but can be directly converted to a eligible FHIR
* resource); generally a custom hard coded is used.
* @property multiConfig Denotes that we can have multiple instances of this type of config.
*/
sealed class ConfigType(
val name: String,
val parseAsResource: Boolean = false,
val multiConfig: Boolean = false
val multiConfig: Boolean = false,
) {
object Application : ConfigType("application")

object Sync : ConfigType("sync", true)

object Navigation : ConfigType("navigation")

object Register : ConfigType("register", multiConfig = true)

object MeasureReport : ConfigType("measureReport", multiConfig = true)

object Profile : ConfigType("profile", multiConfig = true)

object GeoWidget : ConfigType("geoWidget", multiConfig = true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package org.smartregister.fhircore.engine.configuration
*
* @property appId Unique identifier for the application to which this configurations is applied
* @property configType Used to categorize multiple configurations of the same type. E.g. two
* RegisterViewConfigurations used in an application with two registers.
* RegisterViewConfigurations used in an application with two registers.
* @property resourceType Optional FHIR resource type
*/
abstract class Configuration {
Expand Down
Loading

0 comments on commit fef6ac9

Please sign in to comment.