From 0a4fefc3ff59c283b19334f71ff81e4465d53732 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Mon, 25 Sep 2017 11:30:29 +0700 Subject: [PATCH] Fix coverage test File .testr.conf was removed in patch [1]. It will make the coverage ci job failed (and tox -ecover also). This patch will change cover command in tox.ini to fix coverage test without bring .testr.conf back. [1] https://review.openstack.org/#/c/504342/ Change-Id: Id9635a42255272396c1a5f45105360325fc74d2e Closes-Bug: #1719083 --- .testr.conf | 4 ---- tox.ini | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .testr.conf diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 22ff0ba6..00000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./kuryr_libnetwork/tests/unit} $LISTOPT $IDOPTION | cat -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/tox.ini b/tox.ini index 16d5eb4d..7c457fda 100644 --- a/tox.ini +++ b/tox.ini @@ -42,10 +42,15 @@ commands = flake8 commands = {posargs} [testenv:cover] +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source kuryr_libnetwork --parallel-mode commands = - python setup.py test --coverage --testr-args='{posargs}' \ - --coverage-package-name=kuryr_libnetwork - coverage report + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:docs] commands = python setup.py build_sphinx