v2 protocol conflates failure and error

Bug #1740158 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subunit
Triaged
Low
Unassigned

Bug Description

I've been attempting to implement the v2 protocol in a test runner, and noticed that the protocol contains no provision for distinguishing "failure" (i.e. test assertion failed) and "error" (e.g. test raised an exception) as was possible in v1. This is easily visible using the conversion tools:

  $ (echo test: foo; echo error: foo) | subunit-1to2 | subunit-2to1
  time: 2017-12-26 17:25:38.137904Z
  test: foo
  time: 2017-12-26 17:25:38.138022Z
  failure: foo [ multipart
  ]

Perhaps this is deliberate, and at any rate it's no doubt hard to change now since the protocol allocates a three-bit field for the test status which is fully-populated; but it does mean that v2 loses semantics that people might well be relying on.

Even if it can't be fixed, it would be nice to at least include some advice to implementers who might be confused by this. For example, perhaps the two cases could be disambiguated by convention at a higher level: at least for Python test output an error will normally include a traceback while a failure normally won't.

Jelmer Vernooij (jelmer)
Changed in subunit:
status: New → Triaged
importance: Undecided → Low
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.