From 1f889815ff0bb0f6fe0120c163f9383e657fea0b Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 24 Apr 2020 15:52:07 +0200 Subject: [PATCH] pybind/mgr: Remove insights/tox.ini All we need is part of mgr/tox.ini nowadays. Signed-off-by: Sebastian Wagner --- src/pybind/mgr/CMakeLists.txt | 1 - src/pybind/mgr/insights/CMakeLists.txt | 4 ---- src/pybind/mgr/insights/__init__.py | 11 ++++------- src/pybind/mgr/insights/tests/test_health.py | 2 +- src/pybind/mgr/insights/tox.ini | 15 --------------- src/pybind/mgr/tox.ini | 1 + 6 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 src/pybind/mgr/insights/CMakeLists.txt delete mode 100644 src/pybind/mgr/insights/tox.ini diff --git a/src/pybind/mgr/CMakeLists.txt b/src/pybind/mgr/CMakeLists.txt index 8c544eb4180..834e9d2099c 100644 --- a/src/pybind/mgr/CMakeLists.txt +++ b/src/pybind/mgr/CMakeLists.txt @@ -1,7 +1,6 @@ if(WITH_MGR_DASHBOARD_FRONTEND) add_subdirectory(dashboard) endif() -add_subdirectory(insights) if(WITH_MGR_ROOK_CLIENT) add_subdirectory(rook) endif() diff --git a/src/pybind/mgr/insights/CMakeLists.txt b/src/pybind/mgr/insights/CMakeLists.txt deleted file mode 100644 index f105a7bc9ea..00000000000 --- a/src/pybind/mgr/insights/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -if(WITH_TESTS) - include(AddCephTest) - add_tox_test(mgr-insights) -endif() diff --git a/src/pybind/mgr/insights/__init__.py b/src/pybind/mgr/insights/__init__.py index ea61a12fd7e..99e80632858 100644 --- a/src/pybind/mgr/insights/__init__.py +++ b/src/pybind/mgr/insights/__init__.py @@ -1,9 +1,6 @@ -from __future__ import absolute_import import os -if 'UNITTEST' not in os.environ: - from .module import Module -else: - import sys - import mock - sys.modules['ceph_module'] = mock.Mock() +if 'UNITTEST' in os.environ: + import tests + +from .module import Module diff --git a/src/pybind/mgr/insights/tests/test_health.py b/src/pybind/mgr/insights/tests/test_health.py index 9b34786dcc0..c39e1097d46 100644 --- a/src/pybind/mgr/insights/tests/test_health.py +++ b/src/pybind/mgr/insights/tests/test_health.py @@ -1,5 +1,5 @@ import unittest -import mock +from tests import mock from ..health import * class HealthChecksTest(unittest.TestCase): diff --git a/src/pybind/mgr/insights/tox.ini b/src/pybind/mgr/insights/tox.ini deleted file mode 100644 index 9c74a8df0a0..00000000000 --- a/src/pybind/mgr/insights/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -[tox] -envlist = py3 -skipsdist = true -toxworkdir = {env:CEPH_BUILD_DIR}/insights -minversion = 2.8.1 - -[testenv] -deps = - pytest - mock -setenv= - UNITTEST = true - py3: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3 -commands= - {envbindir}/py.test tests/ diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index e6a902a7476..cd090435a6c 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -17,6 +17,7 @@ commands = tests/ \ cephadm/ \ orchestrator/ \ + insights/ \ pg_autoscaler/ \ progress/} -- 2.39.5