summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2014-06-12 11:35:35 +1000
committerJoshua Hesketh <josh@nitrotech.org>2014-06-12 11:35:35 +1000
commitbd5f7cd517d5e68fc8b6f6f837123e9cc603153b (patch)
tree4e45f2a6a9052ec217362def9299f455da04e3e6
parent3c71d94570b6379445119bed1c326f6bd6d6cd24 (diff)
downloadturbo-hipster-bd5f7cd517d5e68fc8b6f6f837123e9cc603153b.tar.gz
Only try jjb tests if slave scripts exist
Check to make sure slave scripts are installed before trying to run jjb scripts which rely on them. Change-Id: Iedd7d4fdb05c0cb538f9f33f1e85e32c5c712b27
-rw-r--r--tests/test_jjb_runner.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/test_jjb_runner.py b/tests/test_jjb_runner.py
index fd60eb7..38f01ed 100644
--- a/tests/test_jjb_runner.py
+++ b/tests/test_jjb_runner.py
@@ -26,21 +26,26 @@ from turbo_hipster.lib import utils
class TestTaskRunner(base.TestWithGearman):
log = logging.getLogger("TestTaskRunner")
- def setUp(self):
- super(TestTaskRunner, self).setUp()
+ def _grab_jjb(self):
# Grab a copy of JJB's config
temp_path = self.useFixture(fixtures.TempDir()).path
cmd = 'git clone git://git.openstack.org/openstack-infra/config'
utils.execute_to_log(cmd, '/dev/null', cwd=temp_path)
- self.jjb_config_dir = os.path.join(
+ return os.path.join(
temp_path, 'config',
'modules/openstack_project/files/jenkins_job_builder/config'
)
- def test_job_can_shutdown_th(self):
+ def test_jjb_pep8_job(self):
+ # We can only do this if we have the slave scripts installed in
+ # /usr/local/jenkins/slave_scripts/
+ if not os.path.isdir('/usr/local/jenkins/slave_scripts/'):
+ self.skipTest("Slave scripts aren't installed")
+
+ jjb_config_dir = self._grab_jjb()
self._load_config_fixture('jjb-config.yaml')
# set jjb_config to pulled in config
- self.config['plugins'][0]['jjb_config'] = self.jjb_config_dir
+ self.config['plugins'][0]['jjb_config'] = jjb_config_dir
self.start_server()
zuul = fakes.FakeZuul(self.config['zuul_server']['gearman_host'],