]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: clean-up tox and unit tests 28696/head
authorErnesto Puerta <epuertat@redhat.com>
Fri, 19 Jul 2019 16:10:49 +0000 (18:10 +0200)
committerErnesto Puerta <epuertat@redhat.com>
Fri, 16 Aug 2019 17:17:27 +0000 (19:17 +0200)
commit1e07237d92da3bb5eba82b49f6276d17696e6985
treed9d846cc4895bdc22aa9dacf780418b92baa907f
parentf4cbe8965f83af7db4d7b7ea4b26e532a5308e91
mgr/dashboard: clean-up tox and unit tests

Refactor CMake add_tox_test to automatically add py27 and/or py3 to
provided toxenvs.

Refactor tox.ini:
- Remove requirements-{py27,py3}.txt, as python release dependant
packages can be handled with PEP 508 syntax.
- Remove develepment dependencies from requirements.
- Move pycodestyle settings to separate section.
- Add flake8 check and other checkers (rst, naming, etc). Some of them
are commented out for future clean-ups (Ceph trackers have been opened)
- Pycodestyle removed, as flake8 is a wrapper for pycodestyle.
- Add instafail plugin to report failures immediately
- Add timeout plugin to limit max run time (sometimes test_tasks hangs)
- Remove unused dependencies (lru_cache, pluggy)

Test and code linting fixes:
- Unused imports
- Fixes to HACKING.rst

Doc:
- Update HACKING.rst

Add conftest.py to mock imported modules (rados, rbd, cephfs), and mock
also rados Error and OSError Exceptions.

Fixes: https://tracker.ceph.com/issues/40487
Fixes: https://tracker.ceph.com/issues/41152
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
41 files changed:
cmake/modules/AddCephTest.cmake
install-deps.sh
src/pybind/mgr/dashboard/.pylintrc
src/pybind/mgr/dashboard/CMakeLists.txt
src/pybind/mgr/dashboard/HACKING.rst
src/pybind/mgr/dashboard/__init__.py
src/pybind/mgr/dashboard/conftest.py [new file with mode: 0644]
src/pybind/mgr/dashboard/constraints.txt [new file with mode: 0644]
src/pybind/mgr/dashboard/controllers/__init__.py
src/pybind/mgr/dashboard/controllers/osd.py
src/pybind/mgr/dashboard/controllers/pool.py
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py
src/pybind/mgr/dashboard/controllers/saml2.py
src/pybind/mgr/dashboard/plugins/__init__.py
src/pybind/mgr/dashboard/plugins/feature_toggles.py
src/pybind/mgr/dashboard/requirements-lint.txt [new file with mode: 0644]
src/pybind/mgr/dashboard/requirements-py27.txt [deleted file]
src/pybind/mgr/dashboard/requirements-py3.txt [deleted file]
src/pybind/mgr/dashboard/requirements-test.txt [new file with mode: 0644]
src/pybind/mgr/dashboard/requirements.txt
src/pybind/mgr/dashboard/rest_client.py
src/pybind/mgr/dashboard/services/exception.py
src/pybind/mgr/dashboard/services/iscsi_client.py
src/pybind/mgr/dashboard/services/sso.py
src/pybind/mgr/dashboard/tests/__init__.py
src/pybind/mgr/dashboard/tests/test_api_auditing.py
src/pybind/mgr/dashboard/tests/test_feature_toggles.py
src/pybind/mgr/dashboard/tests/test_ganesha.py
src/pybind/mgr/dashboard/tests/test_iscsi.py
src/pybind/mgr/dashboard/tests/test_osd.py
src/pybind/mgr/dashboard/tests/test_pool.py
src/pybind/mgr/dashboard/tests/test_prometheus.py
src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
src/pybind/mgr/dashboard/tests/test_rest_client.py
src/pybind/mgr/dashboard/tests/test_rest_tasks.py
src/pybind/mgr/dashboard/tests/test_rgw.py
src/pybind/mgr/dashboard/tests/test_rgw_client.py
src/pybind/mgr/dashboard/tests/test_tools.py
src/pybind/mgr/dashboard/tools.py
src/pybind/mgr/dashboard/tox.ini
src/tools/setup-virtualenv.sh