From: Thanh Ha Date: Tue, 20 Jun 2017 19:49:12 +0000 (-0400) Subject: Make global-jjb verify JJB files X-Git-Tag: v0.4.0~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=a94198f2d19b1a76c6483c1b5293d5871aeb33d7;p=releng%2Fglobal-jjb.git Make global-jjb verify JJB files This adds to tox.ini some code to make it actually test the global-jjb yaml files by using a test.yaml that is copied from test.template by tox. This is so that downstream projects do not pull in the fake job data. Also archives the test job output to job-configs on the log server. Change-Id: Ie0dcc99d2df9ac90410be4a5b03d6d409027f34a Signed-off-by: Thanh Ha --- diff --git a/.gitignore b/.gitignore index 53704da6..2bb356d1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ target/ .tox/ __pycache__/ *.pyc + +# global-jjb +jjb/test.yaml +archives/ diff --git a/test.template b/test.template new file mode 100644 index 00000000..898f43e4 --- /dev/null +++ b/test.template @@ -0,0 +1,73 @@ +- defaults: + name: global + + # General + jenkins-ssh-credential: test-credential + + # Gerrit Infra + gerrit-server-name: test-server + + # GitHub Infra + git-url: https://github.com + git-clone-url: 'git@github.com:' + github-org: example-org + + # Common test config + project: releng/ciman + stream: latest + build-node: build-vm + +################ +# GERRIT TESTS # +################ + +- project: + name: gerrit-ci-jobs + jobs: + - "{project-name}-ci-jobs" + + project-name: gerrit-ciman + +- project: + name: gerrit-maven-jobs + jobs: + - gerrit-maven-release + + project-name: gerrit-maven + staging-profile-id: uuddlrlrba + settings-file: gerrit-maven-project-settings + +- project: + name: gerrit-python-jobs + jobs: + - "{project-name}-python-jobs" + + project-name: gerrit-python + +################ +# GITHUB TESTS # +################ + +- project: + name: github-ci-jobs + jobs: + - "{project-name}-github-ci-jobs" + + project-name: github-ciman + +- project: + name: github-maven-jobs + jobs: + - github-maven-release + + project-name: github-maven + staging-profile-id: uuddlrlrba + settings-file: aproject-settings + +- project: + name: github-python-jobs + jobs: + - "{project-name}-github-python-jobs" + + project-name: github-python + diff --git a/tox.ini b/tox.ini index a8804405..0f418032 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = coala +envlist = coala,jjb skipsdist = true [testenv:coala] @@ -11,3 +11,14 @@ deps = commands = python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger coala --non-interactive + +[testenv:jjb] +deps = + jenkins-job-builder +commands = + cp test.template {toxinidir}/jjb/test.yaml + jenkins-jobs -l DEBUG test --recursive -o {toxinidir}/archives/job-configs {toxinidir}/jjb/ + rm {toxinidir}/jjb/test.yaml +whitelist_externals = + cp + rm