From 85a2f8159f6fbf8f929337a548f22c5c047b3231 Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Fri, 19 Jun 2015 09:55:07 +0200 Subject: [PATCH] Move functional tests out of tests/ This moves functional tests out of the tests directory and removes it. blueprint tests-refactoring Change-Id: I0e0fb4e914ede02ea2f02fa19cf898888f38b57d --- .testr.conf | 6 +---- README.rst | 2 +- setup.cfg | 2 +- tests/__init__.py | 23 ------------------- tests/functional/wsgi/v1_1/__init__.py | 0 tox.ini | 3 +-- .../tests}/etc/drivers_storage_invalid.conf | 0 .../tests}/etc/drivers_transport_invalid.conf | 0 .../tests}/etc/functional-tests.conf | 0 .../tests}/etc/functional-zaqar.conf | 0 {tests => zaqar/tests}/etc/keystone_auth.conf | 0 .../tests}/etc/websocket_mongodb.conf | 0 {tests => zaqar/tests}/etc/wsgi_faulty.conf | 0 .../tests}/etc/wsgi_fifo_mongodb.conf | 0 {tests => zaqar/tests}/etc/wsgi_mongodb.conf | 0 .../etc/wsgi_mongodb_default_limits.conf | 0 .../tests}/etc/wsgi_mongodb_pooled.conf | 0 .../tests}/etc/wsgi_mongodb_validation.conf | 0 {tests => zaqar/tests}/etc/wsgi_redis.conf | 0 .../tests}/etc/wsgi_redis_pooled.conf | 0 .../tests}/etc/wsgi_sqlalchemy.conf | 0 .../tests}/etc/wsgi_sqlalchemy_pooled.conf | 0 {tests => zaqar/tests}/functional/README.rst | 5 +--- zaqar/tests/functional/http.py | 0 .../tests/functional/wsgi}/__init__.py | 0 .../tests/functional/wsgi/v1}/__init__.py | 0 .../tests}/functional/wsgi/v1/test_claims.py | 0 .../functional/wsgi/v1/test_messages.py | 0 .../tests}/functional/wsgi/v1/test_queues.py | 0 .../tests/functional/wsgi/v1_1}/__init__.py | 0 .../functional/wsgi/v1_1/test_claims.py | 0 .../functional/wsgi/v1_1/test_health.py | 0 .../functional/wsgi/v1_1/test_messages.py | 0 .../tests}/functional/wsgi/v1_1/test_pools.py | 0 .../functional/wsgi/v1_1/test_queues.py | 0 .../unit/transport/websocket/v1_1/__init__.py | 17 -------------- .../unit/transport}/wsgi/test_version.py | 0 37 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 tests/__init__.py delete mode 100644 tests/functional/wsgi/v1_1/__init__.py rename {tests => zaqar/tests}/etc/drivers_storage_invalid.conf (100%) rename {tests => zaqar/tests}/etc/drivers_transport_invalid.conf (100%) rename {tests => zaqar/tests}/etc/functional-tests.conf (100%) rename {tests => zaqar/tests}/etc/functional-zaqar.conf (100%) rename {tests => zaqar/tests}/etc/keystone_auth.conf (100%) rename {tests => zaqar/tests}/etc/websocket_mongodb.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_faulty.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_fifo_mongodb.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_mongodb.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_mongodb_default_limits.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_mongodb_pooled.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_mongodb_validation.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_redis.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_redis_pooled.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_sqlalchemy.conf (100%) rename {tests => zaqar/tests}/etc/wsgi_sqlalchemy_pooled.conf (100%) rename {tests => zaqar/tests}/functional/README.rst (90%) mode change 100755 => 100644 zaqar/tests/functional/http.py rename {tests/functional => zaqar/tests/functional/wsgi}/__init__.py (100%) rename {tests/functional/wsgi => zaqar/tests/functional/wsgi/v1}/__init__.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1/test_claims.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1/test_messages.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1/test_queues.py (100%) rename {tests/functional/wsgi/v1 => zaqar/tests/functional/wsgi/v1_1}/__init__.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1_1/test_claims.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1_1/test_health.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1_1/test_messages.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1_1/test_pools.py (100%) rename {tests => zaqar/tests}/functional/wsgi/v1_1/test_queues.py (100%) rename {tests/functional => zaqar/tests/unit/transport}/wsgi/test_version.py (100%) diff --git a/.testr.conf b/.testr.conf index 0a0f2988c..a93cca38f 100644 --- a/.testr.conf +++ b/.testr.conf @@ -2,11 +2,7 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} $JIT_FLAG -m subunit.run discover -t . ./tests $LISTOPT $IDOPTION - OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} $JIT_FLAG -m subunit.run discover -s ./zaqar/tests/unit $LISTOPT $IDOPTION + ${PYTHON:-python} $JIT_FLAG -m subunit.run discover -t . $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/README.rst b/README.rst index d3eccc72c..7cf25f816 100644 --- a/README.rst +++ b/README.rst @@ -169,5 +169,5 @@ the ``--verbose`` flag. Verbose output looks similar to the following:: .. _`OpenStack` : http://openstack.org/ .. _`MongoDB` : http://docs.mongodb.org/manual/installation/ .. _`wiki` : https://wiki.openstack.org/wiki/Zaqar -.. _`TESTS_README` : https://github.com/openstack/zaqar/blob/master/tests/functional/README.rst +.. _`TESTS_README` : https://github.com/openstack/zaqar/blob/master/zaqar/tests/functional/README.rst diff --git a/setup.cfg b/setup.cfg index 14ac72f4b..0084290c9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -75,7 +75,7 @@ zaqar.storage.redis.driver.queue.stages = [nosetests] -where=tests +where=zaqar/tests verbosity=2 with-doctest = true diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index d69a0092d..000000000 --- a/tests/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2013 Red Hat, Inc. -# -# 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 os - - -tests_dir = os.path.abspath(os.path.dirname(__file__)) -os.environ.setdefault("ZAQAR_TESTS_DIR", tests_dir) - -if "ZAQAR_TESTS_CONFIGS_DIR" not in os.environ: - os.environ["ZAQAR_TESTS_CONFIGS_DIR"] = os.path.join(tests_dir, "etc") diff --git a/tests/functional/wsgi/v1_1/__init__.py b/tests/functional/wsgi/v1_1/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tox.ini b/tox.ini index b4fe54be2..ba2e2453c 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,7 @@ usedevelop = True # Customize pip command, add -U to force updates. install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} - ZAQAR_TESTS_DIR={toxinidir}/tests - ZAQAR_TESTS_CONFIGS_DIR={toxinidir}/tests/etc/ + ZAQAR_TESTS_CONFIGS_DIR={toxinidir}/zaqar/tests/etc/ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt diff --git a/tests/etc/drivers_storage_invalid.conf b/zaqar/tests/etc/drivers_storage_invalid.conf similarity index 100% rename from tests/etc/drivers_storage_invalid.conf rename to zaqar/tests/etc/drivers_storage_invalid.conf diff --git a/tests/etc/drivers_transport_invalid.conf b/zaqar/tests/etc/drivers_transport_invalid.conf similarity index 100% rename from tests/etc/drivers_transport_invalid.conf rename to zaqar/tests/etc/drivers_transport_invalid.conf diff --git a/tests/etc/functional-tests.conf b/zaqar/tests/etc/functional-tests.conf similarity index 100% rename from tests/etc/functional-tests.conf rename to zaqar/tests/etc/functional-tests.conf diff --git a/tests/etc/functional-zaqar.conf b/zaqar/tests/etc/functional-zaqar.conf similarity index 100% rename from tests/etc/functional-zaqar.conf rename to zaqar/tests/etc/functional-zaqar.conf diff --git a/tests/etc/keystone_auth.conf b/zaqar/tests/etc/keystone_auth.conf similarity index 100% rename from tests/etc/keystone_auth.conf rename to zaqar/tests/etc/keystone_auth.conf diff --git a/tests/etc/websocket_mongodb.conf b/zaqar/tests/etc/websocket_mongodb.conf similarity index 100% rename from tests/etc/websocket_mongodb.conf rename to zaqar/tests/etc/websocket_mongodb.conf diff --git a/tests/etc/wsgi_faulty.conf b/zaqar/tests/etc/wsgi_faulty.conf similarity index 100% rename from tests/etc/wsgi_faulty.conf rename to zaqar/tests/etc/wsgi_faulty.conf diff --git a/tests/etc/wsgi_fifo_mongodb.conf b/zaqar/tests/etc/wsgi_fifo_mongodb.conf similarity index 100% rename from tests/etc/wsgi_fifo_mongodb.conf rename to zaqar/tests/etc/wsgi_fifo_mongodb.conf diff --git a/tests/etc/wsgi_mongodb.conf b/zaqar/tests/etc/wsgi_mongodb.conf similarity index 100% rename from tests/etc/wsgi_mongodb.conf rename to zaqar/tests/etc/wsgi_mongodb.conf diff --git a/tests/etc/wsgi_mongodb_default_limits.conf b/zaqar/tests/etc/wsgi_mongodb_default_limits.conf similarity index 100% rename from tests/etc/wsgi_mongodb_default_limits.conf rename to zaqar/tests/etc/wsgi_mongodb_default_limits.conf diff --git a/tests/etc/wsgi_mongodb_pooled.conf b/zaqar/tests/etc/wsgi_mongodb_pooled.conf similarity index 100% rename from tests/etc/wsgi_mongodb_pooled.conf rename to zaqar/tests/etc/wsgi_mongodb_pooled.conf diff --git a/tests/etc/wsgi_mongodb_validation.conf b/zaqar/tests/etc/wsgi_mongodb_validation.conf similarity index 100% rename from tests/etc/wsgi_mongodb_validation.conf rename to zaqar/tests/etc/wsgi_mongodb_validation.conf diff --git a/tests/etc/wsgi_redis.conf b/zaqar/tests/etc/wsgi_redis.conf similarity index 100% rename from tests/etc/wsgi_redis.conf rename to zaqar/tests/etc/wsgi_redis.conf diff --git a/tests/etc/wsgi_redis_pooled.conf b/zaqar/tests/etc/wsgi_redis_pooled.conf similarity index 100% rename from tests/etc/wsgi_redis_pooled.conf rename to zaqar/tests/etc/wsgi_redis_pooled.conf diff --git a/tests/etc/wsgi_sqlalchemy.conf b/zaqar/tests/etc/wsgi_sqlalchemy.conf similarity index 100% rename from tests/etc/wsgi_sqlalchemy.conf rename to zaqar/tests/etc/wsgi_sqlalchemy.conf diff --git a/tests/etc/wsgi_sqlalchemy_pooled.conf b/zaqar/tests/etc/wsgi_sqlalchemy_pooled.conf similarity index 100% rename from tests/etc/wsgi_sqlalchemy_pooled.conf rename to zaqar/tests/etc/wsgi_sqlalchemy_pooled.conf diff --git a/tests/functional/README.rst b/zaqar/tests/functional/README.rst similarity index 90% rename from tests/functional/README.rst rename to zaqar/tests/functional/README.rst index 44279a5c6..eea796bb4 100644 --- a/tests/functional/README.rst +++ b/zaqar/tests/functional/README.rst @@ -12,16 +12,13 @@ Running functional tests (With Tox) #. Setup a Zaqar server. Refer to the Zaqar `README`_ on how to run Zaqar locally, or simply use an existing server. -#. Change `$ZAQAR_TESTS_CONFIGS_DIR/functional-tests.conf` and - set `run_tests` to True. - #. Run tests. :: $ tox #. Filter tests. :: - $ tox -- --tests tests.functional.wsgi.v1.test_messages + $ tox -- zaqar.tests.functional.wsgi.v1.test_messages #. Run tests for specific environments. :: diff --git a/zaqar/tests/functional/http.py b/zaqar/tests/functional/http.py old mode 100755 new mode 100644 diff --git a/tests/functional/__init__.py b/zaqar/tests/functional/wsgi/__init__.py similarity index 100% rename from tests/functional/__init__.py rename to zaqar/tests/functional/wsgi/__init__.py diff --git a/tests/functional/wsgi/__init__.py b/zaqar/tests/functional/wsgi/v1/__init__.py similarity index 100% rename from tests/functional/wsgi/__init__.py rename to zaqar/tests/functional/wsgi/v1/__init__.py diff --git a/tests/functional/wsgi/v1/test_claims.py b/zaqar/tests/functional/wsgi/v1/test_claims.py similarity index 100% rename from tests/functional/wsgi/v1/test_claims.py rename to zaqar/tests/functional/wsgi/v1/test_claims.py diff --git a/tests/functional/wsgi/v1/test_messages.py b/zaqar/tests/functional/wsgi/v1/test_messages.py similarity index 100% rename from tests/functional/wsgi/v1/test_messages.py rename to zaqar/tests/functional/wsgi/v1/test_messages.py diff --git a/tests/functional/wsgi/v1/test_queues.py b/zaqar/tests/functional/wsgi/v1/test_queues.py similarity index 100% rename from tests/functional/wsgi/v1/test_queues.py rename to zaqar/tests/functional/wsgi/v1/test_queues.py diff --git a/tests/functional/wsgi/v1/__init__.py b/zaqar/tests/functional/wsgi/v1_1/__init__.py similarity index 100% rename from tests/functional/wsgi/v1/__init__.py rename to zaqar/tests/functional/wsgi/v1_1/__init__.py diff --git a/tests/functional/wsgi/v1_1/test_claims.py b/zaqar/tests/functional/wsgi/v1_1/test_claims.py similarity index 100% rename from tests/functional/wsgi/v1_1/test_claims.py rename to zaqar/tests/functional/wsgi/v1_1/test_claims.py diff --git a/tests/functional/wsgi/v1_1/test_health.py b/zaqar/tests/functional/wsgi/v1_1/test_health.py similarity index 100% rename from tests/functional/wsgi/v1_1/test_health.py rename to zaqar/tests/functional/wsgi/v1_1/test_health.py diff --git a/tests/functional/wsgi/v1_1/test_messages.py b/zaqar/tests/functional/wsgi/v1_1/test_messages.py similarity index 100% rename from tests/functional/wsgi/v1_1/test_messages.py rename to zaqar/tests/functional/wsgi/v1_1/test_messages.py diff --git a/tests/functional/wsgi/v1_1/test_pools.py b/zaqar/tests/functional/wsgi/v1_1/test_pools.py similarity index 100% rename from tests/functional/wsgi/v1_1/test_pools.py rename to zaqar/tests/functional/wsgi/v1_1/test_pools.py diff --git a/tests/functional/wsgi/v1_1/test_queues.py b/zaqar/tests/functional/wsgi/v1_1/test_queues.py similarity index 100% rename from tests/functional/wsgi/v1_1/test_queues.py rename to zaqar/tests/functional/wsgi/v1_1/test_queues.py diff --git a/zaqar/tests/unit/transport/websocket/v1_1/__init__.py b/zaqar/tests/unit/transport/websocket/v1_1/__init__.py index 54a59390e..e69de29bb 100644 --- a/zaqar/tests/unit/transport/websocket/v1_1/__init__.py +++ b/zaqar/tests/unit/transport/websocket/v1_1/__init__.py @@ -1,17 +0,0 @@ -# Copyright (c) 2015 Red Hat, Inc. -# -# 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. - -from zaqar.tests.unit.transport.websocket.v1_1 import test_queue_lifecycle as l - -TestQueueLifecycleMongoDB = l.TestQueueLifecycleMongoDB diff --git a/tests/functional/wsgi/test_version.py b/zaqar/tests/unit/transport/wsgi/test_version.py similarity index 100% rename from tests/functional/wsgi/test_version.py rename to zaqar/tests/unit/transport/wsgi/test_version.py