Skip to content
代码片段 群组 项目
提交 f59aef26 编辑于 作者: Daniel Oliveira's avatar Daniel Oliveira
浏览文件

[BEAM-12060] Fix failing Go Postcommits, jenkins support for Gradle tasks.

This fixes the Flink and Spark Postcommits failing after some gradle tasks were changed. This was due to not enabling Jenkins support for the changed gradle tasks for the Postcommits which run on Jenkins. In addition to fixing that, this change adjusts the way that Jenkins support is enabled. Instead of creating a whole new task to run integration tests with Jenkins, the tasks now check a project property.
上级 5ddb69f4
No related branches found
No related tags found
无相关合并请求
......@@ -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')
}
......
......@@ -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)
}
}
......
......@@ -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)
}
}
......
......@@ -22,6 +22,7 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'GoPortable',
gradleTask: ':goPortablePreCommit',
gradleSwitches: ['-Pjenkins'],
triggerPathPatterns: [
'^model/.*$',
'^sdks/go/.*$',
......
......@@ -215,7 +215,7 @@ task("goPrecommitBuild") {
}
task("goPortablePreCommit") {
dependsOn(":sdks:go:test:ulrValidatesRunnerJenkins")
dependsOn(":sdks:go:test:ulrValidatesRunner")
}
task("goPostCommit") {
......
......@@ -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
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册