diff -Nru python-nosehtmloutput-0.0.4/CONTRIBUTING.rst python-nosehtmloutput-0.0.5/CONTRIBUTING.rst --- python-nosehtmloutput-0.0.4/CONTRIBUTING.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-nosehtmloutput-0.0.5/CONTRIBUTING.rst 2013-08-08 16:20:10.000000000 +0000 @@ -0,0 +1,20 @@ +If you would like to contribute to the development of nose-html-output, +you must follow the steps in the "If you're a developer, start here" +section of this page: + + http://wiki.openstack.org/HowToContribute + +Once those steps have been completed, changes to nose-html-output +should be submitted for review via the Gerrit tool, following +the workflow documented at: + + http://wiki.openstack.org/GerritWorkflow + +Pull requests submitted through GitHub will be ignored. + +Bugs should be filed on Launchpad, not GitHub: + + https://bugs.launchpad.net/openstack-ci/ + +Discussion happens on the openstack-infra@lists.openstack.org mail +list and on Freenode #openstack-infra. diff -Nru python-nosehtmloutput-0.0.4/debian/changelog python-nosehtmloutput-0.0.5/debian/changelog --- python-nosehtmloutput-0.0.4/debian/changelog 2013-11-22 17:42:36.000000000 +0000 +++ python-nosehtmloutput-0.0.5/debian/changelog 2016-08-13 19:40:56.000000000 +0000 @@ -1,3 +1,24 @@ +python-nosehtmloutput (0.0.5-1) unstable; urgency=medium + + * Team upload. + * New upstream release + * Fixed VCS URLs (https). + * d/rules: Changed UPSTREAM_GIT protocol to https + * d/copyright + - Changed source URL to https protocol + - Reordered + - Added myself to Debian part + * d/watch: Use pypi.debian.net + * Standards-Version is 3.9.8 now (no changes needed) + * Added openstack-pkg-tools to build depends + * Build using pkgos-dh_auto_install + * Added dh-python to build depends + * Removed Pre-Depends on dpkg + * Added python3-nosehtmloutput binary package + * Changed upstream git to openstack-infra + + -- Ondřej Nový Sat, 13 Aug 2016 21:40:56 +0200 + python-nosehtmloutput (0.0.4-3) unstable; urgency=low * Added missing build-depends: python-nose (Closes: #730201). diff -Nru python-nosehtmloutput-0.0.4/debian/control python-nosehtmloutput-0.0.5/debian/control --- python-nosehtmloutput-0.0.4/debian/control 2013-11-22 17:42:36.000000000 +0000 +++ python-nosehtmloutput-0.0.5/debian/control 2016-08-13 18:55:42.000000000 +0000 @@ -6,22 +6,41 @@ Thomas Goirand , Mehdi Abaakouk Build-Depends: debhelper (>= 9), + openstack-pkg-tools (>= 52~), + dh-python, python-all (>= 2.6.6-3~), python-nose, - python-setuptools -Standards-Version: 3.9.4 -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-nosehtmloutput.git -Vcs-Git: git://anonscm.debian.org/openstack/python-nosehtmloutput.git + python-setuptools, + python3-all, + python3-nose, + python3-setuptools, +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/cgit/openstack/python-nosehtmloutput.git/ +Vcs-Git: https://anonscm.debian.org/git/openstack/python-nosehtmloutput.git Homepage: https://pypi.python.org/pypi/nosehtmloutput Package: python-nosehtmloutput Architecture: all -Pre-Depends: dpkg (>= 1.15.6~) Depends: ${misc:Depends}, ${python:Depends} Recommends: ${python:Recommends} -Description: plugin to produce test results in html +Description: plugin to produce test results in html - Python 2.x A plugin for nosetests that will write out test results to results.html. The code is adapted from the example html output plugin at: https://github.com/nose-devs/nose/blob/master/examples/html_plugin/htmlplug.py and the pyunit Html test runner at http://tungwaiyip.info/software/HTMLTestRunner.html. + . + This package contains the Python 2.x module. + +Package: python3-nosehtmloutput +Architecture: all +Depends: ${misc:Depends}, ${python3:Depends} +Recommends: ${python3:Recommends} +Description: plugin to produce test results in html - Python 3.x + A plugin for nosetests that will write out test results to results.html. The + code is adapted from the example html output plugin at: + https://github.com/nose-devs/nose/blob/master/examples/html_plugin/htmlplug.py + and the pyunit Html test runner at + http://tungwaiyip.info/software/HTMLTestRunner.html. + . + This package contains the Python 3.x module. diff -Nru python-nosehtmloutput-0.0.4/debian/copyright python-nosehtmloutput-0.0.5/debian/copyright --- python-nosehtmloutput-0.0.4/debian/copyright 2013-11-22 17:42:36.000000000 +0000 +++ python-nosehtmloutput-0.0.5/debian/copyright 2016-08-13 19:10:50.000000000 +0000 @@ -1,10 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: nosehtmloutput -Source: git://github.com/cboylan/nose-html-output.git - -Files: debian/* -Copyright: (c) 2013, Thomas Goirand -License: Apache-2-and-BSD-3-clauses +Source: https://github.com/openstack-infra/nose-html-output.git Files: * Copyright: (c) 2013, Hewlett-Packard Development Company, L.P. @@ -12,6 +8,11 @@ (c) 2012, Clark Boylan License: Apache-2-and-BSD-3-clauses +Files: debian/* +Copyright: (c) 2013, Thomas Goirand + (c) 2016, Ondřej Nový +License: Apache-2-and-BSD-3-clauses + License: Apache-2-and-BSD-3-clauses Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff -Nru python-nosehtmloutput-0.0.4/debian/rules python-nosehtmloutput-0.0.5/debian/rules --- python-nosehtmloutput-0.0.4/debian/rules 2013-11-22 17:42:36.000000000 +0000 +++ python-nosehtmloutput-0.0.5/debian/rules 2016-08-13 19:06:57.000000000 +0000 @@ -1,10 +1,13 @@ #!/usr/bin/make -f -UPSTREAM_GIT = git://github.com/cboylan/nose-html-output.git +UPSTREAM_GIT := https://github.com/openstack-infra/nose-html-output.git -include /usr/share/openstack-pkg-tools/pkgos.make %: - dh $@ --buildsystem=python_distutils --with python2 + dh $@ --buildsystem=python_distutils --with python2,python3 + +override_dh_auto_install: + pkgos-dh_auto_install override_dh_clean: dh_clean -O--buildsystem=python_distutils diff -Nru python-nosehtmloutput-0.0.4/debian/watch python-nosehtmloutput-0.0.5/debian/watch --- python-nosehtmloutput-0.0.4/debian/watch 2013-11-22 17:42:36.000000000 +0000 +++ python-nosehtmloutput-0.0.5/debian/watch 2016-08-13 18:38:17.000000000 +0000 @@ -1,3 +1,4 @@ version=3 -http://pypi.python.org/packages/source/n/nosehtmloutput nosehtmloutput-(.*).tar.gz +opts=uversionmangle=s/(rc|a|b|c)/~$1/ \ +https://pypi.debian.net/nosehtmloutput/nosehtmloutput-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff -Nru python-nosehtmloutput-0.0.4/.gitignore python-nosehtmloutput-0.0.5/.gitignore --- python-nosehtmloutput-0.0.4/.gitignore 2012-08-08 18:41:01.000000000 +0000 +++ python-nosehtmloutput-0.0.5/.gitignore 2013-08-08 16:20:10.000000000 +0000 @@ -1 +1,2 @@ *.pyc +.tox diff -Nru python-nosehtmloutput-0.0.4/.gitreview python-nosehtmloutput-0.0.5/.gitreview --- python-nosehtmloutput-0.0.4/.gitreview 1970-01-01 00:00:00.000000000 +0000 +++ python-nosehtmloutput-0.0.5/.gitreview 2013-08-08 16:20:10.000000000 +0000 @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack-infra/nose-html-output.git diff -Nru python-nosehtmloutput-0.0.4/htmloutput/htmloutput.py python-nosehtmloutput-0.0.5/htmloutput/htmloutput.py --- python-nosehtmloutput-0.0.4/htmloutput/htmloutput.py 2012-08-08 18:41:01.000000000 +0000 +++ python-nosehtmloutput-0.0.5/htmloutput/htmloutput.py 2013-08-08 16:20:10.000000000 +0000 @@ -39,7 +39,9 @@ import datetime import os import traceback +from nose import SkipTest from nose.plugins import Plugin +import nose.plugins.skip from xml.sax import saxutils import version @@ -89,6 +91,7 @@ 0: 'pass', 1: 'fail', 2: 'error', + 3: 'skip', } DEFAULT_TITLE = 'Unit Test Report' @@ -341,6 +344,7 @@ + Test Group/Test case @@ -348,6 +352,7 @@ Pass Fail Error + Skip View %(test_list)s @@ -357,6 +362,7 @@ %(Pass)s %(fail)s %(error)s + %(skip)s   @@ -369,6 +375,7 @@ %(Pass)s %(fail)s %(error)s + %(skip)s Detail """ # variables: (style, desc, count, Pass, fail, error, cid) @@ -377,7 +384,7 @@ REPORT_TEST_WITH_OUTPUT_TMPL = r"""
%(desc)s
- + @@ -402,7 +409,7 @@ REPORT_TEST_NO_OUTPUT_TMPL = r"""
%(desc)s
- %(status)s + %(status)s """ # variables: (tid, Class, style, desc, status) @@ -424,15 +431,17 @@ class HtmlOutput(Plugin): """Output test results in html.""" - + name = 'html-output' - score = 2 # run late - + # Run before the skip plugin in order to catch skipped tests. + score = nose.plugins.skip.Skip.score + 50 + def __init__(self): super(HtmlOutput, self).__init__() self.success_count = 0 self.failure_count = 0 self.error_count = 0 + self.skip_count = 0 self.result = [] def options(self, parser, env=os.environ): @@ -458,15 +467,20 @@ if output is None: output = test.id() self.result.append((0, test, output, '')) - + def addError(self, test, err): - self.error_count += 1 - _exc_str = self.formatErr(err) output = test.shortDescription() if output is None: output = test.id() - self.result.append((2, test, output, _exc_str)) - + # Skipped tests are handled by SkipTest Exceptions. + if err[0] == SkipTest: + self.skip_count += 1 + self.result.append((3, test, output, '')) + else: + self.error_count += 1 + _exc_str = self.formatErr(err) + self.result.append((2, test, output, _exc_str)) + def addFailure(self, test, err): self.failure_count += 1 _exc_str = self.formatErr(err) @@ -514,7 +528,9 @@ if self.failure_count: status.append('Failure %s' % self.failure_count) if self.error_count: - status.append('Error %s' % self.error_count ) + status.append('Error %s' % self.error_count) + if self.skip_count: + status.append('Skip %s' % self.skip_count) if status: status = ' '.join(status) else: @@ -545,11 +561,12 @@ sortedResult = self._sortResult(self.result) for cid, (cls, cls_results) in enumerate(sortedResult): # subtotal for a class - np = nf = ne = 0 + np = nf = ne = ns = 0 for n,t,o,e in cls_results: if n == 0: np += 1 elif n == 1: nf += 1 - else: ne += 1 + elif n == 2: ne += 1 + else: ns += 1 # format class description if cls.__module__ == "__main__": @@ -562,10 +579,11 @@ row = TemplateData.REPORT_CLASS_TMPL % dict( style = ne > 0 and 'errorClass' or nf > 0 and 'failClass' or 'passClass', desc = desc, - count = np+nf+ne, + count = np + nf + ne + ns, Pass = np, fail = nf, error = ne, + skip = ns, cid = 'c%s' % (cid+1), ) rows.append(row) @@ -575,10 +593,12 @@ report = TemplateData.REPORT_TMPL % dict( test_list = ''.join(rows), - count = str(self.success_count + self.failure_count + self.error_count), + count = str(self.success_count + self.failure_count + + self.error_count + self.skip_count), Pass = str(self.success_count), fail = str(self.failure_count), error = str(self.error_count), + skip = str(self.skip_count), ) return report @@ -588,18 +608,29 @@ rmap = {} classes = [] for n,t,o,e in result_list: - cls = t.test.__class__ - if not rmap.has_key(cls): - rmap[cls] = [] - classes.append(cls) - rmap[cls].append((n,t,o,e)) + if hasattr(t, '_tests'): + for inner_test in t._tests: + self._add_cls(rmap, classes, inner_test, (n,inner_test,o,e)) + else: + self._add_cls(rmap, classes, t, (n,t,o,e)) r = [(cls, rmap[cls]) for cls in classes] return r + def _add_cls(self, rmap, classes, test, data_tuple): + if hasattr(test, 'test'): + cls = test.test.__class__ + else: + cls = test.__class__ + if not rmap.has_key(cls): + rmap[cls] = [] + classes.append(cls) + rmap[cls].append(data_tuple) + def _generate_report_test(self, rows, cid, tid, n, t, o, e): # e.g. 'pt1.1', 'ft1.1', etc + # ptx.x for passed/skipped tests and ftx.x for failed/errored tests. has_output = bool(o or e) - tid = (n == 0 and 'p' or 'f') + 't%s.%s' % (cid+1,tid+1) + tid = ((n == 0 or n == 3) and 'p' or 'f') + 't%s.%s' % (cid+1,tid+1) name = t.id().split('.')[-1] doc = t.shortDescription() or "" desc = doc and ('%s: %s' % (name, doc)) or name @@ -628,7 +659,7 @@ row = tmpl % dict( tid = tid, - Class = (n == 0 and 'hiddenRow' or 'none'), + Class = ((n == 0 or n == 3) and 'hiddenRow' or 'none'), style = n == 2 and 'errorCase' or (n == 1 and 'failCase' or 'none'), desc = desc, script = script, diff -Nru python-nosehtmloutput-0.0.4/htmloutput/version.py python-nosehtmloutput-0.0.5/htmloutput/version.py --- python-nosehtmloutput-0.0.4/htmloutput/version.py 2012-08-08 18:41:01.000000000 +0000 +++ python-nosehtmloutput-0.0.5/htmloutput/version.py 2013-08-08 16:20:10.000000000 +0000 @@ -1 +1 @@ -__version__ = '0.0.1' +__version__ = '0.0.5' diff -Nru python-nosehtmloutput-0.0.4/setup.py python-nosehtmloutput-0.0.5/setup.py --- python-nosehtmloutput-0.0.4/setup.py 2012-08-08 18:41:01.000000000 +0000 +++ python-nosehtmloutput-0.0.5/setup.py 2013-08-08 16:20:10.000000000 +0000 @@ -7,9 +7,8 @@ author='Hewlett-Packard Development Company, L.P.', description="Nose plugin to produce test results in html.", license="Apache License, Version 2.0", - url="https://github.com/cboylan/nose-html-output", + url="https://github.com/openstack-infra/nose-html-output", packages=["htmloutput"], - setup_requires=['nose'], install_requires=['nose'], classifiers=[ "Environment :: Console", @@ -20,7 +19,7 @@ "Operating System :: OS Independent", "Programming Language :: Python" ], - entry_points = { + entry_points={ 'nose.plugins.0.10': [ 'html-output = htmloutput.htmloutput:HtmlOutput' ] diff -Nru python-nosehtmloutput-0.0.4/tools/pip-requires python-nosehtmloutput-0.0.5/tools/pip-requires --- python-nosehtmloutput-0.0.4/tools/pip-requires 1970-01-01 00:00:00.000000000 +0000 +++ python-nosehtmloutput-0.0.5/tools/pip-requires 2013-08-08 16:20:10.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru python-nosehtmloutput-0.0.4/tools/test-requires python-nosehtmloutput-0.0.5/tools/test-requires --- python-nosehtmloutput-0.0.4/tools/test-requires 1970-01-01 00:00:00.000000000 +0000 +++ python-nosehtmloutput-0.0.5/tools/test-requires 2013-08-08 16:20:10.000000000 +0000 @@ -0,0 +1,5 @@ +nose +nose-exclude +nosexcover +openstack.nose_plugin +pep8==1.1 diff -Nru python-nosehtmloutput-0.0.4/tox.ini python-nosehtmloutput-0.0.5/tox.ini --- python-nosehtmloutput-0.0.4/tox.ini 1970-01-01 00:00:00.000000000 +0000 +++ python-nosehtmloutput-0.0.5/tox.ini 2013-08-08 16:20:10.000000000 +0000 @@ -0,0 +1,29 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +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 + NOSE_OPENSTACK_STDOUT=1 +sitepackages=True +deps = -r{toxinidir}/tools/pip-requires + -r{toxinidir}/tools/test-requires +commands = nosetests {posargs} + +[testenv:pep8] +deps = pep8==1.1 +commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,*.egg . + +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 + +[testenv:pyflakes] +deps = pyflakes +commands = pyflakes htmloutput/htmloutput.py htmloutput/nose_wrapper.py setup.py + +[testenv:venv] +commands = {posargs}