From: beierl Date: Wed, 31 Jul 2019 19:06:10 +0000 (-0400) Subject: Change to nose2 X-Git-Tag: v7.0.0rc1~27^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F7826%2F5;p=osm%2FMON.git Change to nose2 Use nose2 instead of stestr for running unit test as nose2 provides junit-style xml output that can be reported in Jenkins to show test pass/fail and trend history. Change-Id: I3f57992ca7252bfd5403f7fdf7153d1faa232e71 Signed-off-by: beierl --- diff --git a/.stestr.conf b/.stestr.conf deleted file mode 100644 index ae39f6f..0000000 --- a/.stestr.conf +++ /dev/null @@ -1,3 +0,0 @@ -[DEFAULT] -test_path=${TESTS_DIR:-./osm_mon/tests/unit/} -top_dir=./ diff --git a/nose2.cfg b/nose2.cfg new file mode 100644 index 0000000..c51e20b --- /dev/null +++ b/nose2.cfg @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +## +# Copyright 2016-2019 VMware Inc. +# This file is part of ETSI OSM +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact: osslegalrouting@vmware.com +## + +[unittest] +plugins = nose2.plugins.junitxml + +[junit-xml] +always-on = True +keep_restricted = False +path = nosetests.xml +test_fullname = False diff --git a/test-requirements.txt b/test-requirements.txt index 5741c91..554e6b8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -23,4 +23,3 @@ flake8<3.0 mock requests-mock coverage==4.5.3 -stestr>=1.0.0 diff --git a/tox.ini b/tox.ini index 03f2d27..b5c0df0 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ # test suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. [tox] -envlist = py3, flake8, pylint, cover +envlist = cover, py3, flake8, pylint [testenv] @@ -41,12 +41,12 @@ commands = [testenv:cover] basepython = python3 -setenv = VIRTUAL_ENV={envdir} - PYTHON=coverage run --source osm_mon --omit='*tests*' --parallel-mode +deps = nose2 + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands = coverage erase - stestr run {posargs} - coverage combine + nose2 -C --coverage osm_mon --plugin nose2.plugins.junitxml coverage report --omit='*tests*' coverage html -d ./cover --omit='*tests*' coverage xml -o ./cover/coverage.xml --omit='*tests*'