From eaa667d4df99af853b36a8d137b57e7831fcffbe Mon Sep 17 00:00:00 2001 From: junboli Date: Tue, 17 Oct 2017 10:38:04 +0800 Subject: [PATCH] Fix 'cover' tox job fails for option --coverage not recognized When running command tox -ecover, tox job will fail. the error message is ====================================================================== FAIL: process-returncode tags: worker-0 ---------------------------------------------------------------------- returncode 1 Ran 733 (+17) tests in 856.852s (+164.804s) FAILED (id=6, failures=2, skips=7) error: testr failed (1) ERROR: InvocationError: '/home/github/mistral/.tox/py27/bin/python setup.py test _____________________________________________________ summary __________________ ERROR: py27: commands failed Change-Id: I21a335992683aa94d2cf47c4a4fc0f43849dec9a Closes-bug: #1724121 --- tox.ini | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 072f44ca..44af04c4 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,14 @@ setenv = PYTHONHASHSEED=0 commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source qinling --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] whitelist_externals = rm