[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2020-04-14 Thread jenk...@attrib.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Karl Fritsche commented on  JENKINS-55313  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
 If you find a better solution, feel free to update here   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.196401.154549568.11085.1586878980158%40Atlassian.JIRA.


[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2020-04-14 Thread gau...@dream11.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gaurav P commented on  JENKINS-55313  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
 ok thanks for update   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.196401.154549568.10965.1586876640144%40Atlassian.JIRA.


[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2020-04-14 Thread jenk...@attrib.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Karl Fritsche edited a comment on  JENKINS-55313  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
 My current workaround is not using the plugin. I use a shell script with the following content:{code}# doing android emulator stuff manual$ANDROID_HOME/platform-tools/adb start-server$ANDROID_HOME/emulator/emulator -prop persist.sys.language=de -prop persist.sys.country=DE -avd $AVD_IMAGE -no-window -no-audio &EMULATOR_PID=$!# Wait for Android to finish bootingWAIT_CMD="$ANDROID_HOME/platform-tools/adb wait-for-device shell getprop init.svc.bootanim"until $WAIT_CMD | grep -m 1 stopped; do  echo "Waiting..."  sleep 1done[ -d build ] || mkdir build$ANDROID_HOME/platform-tools/adb shell logcat -v time > build/logcat.log &LOGCAT_PID=$!$ANDROID_HOME/platform-tools/adb shell wm dismiss-keyguard$ANDROID_HOME/platform-tools/adb shell input keyevent 4# run tests./gradlew --continue test lint connectedAndroidTest || echo "failed"# Stop the background processeskill $LOGCAT_PIDkill $EMULATOR_PID{code}Its not super stable and sometimes it fails and if I just rerun it, it works. Didn't figured out if it is because of the setup or because of a bad test on our side. ANDROID_HOME is a global envoirment variable and I have a second job which force updates all images, each week.{code}yes | $ANDROID_HOME/tools/bin/sdkmanager --update$ANDROID_HOME/tools/bin/avdmanager delete avd -n pixel_23 || true$ANDROID_HOME/tools/bin/avdmanager create avd -n pixel_23 -d pixel -k "system-images;android-23;default;x86" --force$ANDROID_HOME/tools/bin/avdmanager delete avd -n pixel_24 || true$ANDROID_HOME/tools/bin/avdmanager create avd -n pixel_24 -d pixel -k "system-images;android-24;default;x86" --force$ANDROID_HOME/tools/bin/avdmanager delete avd -n pixel_26 || true$ANDROID_HOME/tools/bin/avdmanager create avd -n pixel_26 -d pixel -k "system-images;android-26;default;x86_64" --force$ANDROID_HOME/tools/bin/avdmanager delete avd -n pixel_28 || true$ANDROID_HOME/tools/bin/avdmanager create avd -n pixel_28 -d pixel -k "system-images;android-28;default;x86" --force$ANDROID_HOME/tools/bin/avdmanager delete avd -n nexus10_28 || true$ANDROID_HOME/tools/bin/avdmanager create avd -n nexus10_28 -d "Nexus 10" -k "system-images;android-28;default;x86_64" --force{code}AVD_IMAGE is a select parameter for this job. I have a third job (matrix job), which then calls this job with all images.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 
  

[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2020-04-14 Thread jenk...@attrib.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Karl Fritsche commented on  JENKINS-55313  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
 My current workaround is not using the plugin.  I use a shell script with the following content: 

 

# doing android emulator stuff manual
$ANDROID_HOME/platform-tools/adb start-server
$ANDROID_HOME/emulator/emulator -prop persist.sys.language=de -prop persist.sys.country=DE -avd $AVD_IMAGE -no-window -no-audio &
EMULATOR_PID=$!

# Wait for Android to finish booting
WAIT_CMD="$ANDROID_HOME/platform-tools/adb wait-for-device shell getprop init.svc.bootanim"
until $WAIT_CMD | grep -m 1 stopped; do
  echo "Waiting..."
  sleep 1
done

[ -d build ] || mkdir build
$ANDROID_HOME/platform-tools/adb shell logcat -v time > build/logcat.log &
LOGCAT_PID=$!
$ANDROID_HOME/platform-tools/adb shell wm dismiss-keyguard
$ANDROID_HOME/platform-tools/adb shell input keyevent 4

# run tests
./gradlew --continue test lint connectedAndroidTest || echo "failed"

# Stop the background processes
kill $LOGCAT_PID
kill $EMULATOR_PID
 

 Its not super stable and sometimes it fails and if I just rerun it, it works. Didn't figured out if it is because of the setup or because of a bad test on our side.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" 

[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2020-04-14 Thread gau...@dream11.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gaurav P commented on  JENKINS-55313  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
 I am also facing the same issue  have you manage to solve it ?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.196401.154549568.10836.1586867760129%40Atlassian.JIRA.


[JIRA] (JENKINS-55313) Gradle support for connectedAndroidTest

2018-12-22 Thread jenk...@attrib.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Karl Fritsche created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-55313  
 
 
  Gradle support for connectedAndroidTest
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Christopher Orr  
 
 
Components: 
 android-emulator-plugin  
 
 
Created: 
 2018-12-22 16:21  
 
 
Environment: 
 Android Emulator 3.0  Android build tools 28.0.3  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Karl Fritsche  
 

  
 
 
 
 

 
 Currently I struggle to get the android emulator running in combination with gradle connectedAndroidTest  The tests are working if I start the emulator manually. Also in the log I see the emulator starts correctly, but I always get  

 
Execution failed for task ':app:connectedDebugAndroidTest'.
> com.android.builder.testing.api.DeviceException: No connected devices! 

 After a while of digging around I found out that the reason is that gradle uses the standard port of the adb to check for emulators and not the newly started from the android emulator plugin. I checked using bash if ANDROID_SERIAL is correctly set (emulator-) and it is, but it seems connectedAndroidTest doesn't pickup the value and checks for that emulator. I wonder if anybody has a hint what to check or how other people using this plugin starting the  connectedAndroidTests?