I use this workflow below, however, sometime I got this error:
Tests on Android_Emulator(AVD) - 5.1.1 failed: Instrumentation run failed due to 'Process crashed.'
com.android.builder.testing.ConnectedDevice > No tests found.[Android_Emulator(AVD) - 5.1.1] FAILED
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
:my-app:connectedAndroidTest FAILED
FAILURE: Build failed with an exception.
Sometime, everything works fine.
My instrument test is very simple and I only do one test. Do you have any idea for that issue?
Here is my workflow:
MY_WORKFLOW:
steps:
- activate-ssh-key@3.1.1:
title: Activate App SSH key
inputs:
- ssh_key_save_path: "$HOME/.ssh/steplib_ssh_step_id_rsa"
- git-clone@3.4.1: {}
- script@1.1.3:
title: Copy Android Licenses
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x
echo y | android update sdk --no-ui --all --filter build-tools-23.0.2 | grep 'package installed'
echo y | android update sdk --no-ui --all --filter addon-google_apis-google-22
echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-google_apis-22 | grep 'package installed'
if [ -d "./android-licenses/" ]; then
rsync -avhP ./android-licenses/ "$ANDROID_HOME/licenses/"
fi
- create-android-emulator@1.0.0:
inputs:
- name: "$BITRISE_EMULATOR_NAME"
- platform: android-22
- custom_hardware_profile_content: ''
- start-android-emulator@1.1.1: {}
- gradle-runner@1.5.4:
inputs:
- gradle_file: "$BITRISE_PROJECT_PATH"
- gradle_task: connectedAndroidTest
opts:
is_expand: false
- script@1.1.3:
title: Kill all emulators
is_always_run: true
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x
ls -l /opt/android-sdk-linux/tools/
adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done
- deploy-to-bitrise-io@1.2.7:
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/my-app/build/reports/androidTests/connected/flavors/"
- notify_user_groups: none
- notify_email_list: ''
before_run:
after_run: