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

Bigger partion #39

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
64 changes: 39 additions & 25 deletions .github/workflows/Android-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,45 @@ jobs:
VERSION: ${{steps.tagger.outputs.tag}}
- name: Run tests
run: ./gradlew test -Ponly_x86_64
# - name: Run instrumentation tests
# uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
# with:
# cmd: ./gradlew cAT -Ponly_x86_64 --continue
# api: 28
# tag: default
# abi: arm64-v8a
# - name: Archive Espresso results
# uses: actions/[email protected]
# if: ${{ always() }}
# with:
# name: MediaPipe-Espresso-report
# path: applications/**/build/reports/androidTests/connected/
# - name: Save logcat output
# uses: actions/upload-artifact@master
# if: failure()
# with:
# name: MediaPipe-logcat
# path: artifacts/logcat.log
# - name: Archive screenshots
# uses: actions/[email protected]
# if: ${{ always() }}
# with:
# name: MediaPipe-Screenshots
# path: applications/screenshots/adb/
- name: Run instrumentation tests
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
env:
VERSION: ${{ github.ref }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
ALIAS_NAME: ${{ secrets.ALIAS_NAME }}
ALIAS_PASS: ${{ secrets.ALIAS_PASS }}
with:
cmd: ./gradlew cAT -Ponly_x86_64 --continue
api: 28
tag: default
abi: x86_64
cmdOptions: -partition-size 2048
verbose: true
- name: Archive Espresso results
uses: actions/[email protected]
if: ${{ always() }}
with:
name: MediaPipe-Espresso-report
path: ./**/build/reports/androidTests/connected/
- name: Save logcat output
uses: actions/upload-artifact@master
if: ${{ always() }}
with:
name: MediaPipe-logcat
path: artifacts/logcat.log
- name: Archive screenshots
uses: actions/[email protected]
if: ${{ always() }}
with:
name: MediaPipe-Screenshots
path: screenshots/adb/
- name: Keep apk
uses: actions/[email protected]
if: ${{ always() }}
with:
name: MediaPipe-apk
path: ./**/build/outputs/apk/debug/*.apk
retention-days: 2
- name: cleanup keystore
run: ./signing/cleanup.sh
Check:
Expand Down
42 changes: 42 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,45 @@ static def getGitOriginRemote() {
def found = values.find { it.startsWith("origin") && it.endsWith("(push)") }
return found.replace("origin", "").replace("(push)", "").replace(".git", "").trim()
}

def adbDirectory = '/storage/emulated/0/Download' // api 28
//def adbDirectory = '/storage/self/primary/Download' // api 21
def reportsDirectory = "$projectDir/../screenshots/adb"

def clearScreenshotsTask = task('clearScreenshots', type: Exec) {
println "clearScreenshotsTask"
executable "${android.getAdbExe().toString()}"
args 'shell', 'rm', '-r', adbDirectory
}

def createScreenshotDirectoryTask = task('createScreenshotDirectory', type: Exec, group: 'reporting') {
println "createScreenshotDirectoryTask"
executable "${android.getAdbExe().toString()}"
args 'shell', 'mkdir', '-p', adbDirectory
}

def fetchScreenshotsTask = task('fetchScreenshots', type: Exec, group: 'reporting') {
println "fetchScreenshotsTask"
executable "${android.getAdbExe().toString()}"
args 'pull', adbDirectory + '/.', reportsDirectory

dependsOn {
createScreenshotDirectoryTask
}

doFirst {
new File(reportsDirectory).mkdirs()
}
}

tasks.whenTaskAdded { task ->
if (task.name == 'connectedDebugAndroidTest' || task.name == 'connectedCodeDebugAndroidTest') {
task.mustRunAfter {
clearScreenshotsTask
createScreenshotDirectoryTask
}
task.finalizedBy {
fetchScreenshotsTask
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package info.mediapipe.multihand.app

import android.Manifest
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import android.view.View
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.GrantPermissionRule
import com.bmwgroup.idnext.test.assertions.WaitingAssertion
import com.moka.utils.Screenshot
import info.mediapipe.app.R
import info.mediapipe.app.multihand.MultiHandActivity
Expand All @@ -23,12 +21,15 @@ class SmokeTest {

@get:Rule
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE)

@Test
fun smokeTestSimplyStart() {
onView(withId(R.id.preview_display_layout)).check(matches(isDisplayed()))
Screenshot.takeScreenshot("smoke")
Screenshot.takeScreenshot("start")
WaitingAssertion.assertVisibility(R.id.preview_display_layout, View.VISIBLE, 9000)
// onView(withId(R.id.preview_display_layout)).check(matches(isDisplayed()))
Screenshot.takeScreenshot("end")
}
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
android:name=".HandApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:installLocation="auto"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx2536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
Binary file added library/src/main/jniLibs/x86/libopencv_java3.so
Binary file not shown.
Binary file not shown.