[
https://issues.apache.org/jira/browse/BEAM-4559?focusedWorklogId=113864&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-113864
]
ASF GitHub Bot logged work on BEAM-4559:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jun/18 18:28
Start Date: 20/Jun/18 18:28
Worklog Time Spent: 10m
Work Description: Ardagan closed pull request #5697: [BEAM-4559] Split
post-commit jobs into automatically triggered and ghprb phrase triggered
URL: https://github.com/apache/beam/pull/5697
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.test-infra/jenkins/JobBuilder.groovy
b/.test-infra/jenkins/JobBuilder.groovy
new file mode 100644
index 00000000000..b419eaa3458
--- /dev/null
+++ b/.test-infra/jenkins/JobBuilder.groovy
@@ -0,0 +1,65 @@
+/*
+ * 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 as cjp
+
+/**
+ * This class is to be used for defining jobs for post- and pre-commit tests.
+ *
+ * Purpose of this class is to define common strategies and reporting/building
paramereters
+ * for pre- and post- commit test jobs and unify them across the project.
+ */
+class JobBuilder {
+ private def scope;
+ private def jobDefinition;
+ private def job;
+
+ private JobBuilder(scope, jobDefinition = {}) {
+ this.scope = scope
+ this.jobDefinition = jobDefinition
+ this.job = null
+ }
+
+ static void postCommitJob(nameBase,
+ triggerPhrase,
+ githubUiHint,
+ scope,
+ jobDefinition = {}) {
+ JobBuilder jb = new JobBuilder(scope, jobDefinition)
+ jb.defineAutoPostCommitJob(nameBase)
+ jb.defineGhprbTriggeredJob(nameBase + "_hgprb", triggerPhrase,
githubUiHint, false)
+ }
+
+ private void defineAutoPostCommitJob(name) {
+ def autoBuilds = scope.job(name) {
+ cjp.setPostCommit(delegate)
+ }
+ autoBuilds.with(jobDefinition)
+ }
+
+ private void defineGhprbTriggeredJob(name, triggerPhrase, githubUiHint,
triggerOnPrCommit) {
+ def ghprbBuilds = scope.job(name) {
+ cjp.setPullRequestBuildTrigger(
+ delegate,
+ githubUiHint,
+ triggerPhrase,
+ !triggerOnPrCommit)
+ }
+ ghprbBuilds.with(jobDefinition)
+ }
+}
diff --git a/.test-infra/jenkins/common_job_properties.groovy
b/.test-infra/jenkins/common_job_properties.groovy
index 84841cd8678..9249745075d 100644
--- a/.test-infra/jenkins/common_job_properties.groovy
+++ b/.test-infra/jenkins/common_job_properties.groovy
@@ -124,11 +124,11 @@ class common_job_properties {
// Sets the pull request build trigger. Accessed through precommit methods
// below to insulate callers from internal parameter defaults.
- private static void setPullRequestBuildTrigger(context,
- String commitStatusContext,
- String prTriggerPhrase = '',
- boolean
onlyTriggerPhraseToggle = true,
- String successComment =
'--none--') {
+ static void setPullRequestBuildTrigger(context,
+ String commitStatusContext,
+ String prTriggerPhrase = '',
+ boolean onlyTriggerPhraseToggle =
true,
+ String successComment = '--none--') {
context.triggers {
githubPullRequest {
admins(['asfbot'])
@@ -229,6 +229,7 @@ class common_job_properties {
boolean triggerEveryPush = true,
String notifyAddress = '[email protected]',
boolean emailIndividuals = true) {
+
// Set build triggers
context.triggers {
// By default runs every 6 hours.
diff --git a/.test-infra/jenkins/job_PostCommit_Go_GradleBuild.groovy
b/.test-infra/jenkins/job_PostCommit_Go_GradleBuild.groovy
index 0c7ae04fa5b..c6f40531593 100644
--- a/.test-infra/jenkins/job_PostCommit_Go_GradleBuild.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Go_GradleBuild.groovy
@@ -17,10 +17,13 @@
*/
import common_job_properties
+import JobBuilder
+
// This is the Go postcommit which runs a gradle build, and the current set
// of postcommit tests.
-job('beam_PostCommit_Go_GradleBuild') {
+JobBuilder.postCommitJob('beam_PostCommit_Go_GradleBuild', 'Run Go PostCommit',
+ './gradlew :goPostCommit', this) {
description('Runs Go PostCommit tests against master.')
// Execute concurrent builds if necessary.
@@ -32,15 +35,6 @@ job('beam_PostCommit_Go_GradleBuild') {
'master',
150)
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate, '15 */6 * * *', false)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- './gradlew :goPostCommit',
- 'Run Go PostCommit')
-
steps {
gradle {
rootBuildScriptDir(common_job_properties.checkoutDir)
diff --git a/.test-infra/jenkins/job_PostCommit_Java_GradleBuild.groovy
b/.test-infra/jenkins/job_PostCommit_Java_GradleBuild.groovy
index 7456ea514d4..eb41d035a09 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_GradleBuild.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_GradleBuild.groovy
@@ -17,10 +17,14 @@
*/
import common_job_properties
+import JobBuilder
+
// This job runs the Java postcommit tests, including the suite of integration
// tests.
-job('beam_PostCommit_Java_GradleBuild') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_GradleBuild', 'Run Java
PostCommit',
+ 'Java SDK Post Commit Tests', this) {
+
description('Runs PostCommit tests on the Java SDK.')
// Execute concurrent builds if necessary.
@@ -34,15 +38,6 @@ job('beam_PostCommit_Java_GradleBuild') {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Java SDK Post Commit Tests',
- 'Run Java PostCommit')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Apex.groovy
b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Apex.groovy
index a76260ab9e2..e9c9331ae76 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Apex.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Apex.groovy
@@ -17,9 +17,11 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of ValidatesRunner tests against the Apex runner.
-job('beam_PostCommit_Java_ValidatesRunner_Apex_Gradle') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_ValidatesRunner_Apex_Gradle',
+ 'Run Apex ValidatesRunner', 'Apache Apex Runner ValidatesRunner Tests',
this) {
description('Runs the ValidatesRunner suite on the Apex runner.')
previousNames('beam_PostCommit_Java_ValidatesRunner_Apex')
previousNames('beam_PostCommit_Java_RunnableOnService_Apex')
@@ -32,15 +34,6 @@ job('beam_PostCommit_Java_ValidatesRunner_Apex_Gradle') {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Apache Apex Runner ValidatesRunner Tests',
- 'Run Apex ValidatesRunner')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Dataflow.groovy
b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Dataflow.groovy
index ac0539bf72b..d61ee0df391 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Dataflow.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Dataflow.groovy
@@ -17,10 +17,14 @@
*/
import common_job_properties
+import JobBuilder
+
// This job runs the suite of ValidatesRunner tests against the Dataflow
// runner.
-job('beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle',
+ 'Run Dataflow ValidatesRunner', 'Google Cloud Dataflow Runner
ValidatesRunner Tests', this) {
+
description('Runs the ValidatesRunner suite on the Dataflow runner.')
previousNames('beam_PostCommit_Java_ValidatesRunner_Dataflow')
previousNames('beam_PostCommit_Java_RunnableOnService_Dataflow')
@@ -33,15 +37,6 @@ job('beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle') {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Google Cloud Dataflow Runner ValidatesRunner Tests',
- 'Run Dataflow ValidatesRunner')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Flink.groovy
b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Flink.groovy
index 07327ff5548..4a935a0f493 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Flink.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Flink.groovy
@@ -17,9 +17,11 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of ValidatesRunner tests against the Flink runner.
-job('beam_PostCommit_Java_ValidatesRunner_Flink_Gradle') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_ValidatesRunner_Flink_Gradle',
+ 'Run Flink ValidatesRunner', 'Apache Flink Runner ValidatesRunner Tests',
this) {
description('Runs the ValidatesRunner suite on the Flink runner.')
// Set common parameters.
@@ -30,15 +32,6 @@ job('beam_PostCommit_Java_ValidatesRunner_Flink_Gradle') {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Apache Flink Runner ValidatesRunner Tests',
- 'Run Flink ValidatesRunner')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Gearpump.groovy
b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Gearpump.groovy
index c3e5c9a6a4b..16c8d38e580 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Gearpump.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Gearpump.groovy
@@ -17,35 +17,26 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of ValidatesRunner tests against the Gearpump
// runner.
-job('beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle',
+ 'Run Gearpump ValidatesRunner', 'Apache Gearpump Runner ValidatesRunner
Tests', this) {
description('Runs the ValidatesRunner suite on the Gearpump runner.')
previousNames('beam_PostCommit_Java_ValidatesRunner_Gearpump')
previousNames('beam_PostCommit_Java_RunnableOnService_Gearpump')
// Set common parameters.
common_job_properties.setTopLevelMainJobProperties(
- delegate,
- 'gearpump-runner')
+ delegate,
+ 'gearpump-runner')
// Publish all test results to Jenkins
publishers {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- // 0 5 31 2 * will run on Feb 31 (i.e. never) according to job properties.
- // In post-commit this job triggers only on SCM changes.
- common_job_properties.setPostCommit(delegate, '0 5 31 2 *')
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Apache Gearpump Runner ValidatesRunner Tests',
- 'Run Gearpump ValidatesRunner')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Spark.groovy
b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Spark.groovy
index 1d4179c0317..97b95e0b3c8 100644
--- a/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Spark.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Java_ValidatesRunner_Spark.groovy
@@ -17,9 +17,11 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of ValidatesRunner tests against the Spark runner.
-job('beam_PostCommit_Java_ValidatesRunner_Spark_Gradle') {
+JobBuilder.postCommitJob('beam_PostCommit_Java_ValidatesRunner_Spark_Gradle',
+ 'Run Spark ValidatesRunner', 'Apache Spark Runner ValidatesRunner Tests',
this) {
description('Runs the ValidatesRunner suite on the Spark runner.')
previousNames('beam_PostCommit_Java_ValidatesRunner_Spark')
previousNames('beam_PostCommit_Java_RunnableOnService_Spark')
@@ -32,15 +34,6 @@ job('beam_PostCommit_Java_ValidatesRunner_Spark_Gradle') {
archiveJunit('**/build/test-results/**/*.xml')
}
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Apache Spark Runner ValidatesRunner Tests',
- 'Run Spark ValidatesRunner')
-
// Gradle goals for this job.
steps {
gradle {
diff --git
a/.test-infra/jenkins/job_PostCommit_Python_ValidatesContainer_Dataflow.groovy
b/.test-infra/jenkins/job_PostCommit_Python_ValidatesContainer_Dataflow.groovy
index d37a63eba19..8887af46411 100644
---
a/.test-infra/jenkins/job_PostCommit_Python_ValidatesContainer_Dataflow.groovy
+++
b/.test-infra/jenkins/job_PostCommit_Python_ValidatesContainer_Dataflow.groovy
@@ -17,24 +17,17 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of Python ValidatesContainer tests against the
// Dataflow runner.
-job('beam_PostCommit_Py_ValCont') {
+JobBuilder.postCommitJob('beam_PostCommit_Py_ValCont',
+ 'Run Python Dataflow ValidatesContainer', 'Google Cloud Dataflow Runner
Python ValidatesContainer Tests', this) {
description('Runs Python ValidatesContainer suite on the Dataflow runner.')
// Set common parameters.
common_job_properties.setTopLevelMainJobProperties(delegate)
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate, '30 3 * * *', false)
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Google Cloud Dataflow Runner Python ValidatesContainer Tests',
- 'Run Python Dataflow ValidatesContainer')
-
// Execute shell command to test Python SDK.
steps {
shell('cd ' + common_job_properties.checkoutDir + ' && bash
sdks/python/container/run_validatescontainer.sh')
diff --git
a/.test-infra/jenkins/job_PostCommit_Python_ValidatesRunner_Dataflow.groovy
b/.test-infra/jenkins/job_PostCommit_Python_ValidatesRunner_Dataflow.groovy
index 1fdf672530d..b805c7102ab 100644
--- a/.test-infra/jenkins/job_PostCommit_Python_ValidatesRunner_Dataflow.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Python_ValidatesRunner_Dataflow.groovy
@@ -17,24 +17,17 @@
*/
import common_job_properties
+import JobBuilder
// This job runs the suite of Python ValidatesRunner tests against the
// Dataflow runner.
-job('beam_PostCommit_Py_VR_Dataflow') {
+JobBuilder.postCommitJob('beam_PostCommit_Py_VR_Dataflow', 'Run Python
Dataflow ValidatesRunner',
+ 'Google Cloud Dataflow Runner Python ValidatesRunner Tests', this) {
description('Runs Python ValidatesRunner suite on the Dataflow runner.')
// Set common parameters.
common_job_properties.setTopLevelMainJobProperties(delegate)
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate, '0 3-22/6 * * *')
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Google Cloud Dataflow Runner Python ValidatesRunner Tests',
- 'Run Python Dataflow ValidatesRunner')
-
// Execute gradle task to test Python SDK.
steps {
gradle {
diff --git a/.test-infra/jenkins/job_PostCommit_Python_Verify.groovy
b/.test-infra/jenkins/job_PostCommit_Python_Verify.groovy
index d5af4e5a840..7d65ba8be3b 100644
--- a/.test-infra/jenkins/job_PostCommit_Python_Verify.groovy
+++ b/.test-infra/jenkins/job_PostCommit_Python_Verify.groovy
@@ -17,9 +17,11 @@
*/
import common_job_properties
+import JobBuilder
// This job defines the Python postcommit tests.
-job('beam_PostCommit_Python_Verify') {
+JobBuilder.postCommitJob('beam_PostCommit_Python_Verify', 'Run Python
PostCommit',
+ 'Python SDK PostCommit Tests', this) {
description('Runs postcommit tests on the Python SDK.')
previousNames('beam_PostCommit_PythonVerify')
@@ -27,15 +29,6 @@ job('beam_PostCommit_Python_Verify') {
// Set common parameters.
common_job_properties.setTopLevelMainJobProperties(delegate)
- // Sets that this is a PostCommit job.
- common_job_properties.setPostCommit(delegate, '0 3-22/6 * * *')
-
- // Allows triggering this build against pull requests.
- common_job_properties.enablePhraseTriggeringFromPullRequest(
- delegate,
- 'Python SDK PostCommit Tests',
- 'Run Python PostCommit')
-
// Execute shell command to test Python SDK.
steps {
gradle {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 113864)
Time Spent: 20m (was: 10m)
> Post-Commit tests stability
> ---------------------------
>
> Key: BEAM-4559
> URL: https://issues.apache.org/jira/browse/BEAM-4559
> Project: Beam
> Issue Type: Improvement
> Components: testing
> Reporter: Mikhail Gryzykhin
> Assignee: Mikhail Gryzykhin
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> [https://docs.google.com/document/d/1sczGwnCvdHiboVajGVdnZL0rfnr7ViXXAebBAf_uQME/edit#heading=h.t71pj6h7rd0w]
> Follow up on design doc specified above and implement required code work.
> * Split existing post-commit tests jobs to automatically and manually
> triggered
> * Add tracking by JIRA bugs for failing test job
> * Create document describing post-commit failures handling policies
> * Add tests status badge to PR template
> * Create dashboard for post-commit tests
> * Detect and fix flaky java tests
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)