Gradle依赖于自己的任务。 如何在liquibase和docker-compose之后运行Inttesting

所以我有集成testing,要求我首先通过docker-compose启动一些东西(mySql,kafka和更多),然后执行一个Gradle任务,执行liquibase更新。 我现在呢

task integrationTest(type: Test) { // Load classes explicit - is needed, because integration is a custom type testClassesDir = sourceSets.integration.output.classesDir classpath = sourceSets.integration.runtimeClasspath activate docker-compose dockerCompose { useComposeFiles = ['docker-compose-integration-test.yml'] } runLiquibase.dependsOn(composeUp) integrationTest.dependsOn(composeUp) integrationTest.finalizedBy(composeDown) useJUnit() testLogging.showStandardStreams = true afterTest { desc, result -> println "Executing integration test ${desc.name} [${desc.className}] with result: ${result.resultType}" } } 

我怎样才能让integrationTest的执行取决于runLiquibase任务的成功完成? 我将不得不写入dependsOn括号,以便在它之后开始? 我应该只是在一个做最后的{}?

Interesting Posts