android-espresso – CircleCi 2.0上是否提供针对Android Espresso的Instrumentation测试?

CircleCI 2.0上是否提供针对
Android Espresso的Instrumentation测试?

如果是的话,有人可以帮忙为我配置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

此配置的唯一问题是,由于没有足够的内存错误,它不会导致成功构建.如果有人有更好的配置,请分享.

点赞