From a7837c9430efbe5fae64afb9107bbbd17644b7a5 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 31 May 2018 09:51:52 -0600 Subject: [PATCH] Add python jobs to tripleo-image-elements This change also fixes the python tests to properly mock the path so our stubs work if the command already exists on the system path. Change-Id: I7c54b1d99e7cf6c4e3f4ded8c518bf447b2ba1de --- elements/os-svc-install/tests/test_os_svc_daemon.py | 1 + tests/base.py | 2 +- tox.ini | 6 ++++-- zuul.d/layout.yaml | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/elements/os-svc-install/tests/test_os_svc_daemon.py b/elements/os-svc-install/tests/test_os_svc_daemon.py index 5a439b763..72aad85d0 100644 --- a/elements/os-svc-install/tests/test_os_svc_daemon.py +++ b/elements/os-svc-install/tests/test_os_svc_daemon.py @@ -177,6 +177,7 @@ end script output = self._run_command( ['elements/os-svc-install/bin/os-svc-daemon', '-p', + '-l', '-n', 'foo', '-u', 'foo', '-e', 'foo=bar', diff --git a/tests/base.py b/tests/base.py index b4d49f68f..d0e04d8fe 100644 --- a/tests/base.py +++ b/tests/base.py @@ -24,7 +24,7 @@ class ScriptTestBase(base.BaseTestCase): super(ScriptTestBase, self).setUp() self.tmpdir = tempfile.mkdtemp() self.env = os.environ.copy() - self.env['PATH'] = self.env['PATH'] + ':' + self.tmpdir + self.env['PATH'] = self.tmpdir + ':' + self.env['PATH'] def _stub_script(self, name, contents): filename = os.path.join(self.tmpdir, name) diff --git a/tox.ini b/tox.ini index 0ac2f6cee..4caaa75a9 100644 --- a/tox.ini +++ b/tox.ini @@ -6,8 +6,10 @@ envlist = py27,pep8 [testenv] usedevelop = True install_command = pip install {opts} {packages} -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands= python setup.py testr --slowest --testr-args='{posargs}' diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml index 18c3aa4db..afc4f7017 100644 --- a/zuul.d/layout.yaml +++ b/zuul.d/layout.yaml @@ -1,5 +1,6 @@ - project: templates: + - openstack-python-jobs - tripleo-multinode-baremetal-minimal - tripleo-multinode-container-minimal