]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ansible: Integrate mgr/ansible/tox into mgr/tox
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 13 Dec 2019 16:28:18 +0000 (17:28 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 13 Dec 2019 16:28:18 +0000 (17:28 +0100)
Reason to make this switch is to be able to do proper refactorings
in the orchestrators.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/CMakeLists.txt
src/pybind/mgr/ansible/.gitignore [deleted file]
src/pybind/mgr/ansible/CMakeLists.txt [deleted file]
src/pybind/mgr/ansible/requirements.txt [deleted file]
src/pybind/mgr/ansible/tests/test_client_playbooks.py
src/pybind/mgr/ansible/tests/test_output_wizards.py
src/pybind/mgr/ansible/tox.ini [deleted file]
src/pybind/mgr/requirements.txt
src/pybind/mgr/tox.ini

index f7e200b1f889d56430e97219a2b2f54900c6b44a..3d58d0904f0946666ba7a2517187d51506f2012f 100644 (file)
@@ -2,7 +2,6 @@ if(WITH_MGR_DASHBOARD_FRONTEND)
   add_subdirectory(dashboard)
 endif()
 add_subdirectory(insights)
-add_subdirectory(ansible)
 
 if(WITH_TESTS)
   include(AddCephTest)
diff --git a/src/pybind/mgr/ansible/.gitignore b/src/pybind/mgr/ansible/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/pybind/mgr/ansible/CMakeLists.txt b/src/pybind/mgr/ansible/CMakeLists.txt
deleted file mode 100644 (file)
index 476be7a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-if(WITH_TESTS)
-  include(AddCephTest)
-  add_tox_test(mgr-ansible)
-endif()
diff --git a/src/pybind/mgr/ansible/requirements.txt b/src/pybind/mgr/ansible/requirements.txt
deleted file mode 100644 (file)
index c6ddb76..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-tox==2.9.1
-pytest
-mock
-requests-mock
--e ../../../python-common
index cadcd9b84509f0423131a8b00b24a65e7dd0c86f..0bb75c5add017f16a8f203c94a777743c5aacf3d 100644 (file)
@@ -1,7 +1,8 @@
 import logging
 import unittest
-import mock
+from tests import mock
 import json
+import os
 
 import requests_mock
 
@@ -20,7 +21,7 @@ PB_NAME = "test_playbook"
 PB_UUID = "1733c3ac"
 
 # Playbook execution data file
-PB_EVENTS_FILE = "./tests/pb_execution_events.data"
+PB_EVENTS_FILE = os.path.dirname( __file__) + "/pb_execution_events.data"
 
 # create console handler and set level to info
 logger = logging.getLogger()
index 02d72e95aefb3b61cb961756c800808cd006d497..fb856ce7d40c282fcce28e1352f15a38a8699f5e 100644 (file)
@@ -1,7 +1,7 @@
 """ Test output wizards
 """
 import unittest
-import mock
+from tests import mock
 
 from ..ansible_runner_svc import EVENT_DATA_URL
 from ..output_wizards import ProcessHostsList, ProcessPlaybookResult, \
diff --git a/src/pybind/mgr/ansible/tox.ini b/src/pybind/mgr/ansible/tox.ini
deleted file mode 100644 (file)
index c4d96b9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[tox]
-envlist = py{27,3}
-skipsdist = true
-toxworkdir = {env:CEPH_BUILD_DIR}/ansible
-minversion = 2.8.1
-
-[testenv]
-deps =
-    -rrequirements.txt
-setenv=
-    UNITTEST = true
-    py27: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.2
-    py3:  PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3
-commands=
-    {envbindir}/py.test tests/
index c60dc4a8982d66923d829227e56e7b8c079c73f8..2b0e951104c7a2646e7c812507c119a2ffc8467e 100644 (file)
@@ -3,3 +3,4 @@ mock; python_version <= '3.3'
 ipaddress; python_version < '3.3'
 ../../python-common
 kubernetes
+requests-mock
\ No newline at end of file
index 8257ba615fb751267f155342e6a1b7bc4cb935eb..7cce321c687593ce674ce8acc7098cf7aebffeeb 100644 (file)
@@ -5,11 +5,11 @@ skipsdist = true
 [testenv]
 setenv = UNITTEST = true
 deps = -r requirements.txt
-commands = pytest -v --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/ cephadm/}
+commands = pytest -v --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/ cephadm/ ansible/}
 
 [testenv:mypy]
 basepython = python3
 deps =
     -r requirements.txt
     mypy
-commands = mypy --config-file=../../mypy.ini orchestrator.py cephadm/module.py rook/module.py
\ No newline at end of file
+commands = mypy --config-file=../../mypy.ini orchestrator.py cephadm/module.py rook/module.py ansible/module.py
\ No newline at end of file