diff --git a/build.gradle b/build.gradle index aa1bae1b225c..115ae03e0638 100644 --- a/build.gradle +++ b/build.gradle @@ -164,6 +164,7 @@ task javaPostCommit() { dependsOn ":sdks:java:extensions:zetasketch:postCommit" dependsOn ":sdks:java:io:google-cloud-platform:postCommit" dependsOn ":sdks:java:io:kinesis:integrationTest" + dependsOn ":sdks:java:extensions:ml:postCommit" dependsOn ":javaHadoopVersionsTest" dependsOn ":sdks:java:io:kafka:kafkaVersionsCompatibilityTest" } diff --git a/sdks/java/extensions/ml/build.gradle b/sdks/java/extensions/ml/build.gradle index 9139caf78fdc..d7ab4caabb5e 100644 --- a/sdks/java/extensions/ml/build.gradle +++ b/sdks/java/extensions/ml/build.gradle @@ -44,11 +44,30 @@ dependencies { testRuntimeOnly project(":runners:google-cloud-dataflow-java") } -project.test { - def gcpProject = project.findProperty("gcpProject") ?: 'apache-beam-testing' - include "**/**IT.class" - def pipelineOptions = [ - "--project=${gcpProject}" - ] - systemProperty "beamTestPipelineOptions", JsonOutput.toJson(pipelineOptions) +/** + * These are integration tests with the GCP ML services and the DirectRunner. + */ +task integrationTest(type: Test) { + group = "Verification" + def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing' + def gcpTempRoot = project.findProperty('gcpTempRoot') ?: 'gs://temp-storage-for-end-to-end-tests' + systemProperty "beamTestPipelineOptions", JsonOutput.toJson([ + "--runner=DirectRunner", + "--project=${gcpProject}", + "--tempRoot=${gcpTempRoot}", + ]) + + // Disable Gradle cache: these ITs interact with live service that should always be considered "out of date" + outputs.upToDateWhen { false } + + include '**/*IT.class' + maxParallelForks 4 + classpath = sourceSets.test.runtimeClasspath + testClassesDirs = sourceSets.test.output.classesDirs +} + +task postCommit { + group = "Verification" + description = "Integration tests of ML service connectors using the DirectRunner." + dependsOn integrationTest }