Skip to content

Commit ceee9d0

Browse files
stefan-niedermannAndyScherzinger
authored andcommitted
chore(e2e): Move emulator setup back to CI
Signed-off-by: Stefan Niedermann <[email protected]> Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 3b36e91 commit ceee9d0

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

.github/workflows/e2e.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ jobs:
7878
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
7979
disable-animations: true
8080
script: |
81+
adb shell pm uninstall -k --user 0 com.nextcloud.android.beta || true
82+
wget -q https://download.nextcloud.com/android/dev/latest.apk
83+
adb install latest.apk
84+
adb shell pm grant com.nextcloud.android.beta android.permission.READ_EXTERNAL_STORAGE
8185
adb logcat -c || true
8286
adb logcat -s "E2E" -v color &
87+
adb logcat *:I -v color &
8388
./gradlew :sample:connectedDebugAndroidTest

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ buildscript {
1515
}
1616
}
1717

18-
plugins {
19-
id "de.undercouch.download" version "5.4.0"
20-
}
18+
//plugins {
19+
// id "de.undercouch.download" version "5.4.0"
20+
//}
2121

2222
allprojects {
2323
repositories {

sample/build.gradle

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import com.android.ddmlib.AndroidDebugBridge
2-
import com.android.ddmlib.NullOutputReceiver
3-
4-
import java.util.concurrent.TimeUnit
5-
61
apply plugin: 'com.android.application'
72

83
android {
@@ -33,33 +28,33 @@ android {
3328
}
3429
}
3530

36-
task downloadNextcloudApk(type: Download) {
37-
src 'https://download.nextcloud.com/android/dev/latest.apk'
38-
dest new File(buildDir, 'latest.apk')
39-
overwrite true
40-
}
41-
42-
task setupNextcloudEnvironment(dependsOn: downloadNextcloudApk) {
43-
def bridge = AndroidDebugBridge.createBridge(android.adbExecutable.path, false, 10, TimeUnit.SECONDS)
44-
doLast {
45-
bridge.devices.each { device ->
46-
println "Uninstall Nextcloud apk from ${device.name}"
47-
device.uninstallPackage("com.nextcloud.android.beta")
48-
49-
println "Install Nextcloud apk on ${device.name}"
50-
device.installPackage(new File(buildDir, 'latest.apk').getAbsolutePath(), true)
51-
52-
println "Grant permissions to Nextcloud"
53-
device.executeShellCommand("pm grant com.nextcloud.android.beta android.permission.READ_EXTERNAL_STORAGE", NullOutputReceiver.receiver, 3, TimeUnit.SECONDS)
54-
}
55-
}
56-
}
57-
58-
tasks.whenTaskAdded { taskItem ->
59-
if (taskItem.name.contains("connected") && taskItem.name.endsWith("AndroidTest")) {
60-
taskItem.dependsOn setupNextcloudEnvironment
61-
}
62-
}
31+
//task downloadNextcloudApk(type: Download) {
32+
// src 'https://download.nextcloud.com/android/dev/latest.apk'
33+
// dest new File(buildDir, 'latest.apk')
34+
// overwrite true
35+
//}
36+
//
37+
//task setupNextcloudEnvironment(dependsOn: downloadNextcloudApk) {
38+
// def bridge = AndroidDebugBridge.createBridge(android.adbExecutable.path, false, 10, TimeUnit.SECONDS)
39+
// doLast {
40+
// bridge.devices.each { device ->
41+
// println "Uninstall Nextcloud apk from ${device.name}"
42+
// device.uninstallPackage("com.nextcloud.android.beta")
43+
//
44+
// println "Install Nextcloud apk on ${device.name}"
45+
// device.installPackage(new File(buildDir, 'latest.apk').getAbsolutePath(), true)
46+
//
47+
// println "Grant permissions to Nextcloud"
48+
// device.executeShellCommand("pm grant com.nextcloud.android.beta android.permission.READ_EXTERNAL_STORAGE", NullOutputReceiver.receiver, 3, TimeUnit.SECONDS)
49+
// }
50+
// }
51+
//}
52+
//
53+
//tasks.whenTaskAdded { taskItem ->
54+
// if (taskItem.name.contains("connected") && taskItem.name.endsWith("AndroidTest")) {
55+
// taskItem.dependsOn setupNextcloudEnvironment
56+
// }
57+
//}
6358

6459
dependencies {
6560
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

0 commit comments

Comments
 (0)