Skip to content

Commit

Permalink
Merge branch 'develop' into fix/show-sync-dialog-after-updating-TEI-data
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzalsif authored May 29, 2024
2 parents ba0250c + df6e294 commit 8541d73
Show file tree
Hide file tree
Showing 23 changed files with 692 additions and 479 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous Delivery

env:

main_project_module: app

on:
workflow_dispatch:
push:
branches:
- main
- develop
- release/*

jobs:
deployment_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Set Current Date
- name: Set current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDhisDebug

- name: Read version name from file
working-directory: ./gradle
id: read-version
run: echo "vName=$(grep 'vName' libs.versions.toml | awk -F' = ' '{print $2}' | tr -d '"')" >> "$GITHUB_OUTPUT"

# Upload Artifact Build
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.repository_name }} - Android APK - ${{ steps.date.outputs.date }}
path: ${{ env.main_project_module }}/build/outputs/apk/dhis/debug/dhis2-v${{ steps.read-version.outputs.vName }}-dhis-debug.apk
32 changes: 32 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This is a basic workflow that is manually triggered

name: Deploy Release

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
# Friendly description to be shown in the UI instead of 'name'
description: 'Person to greet'
# Default value if no value is explicitly provided
default: 'World'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
greet:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
4 changes: 3 additions & 1 deletion app/src/androidTest/java/org/dhis2/usescases/BaseTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ open class BaseTest {
}

private fun disableComposeForms() {
preferencesRobot.saveValue(SET_FROM_TESTING, true)
preferencesRobot.saveValue(Feature.COMPOSE_FORMS.name, false)
}


fun enableComposeForms() {
preferencesRobot.saveValue("SET_FROM_DEVELOPMENT", true)
preferencesRobot.saveValue(SET_FROM_TESTING, true)
preferencesRobot.saveValue(Feature.COMPOSE_FORMS.name, true)
}

Expand All @@ -184,5 +185,6 @@ open class BaseTest {
val disableAnimationsTestRule = DisableAnimations()
const val MOCK_SERVER_URL = "http://127.0.0.1:8080"
const val API = "api"
const val SET_FROM_TESTING = "SET_FROM_TESTING"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.dhis2.usescases
import org.dhis2.usescases.flow.searchFlow.SearchFlowTest
import org.dhis2.usescases.flow.syncFlow.SyncFlowTest
import org.dhis2.usescases.flow.teiFlow.TeiFlowTest
import org.dhis2.usescases.form.FormTest
import org.junit.runner.RunWith
import org.junit.runners.Suite

Expand All @@ -12,6 +11,5 @@ import org.junit.runners.Suite
SearchFlowTest::class,
SyncFlowTest::class,
TeiFlowTest::class,
FormTest::class
)
class FlowTestsSuite
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.test.rule.ActivityTestRule
import org.dhis2.common.filters.filterRobotCommon
import org.dhis2.usescases.BaseTest
import org.dhis2.usescases.flow.syncFlow.robot.eventWithoutRegistrationRobot
import org.dhis2.usescases.form.formRobot
import org.dhis2.usescases.main.AVOID_SYNC
import org.dhis2.usescases.main.MainActivity
import org.dhis2.usescases.main.homeRobot
Expand Down Expand Up @@ -146,12 +145,13 @@ class FilterTest : BaseTest() {
eventWithoutRegistrationRobot(composeTestRule) {
clickOnEventAtPosition(0)
}
formRobot(composeTestRule) {
// Commented because FormRobot class wah eliminated as FormTest was also eliminated
/*formRobot(composeTestRule) {
clickOnSelectOption(1, 1)
pressBack()
pressBack()
pressBack()
}
}*/
homeRobot {
openFilters()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class SyncFlowTest : BaseTest() {
cleanLocalDatabase()
}

@Ignore("Flaky test, will be addressed in issue #ANDROAPP-6155")
@Test
fun shouldSuccessfullySyncSavedEvent() {
mockWebServerRobot.addResponse(GET, "/api/system/ping", API_PING_RESPONSE_OK)
Expand Down Expand Up @@ -125,6 +126,7 @@ class SyncFlowTest : BaseTest() {
}

@Test
@Ignore("Flaky test, will be addressed in issue #ANDROAPP-6139")
fun shouldShowErrorWhenSyncEventFails() {
mockWebServerRobot.addResponse(GET, "/api/system/ping", API_PING_RESPONSE_OK)

Expand Down Expand Up @@ -187,6 +189,7 @@ class SyncFlowTest : BaseTest() {
cleanLocalDatabase()
}

@Ignore("Flaky test, will be addressed in next release")
@Test
fun shouldShowErrorWhenSyncDataSetFails() {
prepareFacilityDataSetIntentAndLaunchActivity(ruleDataSet)
Expand Down
20 changes: 0 additions & 20 deletions app/src/androidTest/java/org/dhis2/usescases/form/FormIntents.kt

This file was deleted.

156 changes: 0 additions & 156 deletions app/src/androidTest/java/org/dhis2/usescases/form/FormRobot.kt

This file was deleted.

Loading

0 comments on commit 8541d73

Please sign in to comment.