From 2a8e0fa5f1b4621205e6794657fcd15b551ac10d Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 24 Jan 2017 10:18:38 -0800 Subject: [PATCH] Move tests into test/unit This makes room for a sibling directory for nodepool functional tests. Change-Id: Iace94d313edb04192ac23a533ed967f076410980 --- .testr.conf | 2 +- tests/unit/__init__.py | 0 tests/{ => unit}/test_change_matcher.py | 0 tests/{ => unit}/test_clonemapper.py | 0 tests/{ => unit}/test_cloner.py | 0 tests/{ => unit}/test_cloner_cmd.py | 0 tests/{ => unit}/test_connection.py | 0 tests/{ => unit}/test_daemon.py | 0 tests/{ => unit}/test_gerrit.py | 3 ++- tests/{ => unit}/test_layoutvalidator.py | 0 tests/{ => unit}/test_merger_repo.py | 0 tests/{ => unit}/test_model.py | 0 tests/{ => unit}/test_nodepool.py | 0 tests/{ => unit}/test_openstack.py | 0 tests/{ => unit}/test_requirements.py | 0 tests/{ => unit}/test_scheduler.py | 0 tests/{ => unit}/test_stack_dump.py | 0 tests/{ => unit}/test_v3.py | 0 tests/{ => unit}/test_webapp.py | 0 tests/{ => unit}/test_zuultrigger.py | 0 20 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 tests/unit/__init__.py rename tests/{ => unit}/test_change_matcher.py (100%) rename tests/{ => unit}/test_clonemapper.py (100%) rename tests/{ => unit}/test_cloner.py (100%) rename tests/{ => unit}/test_cloner_cmd.py (100%) rename tests/{ => unit}/test_connection.py (100%) rename tests/{ => unit}/test_daemon.py (100%) rename tests/{ => unit}/test_gerrit.py (97%) rename tests/{ => unit}/test_layoutvalidator.py (100%) rename tests/{ => unit}/test_merger_repo.py (100%) rename tests/{ => unit}/test_model.py (100%) rename tests/{ => unit}/test_nodepool.py (100%) rename tests/{ => unit}/test_openstack.py (100%) rename tests/{ => unit}/test_requirements.py (100%) rename tests/{ => unit}/test_scheduler.py (100%) rename tests/{ => unit}/test_stack_dump.py (100%) rename tests/{ => unit}/test_v3.py (100%) rename tests/{ => unit}/test_webapp.py (100%) rename tests/{ => unit}/test_zuultrigger.py (100%) diff --git a/.testr.conf b/.testr.conf index 8ef6689074..e8f41cd80f 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_command=OS_LOG_LEVEL=${OS_LOG_LEVEL:-INFO} OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} OS_LOG_DEFAULTS=${OS_LOG_DEFAULTS:-""} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION +test_command=OS_LOG_LEVEL=${OS_LOG_LEVEL:-INFO} OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} OS_LOG_DEFAULTS=${OS_LOG_DEFAULTS:-""} ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./tests/unit} $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test_change_matcher.py b/tests/unit/test_change_matcher.py similarity index 100% rename from tests/test_change_matcher.py rename to tests/unit/test_change_matcher.py diff --git a/tests/test_clonemapper.py b/tests/unit/test_clonemapper.py similarity index 100% rename from tests/test_clonemapper.py rename to tests/unit/test_clonemapper.py diff --git a/tests/test_cloner.py b/tests/unit/test_cloner.py similarity index 100% rename from tests/test_cloner.py rename to tests/unit/test_cloner.py diff --git a/tests/test_cloner_cmd.py b/tests/unit/test_cloner_cmd.py similarity index 100% rename from tests/test_cloner_cmd.py rename to tests/unit/test_cloner_cmd.py diff --git a/tests/test_connection.py b/tests/unit/test_connection.py similarity index 100% rename from tests/test_connection.py rename to tests/unit/test_connection.py diff --git a/tests/test_daemon.py b/tests/unit/test_daemon.py similarity index 100% rename from tests/test_daemon.py rename to tests/unit/test_daemon.py diff --git a/tests/test_gerrit.py b/tests/unit/test_gerrit.py similarity index 97% rename from tests/test_gerrit.py rename to tests/unit/test_gerrit.py index bfbaedc031..999e55d53f 100644 --- a/tests/test_gerrit.py +++ b/tests/unit/test_gerrit.py @@ -20,10 +20,11 @@ try: except ImportError: import mock +import tests.base from tests.base import BaseTestCase from zuul.driver.gerrit.gerritconnection import GerritConnection -FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixtures/gerrit') +FIXTURE_DIR = os.path.join(tests.base.FIXTURE_DIR, 'gerrit') def read_fixture(file): diff --git a/tests/test_layoutvalidator.py b/tests/unit/test_layoutvalidator.py similarity index 100% rename from tests/test_layoutvalidator.py rename to tests/unit/test_layoutvalidator.py diff --git a/tests/test_merger_repo.py b/tests/unit/test_merger_repo.py similarity index 100% rename from tests/test_merger_repo.py rename to tests/unit/test_merger_repo.py diff --git a/tests/test_model.py b/tests/unit/test_model.py similarity index 100% rename from tests/test_model.py rename to tests/unit/test_model.py diff --git a/tests/test_nodepool.py b/tests/unit/test_nodepool.py similarity index 100% rename from tests/test_nodepool.py rename to tests/unit/test_nodepool.py diff --git a/tests/test_openstack.py b/tests/unit/test_openstack.py similarity index 100% rename from tests/test_openstack.py rename to tests/unit/test_openstack.py diff --git a/tests/test_requirements.py b/tests/unit/test_requirements.py similarity index 100% rename from tests/test_requirements.py rename to tests/unit/test_requirements.py diff --git a/tests/test_scheduler.py b/tests/unit/test_scheduler.py similarity index 100% rename from tests/test_scheduler.py rename to tests/unit/test_scheduler.py diff --git a/tests/test_stack_dump.py b/tests/unit/test_stack_dump.py similarity index 100% rename from tests/test_stack_dump.py rename to tests/unit/test_stack_dump.py diff --git a/tests/test_v3.py b/tests/unit/test_v3.py similarity index 100% rename from tests/test_v3.py rename to tests/unit/test_v3.py diff --git a/tests/test_webapp.py b/tests/unit/test_webapp.py similarity index 100% rename from tests/test_webapp.py rename to tests/unit/test_webapp.py diff --git a/tests/test_zuultrigger.py b/tests/unit/test_zuultrigger.py similarity index 100% rename from tests/test_zuultrigger.py rename to tests/unit/test_zuultrigger.py