diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3608a21..0000000 --- a/.coveragerc +++ /dev/null @@ -1,6 +0,0 @@ -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - if __name__ == .__main__.: -include= - hooks/cinder_* diff --git a/.gitignore b/.gitignore index eadc98a..3f5c177 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ bin +cover .coverage .testrepository .tox diff --git a/.gitreview b/.gitreview index 544af33..672c929 100644 --- a/.gitreview +++ b/.gitreview @@ -1,4 +1,4 @@ [gerrit] host=review.openstack.org port=29418 -project=openstack/charm-cinder-backup.git +project=openstack/charm-cinder-backup-swift-proxy.git diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..b3037e9 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,5 @@ +- project: + templates: + - python35-charm-jobs + - openstack-python3-ussuri-jobs + - openstack-cover-jobs diff --git a/tox.ini b/tox.ini index fcf2f5e..f8f5092 100644 --- a/tox.ini +++ b/tox.ini @@ -1,66 +1,92 @@ # Source charm: ./tox.ini # This file is managed centrally by release-tools and should not be modified -# within individual charm repos. +# within individual charm repos. See the 'global' dir contents for available +# choices of tox.ini for OpenStack Charms: +# https://github.com/openstack-charmers/release-tools + [tox] skipsdist = True -envlist = pep8,py35,py36 -skip_missing_interpreters = True +envlist = pep8,py3 +# NOTE: Avoid build/test env pollution by not enabling sitepackages. +sitepackages = False +# NOTE: Avoid false positives by not skipping missing interpreters. +skip_missing_interpreters = False [testenv] setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux - CHARM_LAYERS_DIR={toxinidir}/layers - CHARM_INTERFACES_DIR={toxinidir}/interfaces + LAYER_PATH={toxinidir}/layers + INTERFACE_PATH={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build -passenv = http_proxy https_proxy +passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY install_command = pip install {opts} {packages} deps = -r{toxinidir}/requirements.txt [testenv:build] -basepython = python2.7 +basepython = python3 commands = - charm build --log-level DEBUG -o {toxinidir}/build src {posargs} - -[testenv:py27] -basepython = python2.7 -# Reactive source charms are Python3-only, but a py27 unit test target -# is required by OpenStack Governance. Remove this shim as soon as -# permitted. http://governance.openstack.org/reference/cti/python_cti.html -whitelist_externals = true -commands = true + charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} [testenv:py3] basepython = python3 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} - -[testenv:py34] -basepython = python3.4 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} [testenv:py35] basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} [testenv:py36] basepython = python3.6 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} + +[testenv:py37] +basepython = python3.7 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = flake8 {posargs} src unit_tests +[testenv:cover] +# Technique based heavily upon +# https://github.com/openstack/nova/blob/master/tox.ini +basepython = python3 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +setenv = + {[testenv]setenv} + PYTHON=coverage run +commands = + coverage erase + stestr run --slowest {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report + +[coverage:run] +branch = True +concurrency = multiprocessing +parallel = True +source = + . +omit = + .tox/* + */charmhelpers/* + unit_tests/* + [testenv:venv] basepython = python3 commands = {posargs} [flake8] # E402 ignore necessary for path append before sys module import in actions -ignore = E402 +ignore = E402,W504 \ No newline at end of file