diff --git a/.test-infra/jenkins/job_PostCommit_Go.groovy b/.test-infra/jenkins/job_PostCommit_Go.groovy index 8202cc7ccf3a4f164ff8a0e32f8232216a94c940..c8b4a3a10e207a915c5339514fefb6912801b564 100644 --- a/.test-infra/jenkins/job_PostCommit_Go.groovy +++ b/.test-infra/jenkins/job_PostCommit_Go.groovy @@ -36,6 +36,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_Go', 'Run Go PostCommit', gradle { rootBuildScriptDir(commonJobProperties.checkoutDir) tasks(':goPostCommit') + switches("-Pjenkins") commonJobProperties.setGradleSwitches(delegate) switches('--no-parallel') } diff --git a/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Flink.groovy b/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Flink.groovy index 73790f421690ebef3af8d754989da49d5241113d..48cc10bd499283b26412a6754025a6208136842b 100644 --- a/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Flink.groovy +++ b/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Flink.groovy @@ -32,6 +32,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_Go_VR_Flink', gradle { rootBuildScriptDir(commonJobProperties.checkoutDir) tasks(':sdks:go:test:flinkValidatesRunner') + switches("-Pjenkins") commonJobProperties.setGradleSwitches(delegate) } } diff --git a/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Spark.groovy b/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Spark.groovy index 383d4234749c551b1fc62b2f08d7ecb8fdcad143..7e3e631ceb253e1270b7fdc451476e4c011d9196 100644 --- a/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Spark.groovy +++ b/.test-infra/jenkins/job_PostCommit_Go_ValidatesRunner_Spark.groovy @@ -32,6 +32,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_Go_VR_Spark', gradle { rootBuildScriptDir(commonJobProperties.checkoutDir) tasks(':sdks:go:test:sparkValidatesRunner') + switches("-Pjenkins") commonJobProperties.setGradleSwitches(delegate) } } diff --git a/.test-infra/jenkins/job_PreCommit_Go_Portable.groovy b/.test-infra/jenkins/job_PreCommit_Go_Portable.groovy index 3e0e198d2a8d4bb9b5ac26913771281feca35241..cf620742a0f772a3f5b7b397e3afaadd8d898ff6 100644 --- a/.test-infra/jenkins/job_PreCommit_Go_Portable.groovy +++ b/.test-infra/jenkins/job_PreCommit_Go_Portable.groovy @@ -22,6 +22,7 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder( scope: this, nameBase: 'GoPortable', gradleTask: ':goPortablePreCommit', + gradleSwitches: ['-Pjenkins'], triggerPathPatterns: [ '^model/.*$', '^sdks/go/.*$', diff --git a/build.gradle.kts b/build.gradle.kts index 05f6856d77339501da07efecea5414051af4b0d4..2c913a6b36dca194ad0fbcbefa2d803df7f12efb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -215,7 +215,7 @@ task("goPrecommitBuild") { } task("goPortablePreCommit") { - dependsOn(":sdks:go:test:ulrValidatesRunnerJenkins") + dependsOn(":sdks:go:test:ulrValidatesRunner") } task("goPostCommit") { diff --git a/sdks/go/test/build.gradle b/sdks/go/test/build.gradle index 0e8d5e5d8cf67de0f120571aad1ec5c34f03cfff..ae2253a810a9257d1673dd887df5a8031ebb3d21 100644 --- a/sdks/go/test/build.gradle +++ b/sdks/go/test/build.gradle @@ -63,6 +63,9 @@ task dataflowValidatesRunner() { "--dataflow_worker_jar ${project(":runners:google-cloud-dataflow-java:worker").shadowJar.archivePath}", "--expansion_service_jar ${project(":sdks:java:testing:expansion-service").buildTestExpansionServiceJar.archivePath}", ] + if (project.hasProperty("jenkins")) { // Needed when running this task on Jenkins. + options.add("--jenkins") + } exec { executable "sh" args "-c", "./run_validatesrunner_tests.sh ${options.join(' ')}" @@ -83,6 +86,9 @@ task flinkValidatesRunner { "--flink_job_server_jar ${project(":runners:flink:${project.ext.latestFlinkVersion}:job-server").shadowJar.archivePath}", "--expansion_service_jar ${project(":sdks:java:testing:expansion-service").buildTestExpansionServiceJar.archivePath}", ] + if (project.hasProperty("jenkins")) { // Needed when running this task on Jenkins. + options.add("--jenkins") + } exec { executable "sh" args "-c", "./run_validatesrunner_tests.sh ${options.join(' ')}" @@ -102,6 +108,9 @@ task sparkValidatesRunner { "--spark_job_server_jar ${project(":runners:spark:2:job-server").shadowJar.archivePath}", "--expansion_service_jar ${project(":sdks:java:testing:expansion-service").buildTestExpansionServiceJar.archivePath}", ] + if (project.hasProperty("jenkins")) { // Needed when running this task on Jenkins. + options.add("--jenkins") + } exec { executable "sh" args "-c", "./run_validatesrunner_tests.sh ${options.join(' ')}" @@ -128,34 +137,9 @@ task ulrValidatesRunner { "--runner portable", "--expansion_service_jar ${project(":sdks:java:testing:expansion-service").buildTestExpansionServiceJar.archivePath}", ] - exec { - executable "sh" - workingDir "${project.rootDir}/sdks/python" - args "-c", ". ${envdir}/bin/activate && pip install -e ." + if (project.hasProperty("jenkins")) { // Needed when running this task on Jenkins. + options.add("--jenkins") } - exec { - executable "sh" - args "-c", ". ${envdir}/bin/activate && ./run_validatesrunner_tests.sh ${options.join(' ')}" - } - } -} - -// A slightly modified version of the normal ulrValidatesRunner task, this -// one passes in an extra flag to the script so it is configured to run on -// Jenkins. -task ulrValidatesRunnerJenkins { - dependsOn ":sdks:go:test:goBuild" - dependsOn ":sdks:go:container:docker" - dependsOn ":sdks:java:container:java11:docker" - dependsOn "setupVirtualenv" - dependsOn ":sdks:python:buildPython" - dependsOn ":sdks:java:testing:expansion-service:buildTestExpansionServiceJar" - doLast { - def options = [ - "--runner portable", - "--expansion_service_jar ${project(":sdks:java:testing:expansion-service").buildTestExpansionServiceJar.archivePath}", - "--jenkins", - ] exec { executable "sh" workingDir "${project.rootDir}/sdks/python" @@ -166,4 +150,4 @@ task ulrValidatesRunnerJenkins { args "-c", ". ${envdir}/bin/activate && ./run_validatesrunner_tests.sh ${options.join(' ')}" } } -} +} \ No newline at end of file