]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Run python unit tests with tox in the mgr
authorStephan Müller <smueller@suse.com>
Thu, 12 Sep 2019 14:09:08 +0000 (16:09 +0200)
committerStephan Müller <smueller@suse.com>
Wed, 6 Nov 2019 12:13:09 +0000 (13:13 +0100)
Fixes: https://tracker.ceph.com/issues/40363
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/.gitignore
src/pybind/mgr/CMakeLists.txt
src/pybind/mgr/requirements.txt [new file with mode: 0644]
src/pybind/mgr/tox.ini [new file with mode: 0644]

index fcdcddd51dda4d566b11a1c131492970ce1978a7..642616e09dfdfa5f9953c24568f20a2a26d51d3c 100644 (file)
@@ -1 +1,17 @@
 proxy.conf.json
+
+# tox related
+.coverage*
+htmlcov
+.tox
+coverage.xml
+junit*xml
+.cache
+
+# IDE
+.vscode
+*.egg
+.env
+
+# virtualenv
+venv
index ef07dac77c39965bda1090176a5ba126f652c0c5..56d5c0a9c76a417625adc752393bb9e64b6cbe43 100644 (file)
@@ -5,6 +5,11 @@ add_subdirectory(insights)
 add_subdirectory(ansible)
 add_subdirectory(orchestrator_cli)
 
+if(WITH_TESTS)
+  include(AddCephTest)
+  add_tox_test(mgr ${CMAKE_CURRENT_SOURCE_DIR})
+endif()
+
 # Location needs to match default setting for mgr_module_path, currently:
 # OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr")
 install(DIRECTORY
diff --git a/src/pybind/mgr/requirements.txt b/src/pybind/mgr/requirements.txt
new file mode 100644 (file)
index 0000000..86a816f
--- /dev/null
@@ -0,0 +1 @@
+pytest-cov==2.7.1
diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini
new file mode 100644 (file)
index 0000000..a9e8370
--- /dev/null
@@ -0,0 +1,7 @@
+[tox]
+envlist = py3
+skipsdist = true
+
+[testenv]
+deps = -rrequirements.txt
+commands = pytest --cov --cov-append --cov-report=term --doctest-modules mgr_util.py {posargs}