From 78cd06b76a634971513f22df42ec3407e542f71d Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Tue, 9 Oct 2018 21:23:57 +0000 Subject: [PATCH] Add job for running unit tests Change-Id: I333b1f168314e73e9b0470041a16c0297b2cd562 --- .zuul.yaml | 10 ++++------ os_ken/cmd/manager.py | 2 +- os_ken/tests/unit/test_requirements.py | 3 +-- tox.ini | 5 ++++- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 1fd1fe4c..1cb51f3c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,7 +1,5 @@ - project: - check: - jobs: - - openstack-tox-pep8 - gate: - jobs: - - openstack-tox-pep8 + templates: + - openstack-python-jobs + - openstack-python35-jobs + - openstack-python36-jobs diff --git a/os_ken/cmd/manager.py b/os_ken/cmd/manager.py index 328c550f..123e7415 100755 --- a/os_ken/cmd/manager.py +++ b/os_ken/cmd/manager.py @@ -29,7 +29,7 @@ from os_ken import log log.early_init_log(logging.DEBUG) from os_ken import flags -from os_ken import version +from os_ken import __version__ as version from os_ken.app import wsgi from os_ken.base.app_manager import AppManager from os_ken.controller import controller diff --git a/os_ken/tests/unit/test_requirements.py b/os_ken/tests/unit/test_requirements.py index c842a0f0..448404e4 100644 --- a/os_ken/tests/unit/test_requirements.py +++ b/os_ken/tests/unit/test_requirements.py @@ -28,8 +28,7 @@ LOG = logging.getLogger(__name__) MOD_DIR = os.path.dirname('file://' + sys.modules[__name__].__file__) _RYU_REQUIREMENTS_FILES = [ - '../../../tools/pip-requires', - '../../../tools/optional-requires', + '../../../requirements.txt', ] RYU_REQUIREMENTS_FILES = [ os.path.join(MOD_DIR, f) for f in _RYU_REQUIREMENTS_FILES] diff --git a/tox.ini b/tox.ini index e0a1d7cc..58d9bf59 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,10 @@ setenv = OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +# TODO(hongbin): this is the way Ryu runs unit tests and we inherit +# this approach as a start. In the future, we should migrate to stestr +# for consistency with other OpenStack projects. +commands = python ./os_ken/tests/run_tests.py {posargs} [testenv:pep8] basepython = python3