Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANDROAPP-6326] set default target SDK version #3730

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.Date
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand Down Expand Up @@ -64,8 +64,6 @@ android {
}
}

ndkVersion = libs.versions.ndk.get()
compileSdk = libs.versions.sdk.get().toInt()
namespace = "org.dhis2"
testNamespace = "org.dhis2.test"

Expand All @@ -75,6 +73,8 @@ android {

defaultConfig {
applicationId = "com.dhis2"
compileSdk = libs.versions.sdk.get().toInt()
targetSdk = libs.versions.sdk.get().toInt()
minSdk = libs.versions.minSdk.get().toInt()
versionCode = libs.versions.vCode.get().toInt()
versionName = libs.versions.vName.get()
Expand Down Expand Up @@ -129,12 +129,6 @@ android {
}
}

testOptions {
unitTests {
isReturnDefaultValues = true
}
}

buildTypes {

getByName("debug") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class SyncFlowRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
composeTestRule.onNodeWithTag(MAIN_BUTTON_TAG, useUnmergedTree = true).performClick()
}

@OptIn(ExperimentalTestApi::class)
fun checkSyncWasSuccessfully() {
val expectedTitle = InstrumentationRegistry.getInstrumentation()
.targetContext.getString(R.string.sync_dialog_title_synced)
composeTestRule.waitUntilAtLeastOneExists(hasText(expectedTitle))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method I believe has a default time that throws an exception if not found, and is 1000 ms if not specified. I have seen tests fail due to the ocasional slow loading of the page other times this assertion was used, do you think it's a good idea to increase the time out to 2000 ms at least?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it has a default time 1000ms, so it's the time that the workers are setting sync successful, why don't we try the default implementation and if it fails we can think on increment it?

composeTestRule.onNodeWithTag(TITLE, useUnmergedTree = true).assert(hasText(expectedTitle, true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ import androidx.compose.ui.test.performTextInput
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem
import androidx.test.espresso.contrib.RecyclerViewActions.scrollTo
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.platform.app.InstrumentationRegistry
import org.dhis2.R
import org.dhis2.common.BaseRobot
import org.dhis2.common.matchers.RecyclerviewMatchers
import org.dhis2.common.matchers.RecyclerviewMatchers.Companion.hasItem
import org.dhis2.common.matchers.RecyclerviewMatchers.Companion.hasNoMoreResultsInProgram
import org.dhis2.common.viewactions.openSpinnerPopup
import org.dhis2.usescases.searchTrackEntity.adapters.SearchTEViewHolder
import org.dhis2.usescases.searchTrackEntity.listView.SearchResult
import org.dhis2.usescases.searchte.entity.DisplayListFieldsUIModel
import org.hamcrest.CoreMatchers.allOf
Expand Down Expand Up @@ -127,15 +125,16 @@ class SearchTeiRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
onView(withId(R.id.spinner_text)).check(matches(withText(program)))
}


fun checkFieldsFromDisplayList(
displayListFieldsUIModel: DisplayListFieldsUIModel
) {
//Given the title is the first attribute
val title = "First name: ${displayListFieldsUIModel.name}"
val displayedAttributes = createAttributesList(displayListFieldsUIModel)
val showMoreText = InstrumentationRegistry.getInstrumentation()
.targetContext.getString(R.string.show_more)
//When we expand all attribute list
composeTestRule.onNodeWithText("Show more", true).performClick()
composeTestRule.onNodeWithText(showMoreText, true, useUnmergedTree = true).performClick()
composeTestRule.waitForIdle()
//Then The title and all attributes are displayed
composeTestRule.onNodeWithText(title).assertIsDisplayed()
Expand Down Expand Up @@ -165,15 +164,6 @@ class SearchTeiRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
onView(withId(R.id.createButton)).perform(click())
}

fun checkListOfSearchTEIWithAdditionalInfo(title: String, additionalText: String) {
composeTestRule.onNodeWithText(title).assertIsDisplayed()
composeTestRule.onNode(
hasParent(hasTestTag("LIST_CARD_ADDITIONAL_INFO_COLUMN"))
and hasText(additionalText, true),
useUnmergedTree = true,
).assertIsDisplayed()
}

private fun createAttributesList(displayListFieldsUIModel: DisplayListFieldsUIModel) = listOf(
AdditionalInfoItem(
key = "Last name",
Expand Down
4 changes: 2 additions & 2 deletions dhis2-mobile-program-rules/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ apply(from = "${project.rootDir}/jacoco/jacoco.gradle.kts")

android {
namespace = "org.dhis2.dhis2_mobile_program_rules"
compileSdk = 34
compileSdk = libs.versions.sdk.get().toInt()

defaultConfig {
minSdk = 21
minSdk = libs.versions.minSdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object TeiMarkers {
Bitmap.Config.ARGB_8888,
)
val markerBitmap =
Bitmap.createBitmap(canvasMarker.width, canvasMarker.height, canvasMarker.config)
Bitmap.createBitmap(canvasMarker.width, canvasMarker.height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(markerBitmap)

drawable.setBounds(0, 0, canvas.width, canvas.height)
Expand Down
10 changes: 3 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[versions]
ndk = "21.4.7075529"
sdk = "34"
minSdk = "21"
vCode = "130"
vName = "3.0"
kotlinCompilerExtensionVersion = "1.5.6"
gradle = "8.4.2"
vName = "3.1.0"
gradle = "8.5.1"
kotlin = '2.0.0'
hilt = '2.47'
jacoco = '0.8.10'
designSystem = "0.3.0-SNAPSHOT"
dhis2sdk = "1.10.0"
dhis2sdk = "1.11.0-SNAPSHOT"
ruleEngine = "3.0.0"
expressionParser = "1.1.0"
appcompat = "1.6.1"
Expand All @@ -20,7 +18,6 @@ legacysupport = "1.0.0"
multidex = "2.0.1"
constraintlayout = "2.1.4"
lifecycle = "2.6.1"
lifecycleExtensions = "2.2.0"
work = "2.8.1"
exif = "1.3.6"
corektx = "1.10.1"
Expand Down Expand Up @@ -148,7 +145,6 @@ dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-andro
dagger-hilt-compiler-new = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
rx-java = { group = "io.reactivex.rxjava2", name = "rxjava", version.ref = "rxjava" }
rx-android = { group = "io.reactivex.rxjava2", name = "rxandroid", version.ref = "rxandroid" }
rx-binding = { group = "com.jakewharton.rxbinding2", name = "rxbinding", version.ref = "rxbindings" }
rx-binding-compat = { group = "com.jakewharton.rxbinding2", name = "rxbinding-appcompat-v7", version.ref = "rxbindings" }
rx-relay = { group = "com.jakewharton.rxrelay2", name = "rxrelay", version.ref = "rxrelay" }
github-pinlock = { group = "com.github.aritraroy", name = "PinLockView", version.ref = "pinlock" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 26 12:02:53 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading