From 38a3e2134a31fe02432ec976aad5c2c63705dc4e Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Thu, 6 Aug 2020 10:52:24 +0200 Subject: [PATCH] pybind/mgr/snap_schedule: integrate with mgr wide tox testing Signed-off-by: Jan Fajerski --- src/pybind/mgr/snap_schedule/__init__.py | 6 ++++-- src/pybind/mgr/snap_schedule/tox.ini | 2 +- src/pybind/mgr/tox.ini | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/snap_schedule/__init__.py b/src/pybind/mgr/snap_schedule/__init__.py index 7b88dda8781..f2d056fedeb 100644 --- a/src/pybind/mgr/snap_schedule/__init__.py +++ b/src/pybind/mgr/snap_schedule/__init__.py @@ -2,5 +2,7 @@ import os -if 'CEPH_SNAP_SCHEDULE_UNITTEST' not in os.environ: - from .module import Module +if 'UNITTEST' in os.environ: + import tests + +from .module import Module diff --git a/src/pybind/mgr/snap_schedule/tox.ini b/src/pybind/mgr/snap_schedule/tox.ini index 86c8481f1e0..1fde27980f8 100644 --- a/src/pybind/mgr/snap_schedule/tox.ini +++ b/src/pybind/mgr/snap_schedule/tox.ini @@ -10,7 +10,7 @@ setenv= PATH = {toxinidir}/../../../../build/bin:$PATH py27: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.2:.. py3: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3:{toxinidir} - CEPH_SNAP_SCHEDULE_UNITTEST = true + UNITTEST = true deps = pytest mock diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index 02561a49a30..7ca38365bbe 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -39,7 +39,8 @@ commands = orchestrator/ \ insights/ \ pg_autoscaler/ \ - progress/} + progress/ \ + snap_schedule} [testenv:mypy] basepython = python3 @@ -57,6 +58,7 @@ commands = orchestrator/__init__.py \ progress/module.py \ rook/module.py \ + snap_schedule/module.py \ test_orchestrator/module.py \ mds_autoscaler/module.py \ volumes/__init__.py -- 2.39.5