[英]Travis CI skip tests (Gradle Android project)
現在我正在為基於Gradle的Android項目配置Travis CI。 是否可以臨時禁用從Travis啟動的測試,只知道 - 是否可以構建項目?
默認情況下,如果找不到script:
部分,Travis-ci將執行./gradlew build connectedCheck
。
如果將下一個代碼添加到所有測試模塊( build.gradle
文件),則會忽略失敗的測試。
project.gradle.taskGraph.whenReady {
connectedAndroidTest {
ignoreFailures = true
}
}
另一種選擇是跳過安裝階段,只使用./gradlew build
(或./gradle build
而不使用gradle包裝器),因此不執行測試。
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
您可以使用-x
命令行參數來排除任何任務( 請參閱此答案 )。
gradle build -x test
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.