From 61b187d768c7375388e911f12c8b391602310716 Mon Sep 17 00:00:00 2001 From: david shaughnessy Date: Tue, 9 Jan 2018 13:26:09 +0000 Subject: [PATCH] Functional Tests and Gate stub - Adds modifications to tox.ini to enable functional testing - adds the functional sub directory to the tests folder - adds .zuul file to enable the Gate to start functional testing. Change-Id: Id40c0feba1741328027bd285e10aa8899b4a12b9 --- .zuul.yaml | 18 +++++++++ .../tests/functional/__init__.py | 0 .../tests/functional/requirements.txt | 4 ++ .../tests/functional/test_placeholder.py | 7 ++++ test-requirements.txt | 1 + tools/ostestr_compat_shim.sh | 8 ++++ tox.ini | 37 +++++++++++++++++++ 7 files changed, 75 insertions(+) create mode 100644 .zuul.yaml create mode 100644 neutron_classifier/tests/functional/__init__.py create mode 100644 neutron_classifier/tests/functional/requirements.txt create mode 100644 neutron_classifier/tests/functional/test_placeholder.py create mode 100755 tools/ostestr_compat_shim.sh diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..53b6586 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,18 @@ +- project: + name: openstack/neutron-classifier + check: + jobs: + - openstack-tox-functional: + required-projects: + - openstack/neutron + - openstack-tox-functional-py35: + required-projects: + - openstack/neutron + gate: + jobs: + - openstack-tox-functional: + required-projects: + - openstack/neutron + - openstack-tox-functional-py35: + required-projects: + - openstack/neutron diff --git a/neutron_classifier/tests/functional/__init__.py b/neutron_classifier/tests/functional/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/neutron_classifier/tests/functional/requirements.txt b/neutron_classifier/tests/functional/requirements.txt new file mode 100644 index 0000000..b1664df --- /dev/null +++ b/neutron_classifier/tests/functional/requirements.txt @@ -0,0 +1,4 @@ +# Additional requirements for functional tests +# 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. diff --git a/neutron_classifier/tests/functional/test_placeholder.py b/neutron_classifier/tests/functional/test_placeholder.py new file mode 100644 index 0000000..0544569 --- /dev/null +++ b/neutron_classifier/tests/functional/test_placeholder.py @@ -0,0 +1,7 @@ +from neutron_classifier.tests import base + + +class PlaceholderTest(base.TestCase): + + def test_noop(self): + pass diff --git a/test-requirements.txt b/test-requirements.txt index 87fa589..48b7ff2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.6.2 # BSD oslosphinx>=4.7.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 +os-testr>=1.0.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT diff --git a/tools/ostestr_compat_shim.sh b/tools/ostestr_compat_shim.sh new file mode 100755 index 0000000..a483ed1 --- /dev/null +++ b/tools/ostestr_compat_shim.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# preserve old behavior of using an arg as a regex when '--' is not present +case $@ in + (*--*) ostestr $@;; + ('') ostestr;; + (*) ostestr --regex "$@" +esac diff --git a/tox.ini b/tox.ini index c02c197..f683360 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,43 @@ commands = # TODO(igordcard): enable pylint on a future patch # pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_classifier} +[testenv:dsvm] +setenv = OS_FAIL_ON_MISSING_DEPS=1 + OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs} + +[testenv:functional] +setenv = {[testenv]setenv} + OS_TEST_TIMEOUT=180 + OS_TEST_PATH=./neutron_classifier/tests/functional + OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs} +deps = + {[testenv]deps} + -r{toxinidir}/neutron_classifier/tests/functional/requirements.txt +commands = + {toxinidir}/tools/ostestr_compat_shim.sh {posargs} + +[testenv:functional-py35] +basepython = python3.5 +setenv = {[testenv]setenv} + OS_TEST_TIMEOUT=180 + OS_TEST_PATH=./neutron_classifier/tests/functional + OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs} +deps = + {[testenv]deps} + -r{toxinidir}/neutron_classifier/tests/functional/requirements.txt +commands = + {toxinidir}/tools/ostestr_compat_shim.sh {posargs} + +[testenv:dsvm-functional] +basepython = python2.7 +setenv = {[testenv:functional]setenv} + {[testenv:dsvm]setenv} +sitepackages=True +deps = + {[testenv:functional]deps} +commands = + {toxinidir}/tools/ostestr_compat_shim.sh {posargs} + [testenv:venv] commands = {posargs}