summaryrefslogtreecommitdiff
path: root/tests/disabled_jjb_runner.py
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2015-04-30 09:31:44 +1000
committerJoshua Hesketh <josh@nitrotech.org>2015-04-30 09:57:12 +1000
commit7ad3bcc4768c5dd05bccd53831a6fb4e9be25e87 (patch)
tree4fd13b155dccf63eadf31d700a4f351f4b7dfd66 /tests/disabled_jjb_runner.py
parentfe515ed3b3d01cf1564459f8de6e6ab1d841b24b (diff)
downloadturbo-hipster-7ad3bcc4768c5dd05bccd53831a6fb4e9be25e87.tar.gz
Force migrate flavour data
Disable tests while buggy to get this through. Change-Id: Ia4dcb6ba1f8aaf4d6fc1a287575dfe991b5cb505
Diffstat (limited to 'tests/disabled_jjb_runner.py')
-rw-r--r--tests/disabled_jjb_runner.py72
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/disabled_jjb_runner.py b/tests/disabled_jjb_runner.py
new file mode 100644
index 0000000..bdcee2d
--- /dev/null
+++ b/tests/disabled_jjb_runner.py
@@ -0,0 +1,72 @@
+# Copyright 2014 Rackspace Australia
+#
+# Licensed 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.
+
+import base
+import fakes
+import fixtures
+import json
+import logging
+import os
+import uuid
+
+from turbo_hipster.lib import utils
+
+
+class TestTaskRunner(base.TestWithGearman):
+ log = logging.getLogger("TestTaskRunner")
+
+ 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)
+ return os.path.join(
+ temp_path, 'config',
+ 'modules/openstack_project/files/jenkins_job_builder/config'
+ )
+
+ def test_jjb_pep8_job(self):
+ self.skipTest("This is buggy atm.")
+ # 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'] = jjb_config_dir
+
+ self.start_server()
+ zuul = fakes.FakeZuul(self.config['zuul_server']['gearman_host'],
+ self.config['zuul_server']['gearman_port'])
+
+ job_uuid = str(uuid.uuid1())[:8]
+ data_req = {
+ 'ZUUL_UUID': job_uuid,
+ 'ZUUL_PROJECT': 'stackforge/turbo-hipster',
+ 'ZUUL_PIPELINE': 'check',
+ 'ZUUL_URL': 'git://git.openstack.org/',
+ 'BRANCH': 'master',
+ 'BASE_LOG_PATH': '56/123456/8',
+ 'LOG_PATH': '56/123456/8/check/job_name/%s' % job_uuid
+ }
+
+ zuul.submit_job('build:gate-turbo-hipster-pep8', data_req)
+ zuul.wait_for_completion()
+
+ self.assertTrue(zuul.job.complete)
+ last_data = json.loads(zuul.job.data[-1])
+ self.log.debug(last_data)
+ self.assertEqual("SUCCESS", last_data['result'])