CircleCI 2.0 Android Espresso找不到配置,也没有测试错误

时间:2018-09-11 19:49:55

标签: android circleci-2.0

在CircleCI上部署具有Espresso测试的应用程序后,出现“无配置”和“无测试”错误。 Espresso测试在Android Studio上本地正常运行。

  1. 提交后,CI作业将运行并失败,并显示“找不到配置”错误。错误的详细信息如下:

    #!/bin/sh -eo pipefail
    #No configuration was found in your project. Please refer to https://circleci.com/docs/2.0/ to get started with your configuration.
    false
    Exited with code 1
    
  2. 当我在Circle-CI上手动设置和构建项目时,我看到它从开始构建->启动容器->启用SSH->恢复源缓存->使用部署密钥xxx签出开始直到禁用SSH,然后显示“ NO TESTS”错误。

下面是我的.circleci/config.yml

version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      # Android the primary container
      - image: circleci/android:api-26-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - restore_cache:
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
      - 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-27;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-16;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 connectedAndroidTest
      - store_artifacts:
          path: app/build/reports
          destination: reports
      - store_test_results:
          path: app/build/test-results

我的应用的SDK详细信息为:

compileSdkVersion 27
minSdkVersion 15
targetSdkVersion 27

我尝试将Docker映像版本也更改为api-25-alfa和api-27-alfa。我是CircleCI的新手。

我有cross-posted this to the CircleCI discussion forum

1 个答案:

答案 0 :(得分:0)

映射到Circle CI的git hub仓库是包含.circleci/config.yml的实际项目目录的上一级。看来这是Circle CI无法找到我的配置的原因。我创建了一个新的存储库,并向其中提交了项目内容,包括.circleci,并将其添加到Circle CI中,两个问题都得到解决。