Skip to content

Commit

Permalink
Fixing pull path to get tests results
Browse files Browse the repository at this point in the history
  • Loading branch information
angelica-oliv committed Aug 21, 2021
1 parent f19d7e8 commit c73ce74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions runtests/src/main/java/io/kranberry/RunTestsPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.gradle.api.provider.Property
interface RunTestsPluginExtension {
val packageName: Property<String>
val packageTests: Property<String>
val applicationId: Property<String>
val apkOutputPath: Property<String>
val androidTestApkOutputPath: Property<String>
val testsRunner: Property<String>
Expand All @@ -25,8 +26,8 @@ class RunTestsPlugin : Plugin<Project> {
task.doLast {
project.exec {
// Pull results
val testsPackage = packageTests.getOrElse(packageName.get())
val pullPath = "/storage/emulated/0/Android/media/$testsPackage"
val resultsPackage = applicationId.getOrElse(packageName.get())
val pullPath = "/storage/emulated/0/Android/media/$resultsPackage"
it.commandLine("bash", "-l", "-c", "rm -rf kranberry-outputs")
it.commandLine("bash", "-l", "-c", "mkdir kranberry-outputs")
it.commandLine("bash", "-l", "-c", "adb pull $pullPath kranberry-outputs")
Expand Down Expand Up @@ -92,12 +93,12 @@ class RunTestsPlugin : Plugin<Project> {
"adb shell logcat -b all -c")

// Configure logcat
it.commandLine("bash", "-l", "-c",
it.commandLine("bash", "-c",
"adb logcat *:S KRANBERRY_LOG:V & LOGCAT_PID=\$\$!",)

// Run tests
val testsPackage = packageTests.getOrElse(packageName.get())
it.commandLine("bash", "-l", "-c",
it.commandLine("bash", "-c",
"adb shell am instrument -w -e package ${packageName.get()} ${testsPackage}/${testsRunner.getOrElse("androidx.test.runner.AndroidJUnitRunner")}" )
}
}.dependsOn(installKranberryTestApks)
Expand Down
2 changes: 1 addition & 1 deletion tools/lib-version.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
PUBLISH_GROUP_ID = 'io.github.kranberry-io'
PUBLISH_VERSION = '1.0-beta'
PUBLISH_VERSION = '1.0.1-beta'
PUBLISH_ARTIFACT_ID = 'kranberry'
}

0 comments on commit c73ce74

Please sign in to comment.