CircleCI 2.0 Android Espresso 未找到配置且无测试错误
CircleCI 2.0 Android Espresso No config found and No Tests Errors
在 CircleCI 上部署带有 Espresso 测试的应用程序后,我收到 "No configuration" 和 "No Tests" 错误。 Espresso 测试在 Android Studio 上本地运行良好。
通过提交,CI 作业运行并失败并出现 "No config found" 错误。错误详情如下:
#!/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
当我在 Circle-CI 上手动设置和构建项目时,我看到它正在从开始构建 --> 启动容器 --> 启用 SSH --> 恢复源缓存--> Checkout using deploy key xxx till Disable SSH,然后显示 "NO TESTS" Error。
下面是我的.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.
的新手
映射到 Circle CI 的 git hub 仓库是包含 .circleci/config.yml
的实际项目目录的上一层。看起来这就是我的配置没有被 Circle CI 找到的原因。我创建了一个新的 repo,将项目的内容提交给它,包括 .circleci
,将其添加到 Circle CI,这两个问题都得到了解决。
在 CircleCI 上部署带有 Espresso 测试的应用程序后,我收到 "No configuration" 和 "No Tests" 错误。 Espresso 测试在 Android Studio 上本地运行良好。
通过提交,CI 作业运行并失败并出现 "No config found" 错误。错误详情如下:
#!/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
当我在 Circle-CI 上手动设置和构建项目时,我看到它正在从开始构建 --> 启动容器 --> 启用 SSH --> 恢复源缓存--> Checkout using deploy key xxx till Disable SSH,然后显示 "NO TESTS" Error。
下面是我的.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.
的新手映射到 Circle CI 的 git hub 仓库是包含 .circleci/config.yml
的实际项目目录的上一层。看起来这就是我的配置没有被 Circle CI 找到的原因。我创建了一个新的 repo,将项目的内容提交给它,包括 .circleci
,将其添加到 Circle CI,这两个问题都得到了解决。