Skip to content

Commit

Permalink
### Added
Browse files Browse the repository at this point in the history
- Authentication using health insurance apps (FastTrack)
- Multiple profiles in app
- Choose you own PIN for health card
- Unlock locked health card
- Use your own pictures in profiles (i can haz cats)
- Mini-cardwall for relogin
- Show prescription types
- Status handling for prescriptions
- Show medication dispenses
- Show guide for NFC antenna position

### Changed
- Reworked mainscreen
- Reworked onboarding
- Reworked cardwall
- Switched from Room to Realm as DB
- Addressed and commented on reported issue in biometric authentication

### Removed
- Demo Mode
  • Loading branch information
Gematik-Entwicklung committed Aug 16, 2022
1 parent 5057ccf commit 127cea5
Show file tree
Hide file tree
Showing 714 changed files with 47,246 additions and 29,362 deletions.
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
.cxx

Jenkinsfile
Jenkinsfile_Archive
Jenkinsfile_GitHubPublish
Jenkinsfile_Desktop
Jenkinsfile_GitHubPublishFasttrack
Nightly.Jenkinsfile
Archive.Jenkinsfile
GitHubPublish.Jenkinsfile
Desktop.Jenkinsfile
UpdateTools.Jenkinsfile
DependencyReport.Jenkinsfile
ci-overrides.properties
nexus-init.gradle.kts
doc/security_doku
android/src/androidTest
156 changes: 156 additions & 0 deletions EspressoTest.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
@Library('gematik-jenkins-shared-library') _

pipeline {
options {
disableConcurrentBuilds()
buildDiscarder logRotator(artifactNumToKeepStr: '1', numToKeepStr: '5')
}
agent { label 'k8-android' }

triggers { cron('@midnight') }

environment {
UNIQUE_UPLOAD_NAME = "reports_${getTimestamp()}"
PATH = "/home/jenkins/agent/workspace/eRp-Android-Testautomation/google-cloud-sdk/bin:${env.PATH}"
}

stages {
stage('Prepare python libs') {
steps {
sh('pip install junitparser')
}
}
stage('Load & extract gcloud cli tool') {
steps {
sh('curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-394.0.0-linux-x86_64.tar.gz')
sh('tar -xf google-cloud-cli-394.0.0-linux-x86_64.tar.gz')
sh('./google-cloud-sdk/install.sh -q')
}
}
stage('Authenticate with gcloud & set project') {
steps {
withCredentials([file(credentialsId: 'gematik-erx-app-testenv-secret-file', variable: 'CLOUD_ACCESS_JSON')]) {
sh('gcloud auth activate-service-account --key-file=$CLOUD_ACCESS_JSON')
}
sh('gcloud config set project gematik-erx-app-testenv')
sh('gcloud firebase test android models list')
}
}
stage("Download Gradle Caches") {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
nexusFileDownload("E-Rezept-App/Android-Cache/gradle-caches.zip", "gradle-caches.zip")
sh("mkdir ${GRADLE_USER_HOME}/caches")
unzip(zipFile: "gradle-caches.zip", dir: "${GRADLE_USER_HOME}/caches/")
sh("chmod -R +x ${GRADLE_USER_HOME}/caches")
}
}
}
stage('Build') {
steps {
sh("./gradlew android:assembleGoogleTuInternalDebug -Pbuildkonfig.flavor=googleTuInternal")
sh("./gradlew android:assembleGoogleTuInternalDebugAndroidTest -Pbuildkonfig.flavor=googleTuInternal")
}
}
stage('Archive') {
steps {
archiveArtifacts(artifacts: 'android/build/outputs/apk/**/*.apk')
}
}
// stage('Upload & Start Test') {
// steps {
// withCredentials([string(credentialsId: 'MCD_exklusive', variable: 'CLOUD_ACCESS_KEY')]) {
// sh label:'Push Android build to cloud', script:'''
// curl --location --request POST "https://mobiledevicecloud.t-systems-mms.eu/api/v1/test-run/execute-test-run?deviceQueries=@os='android'" \
// -H "Authorization: Bearer $CLOUD_ACCESS_KEY" \
// -F "executionType=espresso" \
// -F "runningType=coverage" \
// -F "useTestOrchestrator=true" \
// -F "clearPackageData=true" \
// -F "testApp=@./android/build/outputs/apk/androidTest/googleTuInternal/debug/android-googleTuInternal-debug-androidTest.apk" \
// -F "app=@./android/build/outputs/apk/googleTuInternal/debug/android-googleTuInternal-debug.apk" > test-result.json
// '''
// }
// sh('cat test-result.json')
// }
// }
stage('Upload & Start Test') {
steps {
sh('''
gcloud firebase test android run \
--type=instrumentation \
--app=./android/build/outputs/apk/googleTuInternal/debug/android-googleTuInternal-debug.apk \
--test=./android/build/outputs/apk/androidTest/googleTuInternal/debug/android-googleTuInternal-debug-androidTest.apk \
--device=model=redfin,version=30 \
--use-orchestrator \
--environment-variables=clearPackageData=true \
--results-dir=$UNIQUE_UPLOAD_NAME \
--results-bucket=test-results-fe06447a10a2 || true
''')
}
}
stage('Download reporting') {
steps {
sh('gsutil cp gs://test-results-fe06447a10a2/$UNIQUE_UPLOAD_NAME/redfin-30-en-portrait/test_result_1.xml ./test_result_1.xml')
}
}
}

