From a54fc82106fda823b10ba6305d10312e83d6da6d Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Fri, 5 Oct 2018 02:57:19 -0700 Subject: [PATCH] Updates tox.ini's cover environment The openstack-tox-cover job expects a coverage report at the end. This patch updates the cover environment in tox.ini, bringing it in line with the other repos. This also adds stestr in test-requirements, which is needed by the new coverage env. Finally, removes the cloudbaseinit import from releasenotes. According to [1], a project shouldn't necessarely be installed in order to build its releasenotes. [1] http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html Change-Id: I77dfe57f1190fc62f7bd19284e2c86d55bb1804a --- .coveragerc | 2 ++ .stestr.conf | 3 +++ releasenotes/source/conf.py | 7 +++---- test-requirements.txt | 1 + tox.ini | 11 ++++++++++- 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .coveragerc create mode 100644 .stestr.conf diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..bf333991 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +omit = */cloudbaseinit/tests/resources/* diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..343936fd --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./cloudbaseinit/tests} +top_dir=./ diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index ea84be6f..33f6af25 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -67,11 +67,10 @@ bug_tag = '' # |version| and |release|, also used in various other places throughout the # built documents. # -from cloubaseinit import version +# Release notes are version independent, no need to set version and release. +version = "" # The full version, including alpha/beta/rc tags. -release = version.get_version() -# The short X.Y version. -version = version.get_canonical_version() +release = "" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/test-requirements.txt b/test-requirements.txt index 783040e5..e6c5a737 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,7 @@ sphinx oslosphinx testtools>=0.9.32 testrepository>=0.0.18 +stestr>=2.0.0 openstackdocstheme>=1.11.0 # Apache-2.0 # releasenotes reno>=1.8.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 4fe27796..0a5d3b6f 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,16 @@ commands = flake8 {posargs} commands = bash tools/lintstack.sh [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +basepython = python2.7 +setenv = + {[testenv]setenv} + PYTHON=coverage run --source cloudbaseinit --parallel-mode +commands = + stestr run --no-subunit-trace {posargs} + coverage combine + coverage report --fail-under=82 --skip-covered + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:venv] commands = {posargs}