beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [beam] pawelpasterz commented on a change in pull request #10878: Implement precommit portability test to run on java 11
Date Wed, 26 Feb 2020 23:53:14 GMT
pawelpasterz commented on a change in pull request #10878: Implement precommit portability
test to run on java 11

 File path: runners/google-cloud-dataflow-java/examples/build.gradle
 @@ -97,6 +97,42 @@ task verifyPortabilityApi() {
   dependsOn verifyFnApiWorker
+def passedDockerImageName = project.findProperty('passedDockerImageName')
+def java8Home = project.findProperty('java8Home')
+def java11Home = project.findProperty('java11Home')
+task runFnApiTest(type: Test) {
+    def dataflowWorkerJar = project.findProperty('dataflowWorkerJar') ?: project(":runners:google-cloud-dataflow-java:worker").shadowJar.archivePath
+    with commonConfig(dataflowWorkerJar, passedDockerImageName, ["--experiments=${fnapiExperiments}"])
+    useJUnit {
+        excludeCategories 'org.apache.beam.sdk.testing.StreamingIT'
+    }
+task verifyFnApiWorkerJava11(type: Test) {
+    dependsOn ":runners:google-cloud-dataflow-java:worker:shadowJar"
+    dependsOn ":runners:google-cloud-dataflow-java:buildAndPushDockerContainer"
+    doLast {
+        exec {
+            workingDir "${rootProject.projectDir}"
+            commandLine "./gradlew", "${project.path}:runFnApiTest", "-Pjava8Home=${java8Home}",
"-PcompileWithJava8", "-PpassedDockerImageName=${dockerImageName}", "-x shadowJar", "-x shadowTestJar",
"-x jar", "-x testJar", "-x classes", "-x testClasses", "-PdisableSpotlessCheck=true", "${java11Home}"
 Review comment:
   > @Ardagan can you please help out?
   > If you want to use a single gradle command, you typically need to build different
variants as separate artifacts. e.g. produce Java 11 classes/jar and Java 8 classes/jar and
use the correct JVM when doing so in the compileJava and compileTestJava tasks (and ensure
that the [JavaCompile](
task is configured to use the correct JVM). For running tests, you have to configure the [Test](
to use the correct JVM.
   > Anything that relies on independent gradle executions needs to perform all the artifact
copying/moving between executions to ensure that output isn't overwritten/corrupted between
Gradle runs.
   At line L123 I set javaHome for `AbstractCompile` tasks. 
   I forgot to add link jenkins job that tested this solution [JOB](

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message