You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/14 14:20:17 UTC

[GitHub] ivankelly closed pull request #1248: Jenkins seed job for testing DSLs

ivankelly closed pull request #1248: Jenkins seed job for testing DSLs
URL: https://github.com/apache/bookkeeper/pull/1248
 
 
   

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/job_seed.groovy b/.test-infra/jenkins/job_seed.groovy
index a77d056e2..bffafacd3 100644
--- a/.test-infra/jenkins/job_seed.groovy
+++ b/.test-infra/jenkins/job_seed.groovy
@@ -40,6 +40,7 @@ job('bookkeeper-seed') {
     '/seed')
 
   steps {
+    folder('bookkeeper-jenkins-testing')
     dsl {
       // A list or a glob of other groovy files to process.
       external('.test-infra/jenkins/job_*.groovy')
diff --git a/.test-infra/jenkins/job_testing_seed.groovy b/.test-infra/jenkins/job_testing_seed.groovy
new file mode 100644
index 000000000..5688ba71e
--- /dev/null
+++ b/.test-infra/jenkins/job_testing_seed.groovy
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+job('bookkeeper-jenkins-testing/seed') {
+  description('Seed job, which allows DSL jobs to be tested before being pushed for review')
+
+  // Source code management.
+  scm {
+    git {
+      remote {
+        url('${gitrepo}')
+        refspec('+refs/heads/*:refs/remotes/origin/*')
+      }
+      branch('${sha1}')
+      extensions {
+        cleanAfterCheckout()
+      }
+    }
+  }
+
+  parameters {
+    stringParam(
+      'gitrepo', 'https://github.com/apache/bookkeeper/', 'Repo to clone')
+
+    stringParam(
+      'sha1',
+      'master',
+      'Commit id or refname (eg: origin/pr/9/head) you want to build.')
+  }
+
+  steps {
+    dsl {
+      // A list or a glob of other groovy files to process.
+      external('.test-infra/jenkins/jenkins_testing_job_*.groovy')
+      lookupStrategy('SEED_JOB')
+      // If a job is removed from the script, delete it
+      removeAction('DELETE')
+    }
+  }
+}
diff --git a/site/community/testing.md b/site/community/testing.md
index bb44fc4e0..2d784f912 100644
--- a/site/community/testing.md
+++ b/site/community/testing.md
@@ -53,3 +53,15 @@ Any jenkins changes should be made in these files and reviewed by the community.
 
 For Travis CI jobs, they are defined in [.travis.yml](https://github.com/apache/bookkeeper/blob/master/.travis.yml).
 Any travis CI changes should be made in this file and reviewed by the community.
+
+#### Testing Jenkins DSL scripts
+
+Changes to the Jenkins DSL scripts should be tested before submission to avoid having to send multiple PRs for a single change.
+There is a [Jenkins testing seed job](https://builds.apache.org/job/bookkeeper-jenkins-testing/job/seed/) which can be used for testing DSL scripts.
+
+To test a DSL script, create it in ```.test-infra/jenkins``` with a filename with the pattern ```jenkins_testing_job_<something>.groovy```. Commit this to a branch, and push the branch to your own fork on github. Then kick off the testing seed job, specifying your fork and the branch as parameters. This will generate jobs under the ```bookkeeper-jenkins-testing``` folder in Jenkins.
+
+Run your job a couple of times to makes sure it works and is stable. Once you're satisfied with the job, rename the file to the pattern ```job_<something>.groovy```, and create a PR.
+
+> NOTE: Kicking off the testing seed job requires a jenkins account, which is only available to committer. <br/>
+> **WARN: Don't put triggers in your testing job, as you could mess up outstanding PRs approvals. Add them later.**


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services