gpt4 book ai didi

circleci - CircleCi 2.0 上是否提供 Android Espresso 的仪器测试?

转载 作者:行者123 更新时间:2023-12-03 06:38:03 27 4
gpt4 key购买 nike

CircleCI 2.0 上是否提供 Android Espresso 的仪器测试?如果是的话,有人可以帮我配置 config.yml 文件吗?我已经尝试了数千次,但没有成功。我可以运行单元测试,但不能运行 Instrumentation。

谢谢

最佳答案

这个问题的答案是:是的。 CircleCi 可以进行仪器测试。这是我的配置:

version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- 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: Setup emulator
command: sdkmanager "system-images;android-25;google_apis;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;google_apis;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 on
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 Tests
command: ./gradlew connectedAndroidTest
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results

此配置的唯一问题是由于内存不足错误而无法成功构建。如果有人有更好的配置,请分享。

关于circleci - CircleCi 2.0 上是否提供 Android Espresso 的仪器测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49364745/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com