post {
// always {
// stage('De-Authenticate with gcloud') {
// steps {
// sh('./google-cloud-sdk/bin/gcloud auth ')
// }
// }
// }
// success {
// script {
// def result = readJSON file: 'test-result.json'
//
// if (result['data'].containsKey('Error reason')) {
// emailext(
// subject: "Android Test Run - TSys Cloud Failure",
// body: '${FILE, path="test-result.json"}',
// to: "[email protected],[email protected],[email protected],[email protected]"
// )
// } else {
// def totalNumberOfTest = result['data']['Total number of tests'] as Integer
// def numberOfPassed = result['data']['Number of passed tests'] as Integer
// def successRate = ((numberOfPassed / totalNumberOfTest) * 100) as Integer
//
// emailext(
// subject: "Android Test Run - Passed ${successRate}% of ${totalNumberOfTest} tests",
// body: '${FILE, path="test-result.json"}',
// to: '[email protected]'
// // to: "[email protected],[email protected],[email protected],[email protected]"
// )
// }
// }
success {
script {
sh('python ./ci/junit-report.py test_result_1.xml > report.txt')

def results = (readFile('report.txt')).split("\n\n")
def subject = results[0]
def body = results[1]

emailext(
subject: subject,
body: body,
to: "[email protected],[email protected],[email protected],[email protected],[email protected], [email protected]"
)
}
}
failure {
emailext to: "[email protected]",
subject: "Espresso Test Run - Failed",
body: ""
}
}
}

def getTimestamp() {
def now = new Date()
return now.format("yyyyMMddHHmm");
}
90 changes: 90 additions & 0 deletions Multibranch.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@Library('gematik-jenkins-shared-library') _

def CREDENTIAL_ID_NEXUS = "Nexus"

pipeline {
options {
disableConcurrentBuilds()
ansiColor('xterm')
copyArtifactPermission('*')
}

agent { label 'k8-android' }

stages {
stage("Download Gradle Caches") {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
nexusFileDownload("E-Rezept-App/Android-Cache/gradle-caches.zip", "gradle-caches.zip")
sh("mkdir ${GRADLE_USER_HOME}/caches")
unzip(zipFile: "gradle-caches.zip", dir: "${GRADLE_USER_HOME}/caches/")
sh("chmod -R +x ${GRADLE_USER_HOME}/caches")
}
}
}

stage('Build') {
steps {
gradleNexusCredentials(
{
sh label: "starting build...", script: "./gradlew assembleGoogleTuInternalDebug -Pbuildkonfig.flavor=googleTuInternal"
},
CREDENTIAL_ID_NEXUS)
}
}

stage('AppCenter Upload') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
withCredentials([[
$class : "UsernamePasswordMultiBinding",
credentialsId : "AppCenter-eRp-Android-Develop_u_p",
usernameVariable: "UNUSED",
passwordVariable: "APPCENTER_API_TOKEN"]])
{
appCenter apiToken: APPCENTER_API_TOKEN,
ownerName: "Gematik",
appName: 'eRezept-Android-Develop',
pathToApp: 'android/build/outputs/apk/**/android-googleTuInternal-debug.apk',
distributionGroups: 'Collaborators'
}
}
}
}

stage('UnitTests') {
steps {
sh './gradlew testGoogleTuInternaDebug -Pbuildkonfig.flavor=googleTuInternal'
}
}

stage('Gradle Cache Upload') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh("./gradlew --stop")
zip(zipFile: "gradle-caches.zip", archive: false, dir: "${GRADLE_USER_HOME}/caches/", overwrite: true)
nexusFileUpload("gradle-caches.zip", "E-Rezept-App/Android-Cache/gradle-caches.zip")
}
}
}
}

post {
success {
emailext attachLog: true,
to: "[email protected]",
subject: "Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}: ${currentBuild.currentResult}",
body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}"
}
failure {
emailext attachLog: true,
to: "[email protected]",
subject: "Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}: ${currentBuild.currentResult}",
body: ""
}
always {
archiveArtifacts artifacts: '**/*-debug.apk', allowEmptyArchive: true
junit testResults: '**/testGoogleTuInternalDebugUnitTest/*.xml,**/desktopTest/*.xml', allowEmptyResults: true
}
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ gradle :android:assemble(Google|Huawei)Pu(External|Internal)(Debug|Release) -Pbu

The resulting `.apk` can be found in e.g. `android/build/outputs/apk/googlePuExternal/debug/`.

#### Visualize Test Tags

See [Visualize Test Tags](documentation/test-tags.md)

### Desktop

To build a fat JAR run:
Expand Down
Loading

0 comments on commit 127cea5

Please sign in to comment.