【问题标题】:CircleCI 2.0 Android Espresso No config found and No Tests ErrorsCircleCI 2.0 Android Espresso 没有找到配置并且没有测试错误
【发布时间】:2018-09-11 19:49:54
【问题描述】:

在 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 上手动设置和构建项目时,我看到它正在从 Start the build--> Start Container -->Enable SSH -->Restore source cache --> Checkout using deploy key 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

【问题讨论】:

  • 同时交叉发布到多个频道通常是不受欢迎的,因为这可能被视为对您不希望加入的社区的“驱车”请求。但是,如果您必须这样做,最好通过链接到每个副本来声明您已这样做,以免浪费可能花时间创建重复答案的人的时间。
  • 感谢您提供良好的做法。在花了几个小时解决问题后,当我无法找到解决方案时,然后将其发布在 Circle CI 上,因为这是一个与circle ci 相关的问题,并且在这里堆栈溢出以寻求更大论坛的帮助。但是,同意我应该在我的帖子中提到这一点。
  • 对于这一行:命令: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 我找不到 emulator64-arm 命令,你知道为什么吗?

标签: android circleci-2.0


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-27
    • 1970-01-01
    • 1970-01-01
    • 2021-10-26
    • 2019-09-29
    相关资源
    最近更新 更多