diff --git a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Direct.groovy b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Direct.groovy index d8362c1e1e53..0bc3ca684016 100644 --- a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Direct.groovy +++ b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Direct.groovy @@ -27,7 +27,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Direct', description('Runs the CrossLanguageValidatesRunner suite on the Direct runner.') // Set common parameters. - commonJobProperties.setTopLevelMainJobProperties(delegate) + commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 120) // Publish all test results to Jenkins publishers { @@ -43,6 +43,8 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Direct', tasks(':sdks:python:test-suites:direct:xlang:validatesCrossLanguageRunner') commonJobProperties.setGradleSwitches(delegate) switches("-PpythonVersion=${pythonVersion}") + // only run non-python task (e.g. GoUsingJava) once + switches("-PskipNonPythonTask=${pythonVersion != CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS[0]}") } } } diff --git a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Flink.groovy b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Flink.groovy index 828b51bf5c1e..0d2a8612bdfe 100644 --- a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Flink.groovy +++ b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Flink.groovy @@ -44,6 +44,8 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Flink', tasks(":runners:flink:${CommonTestProperties.getFlinkVersion()}:job-server:validatesCrossLanguageRunner") commonJobProperties.setGradleSwitches(delegate) switches("-PpythonVersion=${pythonVersion}") + // only run non-python task (e.g. GoUsingJava) once + switches("-PskipNonPythonTask=${pythonVersion != CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS[0]}") } } } diff --git a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Samza.groovy b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Samza.groovy index ba273dadae1a..1319fdec1fcc 100644 --- a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Samza.groovy +++ b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Samza.groovy @@ -44,6 +44,8 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Samza', tasks(":runners:samza:job-server:validatesCrossLanguageRunner") commonJobProperties.setGradleSwitches(delegate) switches("-PpythonVersion=${pythonVersion}") + // only run non-python task (e.g. GoUsingJava) once + switches("-PskipNonPythonTask=${pythonVersion != CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS[0]}") } } } diff --git a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark.groovy b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark.groovy index 610d5efec2c4..2cf4edb88f12 100644 --- a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark.groovy +++ b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark.groovy @@ -43,6 +43,8 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Spark', tasks(':runners:spark:2:job-server:validatesCrossLanguageRunner') commonJobProperties.setGradleSwitches(delegate) switches("-PpythonVersion=${pythonVersion}") + // only run non-python task (e.g. GoUsingJava) once + switches("-PskipNonPythonTask=${pythonVersion != CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS[0]}") } } } diff --git a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark3.groovy b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark3.groovy index de2d925c4d24..eec4eac88278 100644 --- a/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark3.groovy +++ b/.test-infra/jenkins/job_PostCommit_CrossLanguageValidatesRunner_Spark3.groovy @@ -43,6 +43,8 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_XVR_Spark3', tasks(':runners:spark:3:job-server:validatesCrossLanguageRunner') commonJobProperties.setGradleSwitches(delegate) switches("-PpythonVersion=${pythonVersion}") + // only run non-python task (e.g. GoUsingJava) once + switches("-PskipNonPythonTask=${pythonVersion != CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS[0]}") } } } diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy index c9b558b48f8f..4d9c2109b751 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy @@ -2392,7 +2392,7 @@ class BeamModulePlugin implements Plugin { "python_port": pythonPort ] def serviceArgs = project.project(':sdks:python').mapToArgString(expansionServiceOpts) - def pythonContainerSuffix = project.project(':sdks:python').pythonVersion == '2.7' ? '2' : project.project(':sdks:python').pythonVersion.replace('.', '') + def pythonContainerSuffix = project.project(':sdks:python').pythonVersion.replace('.', '') def javaContainerSuffix if (JavaVersion.current() == JavaVersion.VERSION_1_8) { javaContainerSuffix = 'java8' @@ -2534,9 +2534,13 @@ class BeamModulePlugin implements Plugin { dependsOn setupTask dependsOn config.startJobServer } - mainTask.configure{dependsOn goTask} - cleanupTask.configure{mustRunAfter goTask} - config.cleanupJobServer.configure{mustRunAfter goTask} + // CrossLanguageValidatesRunnerTask is setup under python sdk but also runs tasks not involving + // python versions. set 'skipNonPythonTask' property to avoid duplicated run of these tasks. + if (!(project.hasProperty('skipNonPythonTask') && project.skipNonPythonTask == 'true')) { + mainTask.configure { dependsOn goTask } + } + cleanupTask.configure { mustRunAfter goTask } + config.cleanupJobServer.configure { mustRunAfter goTask } } /** ***********************************************************************************************/ @@ -2795,7 +2799,7 @@ class BeamModulePlugin implements Plugin { } project.ext.getVersionSuffix = { String version -> - return version == '2.7' ? '2' : version.replace('.', '') + return version.replace('.', '') } project.ext.getVersionsAsList = { String propertyName -> diff --git a/sdks/python/test-suites/direct/common.gradle b/sdks/python/test-suites/direct/common.gradle index 763e96ff6d21..f164a1d358b4 100644 --- a/sdks/python/test-suites/direct/common.gradle +++ b/sdks/python/test-suites/direct/common.gradle @@ -17,7 +17,7 @@ */ def pythonVersionSuffix = project.ext.pythonVersion.replace('.', '') -def pythonContainerVersion = project.ext.pythonVersion == '2.7' ? '2' : project.ext.pythonVersion +def pythonContainerVersion = project.ext.pythonVersion def runScriptsDir = "${rootDir}/sdks/python/scripts" // Basic test options for ITs running on Jenkins. def basicTestOpts = [