diff --git a/neutron-requirements.txt b/neutron-requirements.txt new file mode 100644 index 000000000..dfb920493 --- /dev/null +++ b/neutron-requirements.txt @@ -0,0 +1,4 @@ +# Neutron test cases requirements + +tempest>=17.1.0 # Apache-2.0 +stestr>=2.0 # Apache-2.0 diff --git a/pep8-requirements.txt b/pep8-requirements.txt index c10070760..cad80015b 100644 --- a/pep8-requirements.txt +++ b/pep8-requirements.txt @@ -1,6 +1,4 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. +# pep8 and flake8 requirements -flake8==2.5.5 # MIT +flake8==2.5.5 # MIT flake8-import-order==0.12 # LGPLv3 diff --git a/playbooks/post-tobiko-devstack.yaml b/playbooks/post-tobiko-devstack.yaml new file mode 100644 index 000000000..223378288 --- /dev/null +++ b/playbooks/post-tobiko-devstack.yaml @@ -0,0 +1,19 @@ +# Copyright 2018 Red Hat +# +# 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. + +#TODO(fressi): fill this playbook + +--- + + diff --git a/playbooks/tobiko-devstack.yaml b/playbooks/tobiko-devstack.yaml new file mode 100644 index 000000000..223378288 --- /dev/null +++ b/playbooks/tobiko-devstack.yaml @@ -0,0 +1,19 @@ +# Copyright 2018 Red Hat +# +# 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. + +#TODO(fressi): fill this playbook + +--- + + diff --git a/pylint-requirements.txt b/pylint-requirements.txt index a18a6491f..6c3674725 100644 --- a/pylint-requirements.txt +++ b/pylint-requirements.txt @@ -1,5 +1,3 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. +# pylint requirements -pylint>=1.9 +pylint>=1.9 # GPLv2 diff --git a/requirements.txt b/requirements.txt index 792007828..4357d56af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ +# Tobiko framework requirements + keystoneauth1>=2.0.0 oslo.config>=5.2.0 oslo.log>=3.36.0 python-heatclient>=1.5.0 python-neutronclient>=6.7.0 +testtools>=2.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 090787fc0..96978f3b9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ -mock >= 2.0 # BSD -testscenarios>=0.4 -testtools>=2.2.0 -tempest>=17.1.0 # Apache-2.0 -coverage!=4.4,>=4.0 # Apache-2.0 +# unit tests requirements + +coverage!=4.4,>=4.0 # Apache-2.0 +mock>=2.0 # BSD +stestr>=2.0 # Apache-2.0 diff --git a/tobiko/tests/base.py b/tobiko/tests/base.py index 1fca46504..69f4d2036 100644 --- a/tobiko/tests/base.py +++ b/tobiko/tests/base.py @@ -14,18 +14,10 @@ # under the License. from __future__ import absolute_import -from tempest import config -import testscenarios -import testtools -from tobiko.common import constants -from tobiko.common import clients +import testtools class TobikoTest(testtools.testcase.WithAttributes, - testscenarios.WithScenarios, testtools.TestCase): - - default_params = constants.DEFAULT_PARAMS - conf = config.CONF - clientManager = clients.ClientManager() + pass diff --git a/tobiko/tests/scenario/base.py b/tobiko/tests/scenario/base.py index ac951630f..643531a1b 100644 --- a/tobiko/tests/scenario/base.py +++ b/tobiko/tests/scenario/base.py @@ -20,12 +20,15 @@ import sys from tobiko.tests import base from tobiko.common.managers import stack from tobiko.common.managers import network +from tobiko.common import clients from tobiko.common import constants class ScenarioTestsBase(base.TobikoTest): """All scenario tests inherit from this scenario base class.""" + clientManager = clients.ClientManager() + default_params = constants.DEFAULT_PARAMS stack = None def setUp(self): diff --git a/tox.ini b/tox.ini index 3680e13f0..9e3833e74 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,13 @@ [tox] +envlist = pep8,pylint,py35,py36,py27 + minversion = 2.0 -envlist = pep8,pylint,py35,py27 -[testenv] -usedevelop = True - -install_command = - pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +[tobiko] +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt setenv = VIRTUAL_ENV={envdir} @@ -15,23 +15,34 @@ setenv = OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true} OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true} - PYTHON=coverage run --source tobiko --parallel-mode -whitelist_externals= - find + +[testenv] commands = - coverage erase + find . -type f -name ".coverage*" -delete find . -type f -name "*.pyc" -delete + coverage erase stestr --test-path ./tobiko/tests/cmd run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report + find . -type f -name ".coverage*" -delete deps = + {[tobiko]deps} -r{toxinidir}/test-requirements.txt +setenv = + {[tobiko]setenv} + PYTHON=coverage run --source tobiko --parallel-mode + +usedevelop = True + +whitelist_externals= + find + [testenv:neutron] basepython = python3 @@ -39,37 +50,60 @@ basepython = python3 commands = stestr --test-path ./tobiko/tests/scenario run {posargs} +deps = + {[tobiko]deps} + -r{toxinidir}/neutron-requirements.txt + +setenv = + {[tobiko]setenv} + PYTHON=python + [testenv:venv] basepython = python3 -deps = - commands = {posargs} +deps = + {[testenv]deps} + {[testenv:neutron]deps} + +setenv = + {[tobiko]setenv} + PYTHON=python [testenv:pep8] basepython = python3 -deps = - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/pep8-requirements.txt - commands = flake8 +deps = + {[testenv]deps} + {[testenv:neutron]deps} + -r{toxinidir}/pep8-requirements.txt + +setenv = + {[tobiko]setenv} + PYTHON=python + [testenv:pylint] basepython = python3 -deps = - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/pylint-requirements.txt - commands = pylint -E --rcfile=.pylintrc -e W,E tobiko +deps = + {[testenv]deps} + {[testenv:neutron]deps} + -r{toxinidir}/pylint-requirements.txt + +setenv = + {[tobiko]setenv} + PYTHON=python + [flake8] # E125 continuation line does not distinguish itself from next logical line diff --git a/zuul.d/projects.yaml b/zuul.d/project.yaml similarity index 87% rename from zuul.d/projects.yaml rename to zuul.d/project.yaml index 290b85b23..1bbec071f 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/project.yaml @@ -8,10 +8,12 @@ - openstack-tox-pep8 - openstack-tox-pylint - openstack-tox-py35 + - openstack-tox-py36 - openstack-tox-py27 gate: jobs: - openstack-tox-pep8 - openstack-tox-pylint - openstack-tox-py35 + - openstack-tox-py36 - openstack-tox-py27