summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomi Richards <thomi.richards@canonical.com>2013-12-02 18:21:08 +1300
committerThomi Richards <thomi.richards@canonical.com>2013-12-02 18:21:08 +1300
commitb1b94f02c4d14ea2c644b3d6adfc82fc255a58c9 (patch)
tree410f2661a989812d0f0aae4861b523db46b3f6d8
parent095223bebfc6322e6a1421257ce9b9a5d969c5fc (diff)
parent3d0dc1aa86187a1bd2df007b6822d98c87000611 (diff)
downloadsubunit-b1b94f02c4d14ea2c644b3d6adfc82fc255a58c9.tar.gz
Merged trunk, fixed conflict.
-rw-r--r--Makefile.am1
-rw-r--r--NEWS8
-rw-r--r--README1
-rw-r--r--configure.ac2
-rwxr-xr-xperl/Makefile.PL.in2
-rw-r--r--python/subunit/__init__.py2
-rwxr-xr-xpython/subunit/run.py17
-rw-r--r--python/subunit/tests/test_run.py14
-rwxr-xr-xsetup.py2
9 files changed, 38 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am
index 3d592cc..2a14b81 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST = \
python/subunit/tests/sample-two-script.py \
python/subunit/tests/test_chunked.py \
python/subunit/tests/test_details.py \
+ python/subunit/tests/test_filters.py \
python/subunit/tests/test_progress_model.py \
python/subunit/tests/test_subunit_filter.py \
python/subunit/tests/test_run.py \
diff --git a/NEWS b/NEWS
index b9763a3..e3e805e 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ subunit release notes
NEXT (In development)
---------------------
+0.0.16
+------
+
BUG FIXES
~~~~~~~~~
@@ -20,6 +23,11 @@ BUG FIXES
* V2 parser errors now set appropriate mime types for the encapsulated packet
data and the error message. (Robert Collins)
+* When tests fail to import ``python subunit.run -l ...`` will now write a
+ subunit file attachment listing the failed imports and exit 2, rather than
+ listing the stub objects from the importer and exiting 0.
+ (Robert Collins, #1245672)
+
IMPROVEMENTS
~~~~~~~~~~~~
diff --git a/README b/README
index 4fa9444..1b0b6e1 100644
--- a/README
+++ b/README
@@ -462,6 +462,7 @@ Releases
========
* Update versions in configure.ac and python/subunit/__init__.py.
+* Update Makefile in the root or do an inplace configure to get an updated Makefile.
* Make PyPI and regular tarball releases. Upload the regular one to LP, the
PyPI one to PyPI.
* Push a tagged commit.
diff --git a/configure.ac b/configure.ac
index 146660a..0d7e9d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
m4_define([SUBUNIT_MAJOR_VERSION], [0])
m4_define([SUBUNIT_MINOR_VERSION], [0])
-m4_define([SUBUNIT_MICRO_VERSION], [15])
+m4_define([SUBUNIT_MICRO_VERSION], [16])
m4_define([SUBUNIT_VERSION],
m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION]))
AC_PREREQ([2.59])
diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in
index 9289594..90a6a5e 100755
--- a/perl/Makefile.PL.in
+++ b/perl/Makefile.PL.in
@@ -12,7 +12,7 @@ sub MY::postamble {
check: # test
uninstall_distcheck:
- rm -fr $(DESTINSTALLARCHLIB)
+ find $(DESTDIR)$(INSTALLSITEARCH) -type f -exec rm {} \;
rm MYMETA.yml
VPATH = @srcdir@
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index b385e9b..8352585 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -153,7 +153,7 @@ from subunit.v2 import ByteStreamToStreamResult, StreamResultToBytes
# If the releaselevel is 'final', then the tarball will be major.minor.micro.
# Otherwise it is major.minor.micro~$(revno).
-__version__ = (0, 0, 15, 'final', 0)
+__version__ = (0, 0, 16, 'final', 0)
PROGRESS_SET = 0
PROGRESS_CUR = 1
diff --git a/python/subunit/run.py b/python/subunit/run.py
index b4ffdb3..7e4d783 100755
--- a/python/subunit/run.py
+++ b/python/subunit/run.py
@@ -33,6 +33,7 @@ from testtools.run import (
BUFFEROUTPUT,
CATCHBREAK,
FAILFAST,
+ list_test,
TestProgram,
USAGE_AS_MAIN,
)
@@ -51,7 +52,7 @@ class SubunitTestRunner(object):
def run(self, test):
"Run the given test case or test suite."
- result = self._list(test)
+ result, _ = self._list(test)
result = ExtendedToStreamDecorator(result)
result = AutoTimingTestResultDecorator(result)
if self.failfast is not None:
@@ -65,9 +66,15 @@ class SubunitTestRunner(object):
def list(self, test):
"List the test."
- self._list(test)
+ result, errors = self._list(test)
+ if errors:
+ failed_descr = '\n'.join(errors).encode('utf8')
+ result.status(file_name="import errors", runnable=False,
+ file_bytes=failed_descr, mime_type="text/plain;charset=utf8")
+ sys.exit(2)
def _list(self, test):
+ test_ids, errors = list_test(test)
try:
fileno = self.stream.fileno()
except:
@@ -77,9 +84,9 @@ class SubunitTestRunner(object):
else:
stream = self.stream
result = StreamResultToBytes(stream)
- for case in iterate_tests(test):
- result.status(test_id=case.id(), test_status='exists')
- return result
+ for test_id in test_ids:
+ result.status(test_id=test_id, test_status='exists')
+ return result, errors
class SubunitTestProgram(TestProgram):
diff --git a/python/subunit/tests/test_run.py b/python/subunit/tests/test_run.py
index 0ca5a51..6ac84e1 100644
--- a/python/subunit/tests/test_run.py
+++ b/python/subunit/tests/test_run.py
@@ -17,14 +17,15 @@
from testtools.compat import BytesIO
import unittest
-from testtools import PlaceHolder
+from testtools import PlaceHolder, TestCase
from testtools.testresult.doubles import StreamResult
import subunit
+from subunit import run
from subunit.run import SubunitTestRunner
-class TestSubunitTestRunner(unittest.TestCase):
+class TestSubunitTestRunner(TestCase):
def test_includes_timing_output(self):
io = BytesIO()
@@ -52,3 +53,12 @@ class TestSubunitTestRunner(unittest.TestCase):
('status', 'name1', 'exists'),
('status', 'name2', 'exists'),
], [event[:3] for event in eventstream._events[:2]])
+
+ def test_list_errors_if_errors_from_list_test(self):
+ io = BytesIO()
+ runner = SubunitTestRunner(stream=io)
+ def list_test(test):
+ return [], ['failed import']
+ self.patch(run, 'list_test', list_test)
+ exc = self.assertRaises(SystemExit, runner.list, None)
+ self.assertEqual((2,), exc.args)
diff --git a/setup.py b/setup.py
index d7089df..5a05002 100755
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ else:
'install_requires': [
'extras',
'testscenarios',
- 'testtools>=0.9.30',
+ 'testtools>=0.9.34',
]
}