From bc0deaee5f487ec2bb752a9dbe78ffe51d2559e5 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sun, 14 Apr 2019 23:15:06 +0300 Subject: [PATCH] moved tests to testenv --- .dockerignore | 1 - Makefile | 1 + {tests => testenv/tests}/__init__.py | 0 {tests => testenv/tests}/apps/__init__.py | 0 {tests => testenv/tests}/apps/test_cleanup.py | 0 {tests => testenv/tests}/apps/test_htpasswd.py | 0 {tests => testenv/tests}/auth/__init__.py | 0 .../tests}/auth/test_service_htpasswd.py | 0 {tests => testenv/tests}/auth/test_service_http.py | 0 {tests => testenv/tests}/test_aioregion.py | 0 {tests => testenv/tests}/test_gpio.py | 0 {tests => testenv/tests}/test_keymap.py | 0 {tests => testenv/tests}/test_logging.py | 0 {tests => testenv/tests}/validators/__init__.py | 0 {tests => testenv/tests}/validators/test_auth.py | 0 {tests => testenv/tests}/validators/test_basic.py | 0 {tests => testenv/tests}/validators/test_hw.py | 0 {tests => testenv/tests}/validators/test_kvm.py | 0 {tests => testenv/tests}/validators/test_net.py | 0 {tests => testenv/tests}/validators/test_os.py | 0 testenv/tox.ini | 12 +++++++----- 21 files changed, 8 insertions(+), 6 deletions(-) rename {tests => testenv/tests}/__init__.py (100%) rename {tests => testenv/tests}/apps/__init__.py (100%) rename {tests => testenv/tests}/apps/test_cleanup.py (100%) rename {tests => testenv/tests}/apps/test_htpasswd.py (100%) rename {tests => testenv/tests}/auth/__init__.py (100%) rename {tests => testenv/tests}/auth/test_service_htpasswd.py (100%) rename {tests => testenv/tests}/auth/test_service_http.py (100%) rename {tests => testenv/tests}/test_aioregion.py (100%) rename {tests => testenv/tests}/test_gpio.py (100%) rename {tests => testenv/tests}/test_keymap.py (100%) rename {tests => testenv/tests}/test_logging.py (100%) rename {tests => testenv/tests}/validators/__init__.py (100%) rename {tests => testenv/tests}/validators/test_auth.py (100%) rename {tests => testenv/tests}/validators/test_basic.py (100%) rename {tests => testenv/tests}/validators/test_hw.py (100%) rename {tests => testenv/tests}/validators/test_kvm.py (100%) rename {tests => testenv/tests}/validators/test_net.py (100%) rename {tests => testenv/tests}/validators/test_os.py (100%) diff --git a/.dockerignore b/.dockerignore index 4e0990a5..c4c723c2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,4 +11,3 @@ /*.pkg.tar.xz /*.egg-info /*kvmd-*.tar.gz - diff --git a/Makefile b/Makefile index cad1e342..3e19bd9f 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ tox: _testenv time docker run --rm \ --volume `pwd`:/src:ro \ --volume `pwd`/testenv:/src/testenv:rw \ + --volume `pwd`/testenv/tests:/src/testenv/tests:ro \ --volume `pwd`/extras:/usr/share/kvmd/extras:ro \ --volume `pwd`/configs:/usr/share/kvmd/configs.default:ro \ -it $(TESTENV_IMAGE) bash -c " \ diff --git a/tests/__init__.py b/testenv/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to testenv/tests/__init__.py diff --git a/tests/apps/__init__.py b/testenv/tests/apps/__init__.py similarity index 100% rename from tests/apps/__init__.py rename to testenv/tests/apps/__init__.py diff --git a/tests/apps/test_cleanup.py b/testenv/tests/apps/test_cleanup.py similarity index 100% rename from tests/apps/test_cleanup.py rename to testenv/tests/apps/test_cleanup.py diff --git a/tests/apps/test_htpasswd.py b/testenv/tests/apps/test_htpasswd.py similarity index 100% rename from tests/apps/test_htpasswd.py rename to testenv/tests/apps/test_htpasswd.py diff --git a/tests/auth/__init__.py b/testenv/tests/auth/__init__.py similarity index 100% rename from tests/auth/__init__.py rename to testenv/tests/auth/__init__.py diff --git a/tests/auth/test_service_htpasswd.py b/testenv/tests/auth/test_service_htpasswd.py similarity index 100% rename from tests/auth/test_service_htpasswd.py rename to testenv/tests/auth/test_service_htpasswd.py diff --git a/tests/auth/test_service_http.py b/testenv/tests/auth/test_service_http.py similarity index 100% rename from tests/auth/test_service_http.py rename to testenv/tests/auth/test_service_http.py diff --git a/tests/test_aioregion.py b/testenv/tests/test_aioregion.py similarity index 100% rename from tests/test_aioregion.py rename to testenv/tests/test_aioregion.py diff --git a/tests/test_gpio.py b/testenv/tests/test_gpio.py similarity index 100% rename from tests/test_gpio.py rename to testenv/tests/test_gpio.py diff --git a/tests/test_keymap.py b/testenv/tests/test_keymap.py similarity index 100% rename from tests/test_keymap.py rename to testenv/tests/test_keymap.py diff --git a/tests/test_logging.py b/testenv/tests/test_logging.py similarity index 100% rename from tests/test_logging.py rename to testenv/tests/test_logging.py diff --git a/tests/validators/__init__.py b/testenv/tests/validators/__init__.py similarity index 100% rename from tests/validators/__init__.py rename to testenv/tests/validators/__init__.py diff --git a/tests/validators/test_auth.py b/testenv/tests/validators/test_auth.py similarity index 100% rename from tests/validators/test_auth.py rename to testenv/tests/validators/test_auth.py diff --git a/tests/validators/test_basic.py b/testenv/tests/validators/test_basic.py similarity index 100% rename from tests/validators/test_basic.py rename to testenv/tests/validators/test_basic.py diff --git a/tests/validators/test_hw.py b/testenv/tests/validators/test_hw.py similarity index 100% rename from tests/validators/test_hw.py rename to testenv/tests/validators/test_hw.py diff --git a/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py similarity index 100% rename from tests/validators/test_kvm.py rename to testenv/tests/validators/test_kvm.py diff --git a/tests/validators/test_net.py b/testenv/tests/validators/test_net.py similarity index 100% rename from tests/validators/test_net.py rename to testenv/tests/validators/test_net.py diff --git a/tests/validators/test_os.py b/testenv/tests/validators/test_os.py similarity index 100% rename from tests/validators/test_os.py rename to testenv/tests/validators/test_os.py diff --git a/testenv/tox.ini b/testenv/tox.ini index 55d51892..b63b5071 100644 --- a/testenv/tox.ini +++ b/testenv/tox.ini @@ -8,14 +8,14 @@ sitepackages = true changedir = /src [testenv:flake8] -commands = flake8 --config=testenv/linters/flake8.ini kvmd genmap.py tests +commands = flake8 --config=testenv/linters/flake8.ini kvmd genmap.py testenv/tests deps = flake8 flake8-double-quotes -rrequirements.txt [testenv:pylint] -commands = pylint --rcfile=testenv/linters/pylint.ini --output-format=colorized --reports=no kvmd genmap.py tests +commands = pylint --rcfile=testenv/linters/pylint.ini --output-format=colorized --reports=no kvmd genmap.py testenv/tests deps = pylint pytest @@ -24,19 +24,21 @@ deps = -rrequirements.txt [testenv:mypy] -commands = mypy --config-file=testenv/linters/mypy.ini --cache-dir=testenv/.mypy_cache kvmd genmap.py tests +commands = mypy --config-file=testenv/linters/mypy.ini --cache-dir=testenv/.mypy_cache kvmd genmap.py testenv/tests deps = mypy -rrequirements.txt [testenv:vulture] -commands = vulture --ignore-names=_format_P,Plugin --ignore-decorators=@_exposed,@_system_task,@pytest.fixture kvmd genmap.py tests testenv/linters/vulture-wl.py +commands = vulture --ignore-names=_format_P,Plugin --ignore-decorators=@_exposed,@_system_task,@pytest.fixture kvmd genmap.py testenv/tests testenv/linters/vulture-wl.py deps = vulture -rrequirements.txt [testenv:pytest] -commands = py.test -vv --cov-config=testenv/linters/coverage.ini --cov-report=term-missing --cov=kvmd tests +commands = py.test -vv --cov-config=testenv/linters/coverage.ini --cov-report=term-missing --cov=kvmd testenv/tests +setenv = + PYTHONPATH=/src deps = pytest pytest-cov