Skip to content

Commit

Permalink
Issue 1116 fix device offline (#1147)
Browse files Browse the repository at this point in the history
* Added adb timeouts.| #1116

* Added printing connected devices after task will be completed.| #1116

* Removed 'adbOptions' block.| #1116

* Added storing "screencap.png" to CI artifacts if a task will fail.| #1116
  • Loading branch information
DenBond7 authored Apr 3, 2021
1 parent 5a0a96c commit a2bbc9d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ auto_cancel:

global_job_config:
env_vars:
- name: ADB_INSTALL_TIMEOUT #https://android.googlesource.com/platform/tools/base/+/bc733f18ec99fe5e14804ec062edc98039d67685/ddmlib/src/main/java/com/android/ddmlib/Device.java#88
value: "10"
- name: SEMAPHORE_GIT_DIR
value: /home/semaphore/git/flowcrypt-android
- name: ANDROID_SDK_ROOT
Expand Down Expand Up @@ -126,6 +128,10 @@ blocks:
epilogue:
always:
commands:
# print debug info about connected device
- echo "Print connected devices"
- adb devices

# store logcat log
- echo "Store logcat log"
- artifact push job --expire-in 1w ~/logcat_log.txt
Expand All @@ -139,4 +145,10 @@ blocks:
commands:
# store tests results
- echo "Store tests results"
- artifact push job --expire-in 1w FlowCrypt/build/reports/
- artifact push job --expire-in 1w FlowCrypt/build/reports/

# store the device's screenshot. it may help to debug a failure
- echo "Store the device's screenshot"
- adb shell screencap -p /sdcard/screencap.png
- adb pull "/sdcard/screencap.png"
- artifact push job --expire-in 1w screencap.png
5 changes: 5 additions & 0 deletions FlowCrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
* Contributors: DenBond7
*/

import com.android.ddmlib.DdmPreferences

import java.text.SimpleDateFormat

//Setting global timeout for apk installation to 10 minutes. We need it for CI
DdmPreferences.setTimeOut(10 * 60 * 1000)

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
Expand Down

0 comments on commit a2bbc9d

Please sign in to comment.