folding KnownFailure to success loses data

Bug #409193 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subunit
Fix Released
Wishlist
Robert Collins

Bug Description

subunit folds KnownFailure (and maybe skip or others?) to be treated as success. This loses information, specifically the error/traceback, which would be highly useful in determining just what went wrong. This slightly blocks fixing bug 408821 because it's the skipped tests that I most want to match.

Related branches

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 409193] [NEW] folding KnownFailure to success loses data

This is pretty shallow:

=== modified file 'python/subunit/__init__.py'
--- python/subunit/__init__.py 2009-08-02 22:55:36 +0000
+++ python/subunit/__init__.py 2009-08-05 07:10:15 +0000
@@ -120,7 +120,11 @@
             self.current_test_description == line[offset:-1]):
             self.state = TestProtocolServer.OUTSIDE_TEST
             self.current_test_description = None
- self.client.addSuccess(self._current_test)
+ xfail = getattr(self.client, 'addExpectedFailure', None)
+ if callable(xfail):
+ xfail(self._current_test, RemoteError())
+ else:
+ self.client.addSuccess(self._current_test)
             self.client.stopTest(self._current_test)
         elif (self.state == TestProtocolServer.TEST_STARTED and
             self.current_test_description + " [" == line[offset:-1]):
@@ -203,10 +207,16 @@
             self.current_test_description = None
             self._skip_or_error(self._message)
             self.client.stopTest(self._current_test)
- elif self.state in (
- TestProtocolServer.READING_SUCCESS,
- TestProtocolServer.READING_XFAIL,
- ):
+ elif self.state == TestProtocolServer.READING_XFAIL:
+ self.state = TestProtocolServer.OUTSIDE_TEST
+ self.current_test_description = None
+ xfail = getattr(self.client, 'addExpectedFailure', None)
+ if callable(xfail):
+ xfail(self._current_test, RemoteError(self._message))
+ else:
+ self.client.addSuccess(self._current_test)
+ self.client.stopTest(self._current_test)
+ elif self.state == TestProtocolServer.READING_SUCCESS:
             self._succeedTest()
         else:
             self.stdOutLineReceived(line)

(tests not done, but this should unblock you)

Changed in subunit:
assignee: nobody → Robert Collins (lifeless)
importance: Undecided → Wishlist
status: New → Fix Committed
Changed in subunit:
status: Fix Committed → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote :

Sorry for the bug noise; subunit runs with 'committed' until the release. I hope to do one soon.

Changed in subunit:
status: Fix Released → Fix Committed
Changed in subunit:
status: Fix Committed → Fix Released
milestone: none → 0.0.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.