From 9f7b22fe7c3010dec2a73b78805f8d08cfd4ca32 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 24 May 2018 13:30:36 -0700 Subject: [PATCH] Removes testr and switches cover to karma-coverage This patch removes testr as it is no longer used, switches the cover job to use the javascript coverage report, and removes the unused py27integration test environment from tox.ini. Depends-On: https://review.openstack.org/570260 Change-Id: I44002e46b5a56031520b7144b476d4514aa1e676 --- .testr.conf | 7 ------- lower-constraints.txt | 1 - neutron_lbaas_dashboard/karma.conf.js | 11 ++++++++++- test-requirements.txt | 1 - tox.ini | 21 +++++---------------- 5 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 .testr.conf diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..0000000 --- a/.testr.conf +++ /dev/null @@ -1,7 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 70a4990..6c79dc7 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -110,7 +110,6 @@ six==1.10.0 statsd==3.2.1 stevedore==1.20.0 tenacity==3.2.1 -testrepository==0.0.18 testscenarios==0.4 testtools==2.2.0 traceback2==1.4.0 diff --git a/neutron_lbaas_dashboard/karma.conf.js b/neutron_lbaas_dashboard/karma.conf.js index d5451cd..0dd3378 100644 --- a/neutron_lbaas_dashboard/karma.conf.js +++ b/neutron_lbaas_dashboard/karma.conf.js @@ -140,7 +140,16 @@ module.exports = function (config) { coverageReporter: { type: 'html', - dir: '../coverage-karma/' + dir: '../cover/', + subdir: '.', + check: { + global: { + statements: 100, + branches: 100, + functions: 100, + lines: 100 + } + } }, // Coverage threshold values. diff --git a/test-requirements.txt b/test-requirements.txt index 8e391d4..317a45f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,7 +10,6 @@ python-subunit>=1.0.0 # Apache-2.0/BSD nose-exclude>=0.3.0 # LGPL selenium>=2.50.1 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT # This also needs xvfb library installed on your OS diff --git a/tox.ini b/tox.ini index a6e3dd5..f9becf6 100644 --- a/tox.ini +++ b/tox.ini @@ -8,11 +8,6 @@ usedevelop = True install_command = pip install {opts} {packages} setenv = VIRTUAL_ENV={envdir} - NOSE_WITH_OPENSTACK=1 - NOSE_OPENSTACK_COLOR=1 - NOSE_OPENSTACK_RED=0.05 - NOSE_OPENSTACK_YELLOW=0.025 - NOSE_OPENSTACK_SHOW_ELAPSED=1 CLIENT_NAME=neutron-lbaas-dashboard DJANGO_SETTINGS_MODULE=neutron_lbaas_dashboard.tests.settings deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} @@ -28,18 +23,12 @@ commands = flake8 [testenv:venv] commands = {posargs} -[testenv:py27integration] -basepython = python2.7 -setenv = - {[testenv]setenv} - INTEGRATION_TESTS=1 - SELENIUM_HEADLESS=1 - HORIZON_INTEGRATION_TESTS_CONFIG_FILE=neutron_lbaas_dashboard/tests/integration_tests/horizon.conf - DJANGO_SETTINGS_MODULE=neutron_lbaas_dashboard.tests.settings -commands = nosetests neutron_lbaas_dashboard/tests/integration_tests/tests {posargs} - [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +# npm must be installed on the system, for example +# sudo apt-get install npm +# sudo yum install npm (on RHEL/CentOS, enable EPEL repository) +commands = npm install + npm test [testenv:docs] whitelist_externals = rm