Make global-jjb verify JJB files 62/5262/5
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 20 Jun 2017 19:49:12 +0000 (15:49 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 23 Jun 2017 15:43:12 +0000 (11:43 -0400)
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 <thanh.ha@linuxfoundation.org>
.gitignore
test.template [new file with mode: 0644]
tox.ini

index 53704da..2bb356d 100644 (file)
@@ -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 (file)
index 0000000..898f43e
--- /dev/null
@@ -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 a880440..0f41803 100644 (file)
--- 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