特拉维斯CI跳跃测试(摇篮Android项目) [英] Travis CI skip tests (Gradle Android project)
问题描述
现在我配置特拉维斯CI为我的基于摇篮,Android项目。是否有可能临时禁止测试发射特拉维斯才知道 - 如果项目可兴建与否
Now I'm configuring Travis CI for my Gradle-based Android project. Is it possible to temporary disable tests launch from Travis to just know - if project could be built or not?
推荐答案
默认情况下特拉维斯慈执行时./gradlew建立connectedCheck如果没有'脚本:'部分中找到
By default Travis-ci executes './gradlew build connectedCheck' if no 'script:' section found.
您可以在所有被测试的模块添加到您的build.gradle
You can add this to your build.gradle on all the tested modules
project.gradle.taskGraph.whenReady {
connectedAndroidTest {
ignoreFailures = true
}
}
所以失败的测试被忽略。请在所有测试模块是一样的。
So failed tests are ignored. Do the same on all the modules tested.
另一种选择是,你只能使用'./gradlew建设为脚本。或./gradle构建如果你不使用包装的gradle
Other option is that you only use './gradlew build' as the script. Or './gradle build' if you are not using gradle wrapper.
install:
# Check install section: http://docs.travis-ci.com/user/build-configuration/#install
# If you'd like to skip the install stage entirely, set it to true and nothing will be run.
- true
script:
# By default Travis-ci executes './gradlew build connectedCheck' if no 'script:' section found.
- ./gradlew build
所以测试不执行。
So tests are not performed.
这篇关于特拉维斯CI跳跃测试(摇篮Android项目)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!