diff --git a/.test-infra/jenkins/job_beam_PreCommit_Go_GradleBuild.groovy b/.test-infra/jenkins/job_beam_PreCommit_Go_GradleBuild.groovy new file mode 100644 index 0000000000000000000000000000000000000000..64f358c374162f9a275ec50baedb2c2b70167964 --- /dev/null +++ b/.test-infra/jenkins/job_beam_PreCommit_Go_GradleBuild.groovy @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import common_job_properties + +// This is the Go precommit which runs a gradle build, and the current set +// of precommit tests. +job('beam_PreCommit_Go_GradleBuild') { + description('Runs Go PreCommit tests for the current GitHub Pull Request.') + + // Execute concurrent builds if necessary. + concurrentBuild() + + // Set common parameters. + common_job_properties.setTopLevelMainJobProperties( + delegate, + 'master', + 240) + + def gradle_switches = [ + // Continue the build even if there is a failure to show as many potential failures as possible. + '--continue', + // Until we verify the build cache is working appropriately, force rerunning all tasks + '--rerun-tasks', + ] + + def gradle_command_line = './gradlew ' + gradle_switches.join(' ') + ' :goPreCommit' + // Sets that this is a PreCommit job. + common_job_properties.setPreCommit(delegate, gradle_command_line, 'Run Go Gradle PreCommit') + steps { + gradle { + rootBuildScriptDir(common_job_properties.checkoutDir) + tasks(':goPreCommit') + for (String gradle_switch : gradle_switches) { + switches(gradle_switch) + } + } + } +} diff --git a/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy b/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy index a9989da477eae189cb47ced5b20a4b14a823b332..783421f383cbd4495470400bef6c55fabf3e67af 100644 --- a/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy +++ b/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy @@ -21,7 +21,7 @@ import common_job_properties // This is the Java precommit which runs a Gradle build, and the current set // of precommit tests. job('beam_PreCommit_Java_GradleBuild') { - description('Runs a build of the current GitHub Pull Request.') + description('Runs Java PreCommit tests for the current GitHub Pull Request.') // Execute concurrent builds if necessary. concurrentBuild() diff --git a/build.gradle b/build.gradle index 4cc2a21e7b0967222a67bd1e8ea6b707fac7adac..b4599fc0d7539cb210585ec96479307a91417f0c 100644 --- a/build.gradle +++ b/build.gradle @@ -284,8 +284,11 @@ rat { } check.dependsOn rat -// Define a root Java PreCommit task simplifying what is needed +// Define root PreCommit tasks simplifying what is needed // to be specified on the commandline when executing locally. +// This indirection also makes Jenkins use the branch of the PR +// for the test definitions. + def javaPreCommitRoots = [ ":sdks:java:core", ":runners:direct-java", @@ -298,3 +301,7 @@ task javaPreCommit() { } dependsOn ":examples:java:preCommit" } + +task goPreCommit() { + dependsOn ":sdks:go:test" +}