pawelpasterz commented on a change in pull request #10878: Implement precommit 
portability test to run on java 11
URL: https://github.com/apache/beam/pull/10878#discussion_r384694088
 
 

 ##########
 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", "-Dorg.gradle.java.home=${java11Home}"
 
 Review comment:
   @lukecwik thanks for input!
   Before you proceed with my comment just keep in mind I am not gradle ninja :)
   I am totally aware it is not best/good-looking solution. TBH, it's the only 
one I figured out.
   I've checked and "main" task is waiting till sub task is finished, then it 
proceeds.`runFnApiTest` runs as last one (well `cleanUpDockerImages` runs as 
last) in this jenkins job. But my point is, it's the last (and only) task that 
produces output (results from tests).
   I am doing my best but please, feel free to give me some guidance if you 
have an idea how this could be accomplished.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to