Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/dashboard: only test enabled python bindings
we should test the python version of MGR_PYTHON_VERSION_MAJOR, if we are testing both py2.7 and py3, we are preparing for distributing dashboard as a separated package independent of ceph-mgr. restructure the dashboard tests as 2 matrices, so we have 2*2 tests for coverage and lint respectively. Signed-off-by: Kefu Chai <kchai@redhat.com>
- Loading branch information
Showing
3 changed files
with
26 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,27 @@ | ||
[tox] | ||
envlist = cov-init,py27,py3,cov-report,lint | ||
envlist = {py27,py3}-cov,{py27,py3}-lint | ||
skipsdist = true | ||
|
||
[testenv] | ||
deps=-r{toxinidir}/requirements.txt | ||
basepython = | ||
py27: python2.7 | ||
py3: python3 | ||
deps = | ||
-r{toxinidir}/requirements.txt | ||
setenv= | ||
UNITTEST=true | ||
WEBTEST_INTERACTIVE=false | ||
COVERAGE_FILE= .coverage.{envname} | ||
PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3:{toxinidir}/../../../../build/lib/cython_modules/lib.2 | ||
UNITTEST = true | ||
WEBTEST_INTERACTIVE = false | ||
LD_LIBRARY_PATH = {toxinidir}/../../../../build/lib | ||
PATH = {toxinidir}/../../../../build/bin:$PATH | ||
py27: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.2 | ||
py3: PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3 | ||
cov: UNITTEST = true | ||
cov: COVERAGE_FILE = .coverage.{envname} | ||
commands= | ||
{envbindir}/py.test --cov=. --cov-report= --junitxml=junit.{envname}.xml --doctest-modules controllers/rbd.py services/ tests/ | ||
|
||
[testenv:cov-init] | ||
setenv = | ||
COVERAGE_FILE = .coverage | ||
deps = coverage | ||
commands = | ||
coverage erase | ||
|
||
[testenv:cov-report] | ||
setenv = | ||
COVERAGE_FILE = .coverage | ||
deps = coverage | ||
commands = | ||
coverage combine | ||
coverage report | ||
coverage xml | ||
|
||
[testenv:lint] | ||
setenv = | ||
PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3:{toxinidir}/../../../../build/lib/cython_modules/lib.2 | ||
LD_LIBRARY_PATH = {toxinidir}/../../../../build/lib | ||
deps=-r{toxinidir}/requirements.txt | ||
commands= | ||
pylint --rcfile=.pylintrc --jobs=5 . module.py tools.py controllers tests services | ||
pycodestyle --max-line-length=100 --exclude=python2.7,.tox,venv,frontend --ignore=E402,E121,E123,E126,E226,E24,E704,W503 . | ||
cov: coverage erase | ||
cov: {envbindir}/py.test --cov=. --cov-report= --junitxml=junit.{envname}.xml --doctest-modules controllers/rbd.py services/ tests/ | ||
cov: coverage combine {toxinidir}/{env:COVERAGE_FILE} | ||
cov: coverage report | ||
cov: coverage xml | ||
lint: pylint --rcfile=.pylintrc --jobs=5 . module.py tools.py controllers tests services | ||
lint: pycodestyle --max-line-length=100 --exclude=python2.7,.tox,venv,frontend --ignore=E402,E121,E123,E126,E226,E24,E704,W503 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters