From ac6f82fb9df4bbfe6c5d7b24d411667e0563beae Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 17 Nov 2016 16:49:44 +0100 Subject: [PATCH] Run tools/test-setup.sh for unittests Instead of setting up databases for jobs, allow projects to do this in tools/test-setup.sh instead - and run this script whenever it exists in our tox based unit tests. Note that currently no repo has such a file, change I9af7c7d09b40c103af09ae8dd0e50afe3762ecba introduces the first one. Change-Id: Ic6269e0a03c8540569f242ebc78c98a5922c8026 --- jenkins/jobs/macros.yaml | 10 ++++++++++ jenkins/jobs/python-jobs.yaml | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/jenkins/jobs/macros.yaml b/jenkins/jobs/macros.yaml index 419ba6dbe4..054d78da77 100644 --- a/jenkins/jobs/macros.yaml +++ b/jenkins/jobs/macros.yaml @@ -1021,6 +1021,16 @@ bundle exec rake + # This builder runs tools/test-setup.sh if its exists. This allows + # projects to setup unit tests in a specific way. +- builder: + name: extra-test-setup + builders: + - shell: | + if [ -x tools/test-setup.sh ] ; then + tools/test-setup.sh + fi + - builder: name: allow-local-ssh-root builders: diff --git a/jenkins/jobs/python-jobs.yaml b/jenkins/jobs/python-jobs.yaml index a399f93bda..5e71574a82 100644 --- a/jenkins/jobs/python-jobs.yaml +++ b/jenkins/jobs/python-jobs.yaml @@ -11,6 +11,7 @@ template-name: "{template-name}" - zuul-git-prep-upper-constraints - install-distro-packages + - extra-test-setup - revoke-sudo - coverage: env: cover @@ -154,6 +155,7 @@ template-name: "{template-name}" - zuul-git-prep-upper-constraints - install-distro-packages + - extra-test-setup - revoke-sudo - python27 - assert-no-extra-files @@ -294,6 +296,7 @@ template-name: "{template-name}" - zuul-git-prep-upper-constraints - install-distro-packages + - extra-test-setup - revoke-sudo - python34 - assert-no-extra-files @@ -347,6 +350,7 @@ template-name: "{template-name}" - zuul-git-prep-upper-constraints - install-distro-packages + - extra-test-setup - revoke-sudo - python35 - assert-no-extra-files @@ -474,6 +478,7 @@ template-name: "{template-name}" - zuul-git-prep-upper-constraints - install-distro-packages + - extra-test-setup - revoke-sudo - run-tox: envlist: '{envlist}'