From c8ba7a5a0f93a3e6be3ee1d824394fc5d89b3d47 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 4 Apr 2018 21:57:33 +0100 Subject: [PATCH] Replace testr with stestr Switch to use stestr which is maintained as opposed to testrepository (testr) which became a defunct project. Change-Id: I47f628a7d224189362f2b2cfd9fe4c54af198cde --- .gitignore | 3 ++- .stestr.conf | 3 +++ .testr.conf | 4 ---- test-requirements.txt | 2 +- tox.ini | 14 +++++++++----- 5 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 4a982d423..66e89cb5e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ jenkins_jobs/versioninfo cover/ jenkins-job-builder testr_subunit_log -__pycache__ \ No newline at end of file +__pycache__ +/.stestr diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..f90b1f515 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 5433c070e..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index b84fb5133..21866f2c9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,7 @@ python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.5.0,<1.7.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0/BSD tox>=2.9.1 # MIT mock>=2.0 # BSD sphinxcontrib-programoutput diff --git a/tox.ini b/tox.ini index e6fc39fee..2e641e9dd 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ deps = -r{toxinidir}/test-requirements.txt commands = - find . -type f -name "*.pyc" -delete - find . -type d -name "__pycache__" -delete - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} whitelist_externals = bash find @@ -28,17 +28,21 @@ whitelist_externals = [testenv:tips] # tests what happens with unreleased version of dependencies, like python-jenkins install_command = pip install -U {opts} {packages} -ignore_outcome = true commands = bash -c "if [ -d {toxinidir}/../python-jenkins ]; then \ pip install -q -U -e 'git+file://{toxinidir}/../python-jenkins#egg=python-jenkins' ; else \ pip install -q -U -e 'git+https://git.openstack.org/openstack/python-jenkins@master#egg=python-jenkins' ; fi " - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} [testenv:cover] +setenv = + {[testenv]setenv} + PYTHON=coverage run --source jenkins_jobs --parallel-mode commands = - python setup.py test --coverage --coverage-package-name=jenkins_jobs - coverage report + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:pep8] commands = flake8