There are no shell bindings for subunit v2 streams
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subunit |
Fix Released
|
High
|
Unassigned |
Bug Description
We'd like to be able to generate a subunit result stream from a shell script by calling a 'subunit' executable.
I propose adding a 'subunit-output' ython script. The intended usage would be like this:
# Tell subunit that we're starting a test called 'test.name'
subunit-output start test.name
# Tell subunit that the 'test.name' test passed:
subunit-output pass test.name
# similarly, fail 'test.name':
subunit-output fail test.name
We also want to support attaching testtools content objects to the result stream. I propose:
# Attach a detail containing a short text string to the test result, with a label of 'some.data'
subunit-output attach-text "some.data" "some text goes here"
# Attach a detail containing file:
subunit-attach attach-file "screenshot-01" /path/to/
Implementation
==============
It looks like I can instantiate a subunit.
I think this should be a single python file named 'filters/
Testing
======
There's not a lot to test here:
* The command line parser works as expected (i.e.- raises helpful error messages when the wrong number of parameters are given, for e.g.)
* Some system tests that call the filter executable with various parameters and ensure that the resulting output can be read in by the subunit module, and the results are all as expected.
Happy to get feedback on this before I start hacking!
Related branches
- Robert Collins: Needs Fixing
-
Diff: 965 lines (+848/-6)8 files modifiedINSTALL (+4/-1)
Makefile.am (+5/-2)
NEWS (+6/-0)
filters/subunit-output (+23/-0)
python/subunit/_output.py (+203/-0)
python/subunit/tests/__init__.py (+6/-0)
python/subunit/tests/test_output_filter.py (+596/-0)
setup.py (+5/-3)
Changed in subunit: | |
assignee: | nobody → Thomi Richards (thomir) |
summary: |
- Add script to generate subunit result stream from the command line + There are no shell bindings for subunit v2 streams |
Changed in subunit: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in subunit: | |
status: | Triaged → In Progress |
Changed in subunit: | |
status: | In Progress → Fix Committed |
Changed in subunit: | |
milestone: | none → 0.0.17 |
status: | Fix Committed → Fix Released |
So this sounds broadly fine.
A few constraints:
- must not emit anything on stdout other than the requested packet
- should export all the functionality of StreamResultToBytes (though not necessarily in one landing)