Hi,
I am building my application with CircleCI. My Instrument tests were running just fine until I extended those with more complicated tests including IdlingResource and wait for response over 3 minutes, then I started to get this error on the console.
com.salihgueler.SampleActivityTest > sampleActivityTest[test(AVD) - 5.0.2] FAILED
Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.''. Check device logcat for details
Tests on test(AVD) - 5.0.2 failed: Instrumentation run failed due to 'Process crashed.'
:app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> There were failing tests. See the report at: file:///home/circleci/code/app/build/reports/androidTests/connected/index.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 40s
112 actionable tasks: 54 executed, 58 up-to-date
Exited with code 1
And here is my yaml file
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --recursive
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# - run:
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
# command: sudo chmod +x ./gradlew
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run LintTests
command: ./gradlew lint test
- run:
name: Run UnitTests
command: ./gradlew testDebugUnitTest
- run:
name: Setup emulator
command: sdkmanager "system-images;android-21;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test --device 8 -k "system-images;android-21;default;armeabi-v7a"
- run:
name: Launch emulator
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel auto -verbose
background: true
- run:
name: Wait emulator
command: |
# wait for it to have booted
circle-android wait-for-boot
# unlock the emulator screen
sleep 30
adb shell input keyevent 82
- run:
name: Run EspressoTests
command: ./gradlew connectedDebugAndroidTest
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
I have tried almost everything and unless I have simplified tests, it’s not working. I am open to every suggestion. Thank you for your help.
Best,
Salih.