【发布时间】:2018-05-03 05:17:03
【问题描述】:
我在gradle.properties 中有org.gradle.parallel=true。我正在运行一个后端 Google Cloud 模块,并同时运行一个 connectedAndroidTest 来执行一些 Espresso 测试。测试成功,任务以绿色显示正常(见图),但连接的测试任务从未真正完成自身或打印该行,并且它不会移动到队列中的下一个任务。
如果我自己运行任务,它会结束并打印该行。
我的根 build.gradle 文件:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
// Task to set up GCE, runs paid flavor test and shuts down the server.
task configureTest {
dependsOn 'startBackend', 'runInstrumentedTest', 'stopBackend'
doLast {
println 'Tests carried out and local server shut down'
}
}
task startBackend {
dependsOn ':backend:appengineRun'
}
// Run InstrumentedTest only in paid flavor as there is no interstitial ad.
task runInstrumentedTest {
mustRunAfter 'startBackend'
dependsOn ':app:connectedPaidDebugAndroidTest'
doLast {
println 'The test finished.'
}
}
task stopBackend
mustRunAfter 'runInstrumentedTest'
dependsOn ':backend:appengineStop'
}
【问题讨论】:
标签: android google-app-engine gradle google-cloud-platform google-cloud-endpoints