mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
Merge pull request #42515 from rhcs-dashboard/decouple-unit-tests-from-build-dir
mgr/dashboard: backend unit tests: decouple from build dir Reviewed-by: Waad Alkhoury <walkhour@redhat.com> Reviewed-by: Alfonso Martínez <almartin@redhat.com> Reviewed-by: Avan Thakkar <athakkar@redhat.com>
This commit is contained in:
commit
321bf26628
@ -37,9 +37,6 @@ else:
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logging.root.handlers[0].setLevel(logging.DEBUG)
|
||||
build_dir = os.path.abspath('../../../../build')
|
||||
os.environ['PATH'] = '{}:{}'.format(os.path.join(build_dir, 'bin'),
|
||||
os.environ['PATH'])
|
||||
import sys
|
||||
|
||||
# Used to allow the running of a tox-based yml doc generator from the dashboard directory
|
||||
@ -49,10 +46,9 @@ else:
|
||||
from tests import mock # type: ignore
|
||||
|
||||
mgr = mock.Mock()
|
||||
mgr.get_frontend_path.side_effect = \
|
||||
lambda: os.path.join(build_dir,
|
||||
'src/pybind/mgr/dashboard',
|
||||
'frontend/dist')
|
||||
mgr.get_frontend_path.return_value = os.path.abspath(os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'frontend/dist'))
|
||||
|
||||
# DO NOT REMOVE: required for ceph-mgr to load a module
|
||||
from .module import Module, StandbyModule # noqa: F401
|
||||
|
Loading…
Reference in New Issue
Block a user