subunit-filter leaves in all the time statements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subunit |
Confirmed
|
Undecided
|
John A Meinel |
Bug Description
If you run 'subunit-filter' on a stream, it still passes through all of the 'time' statements. In the case of running a bzr pqm output, and filtering out everything that isn't an actual failure or error, this ended up with a 2.4MB file with nothing but 'time:' statements and about 10 lines of actual failure information.
The approach I'm probably going to take is a state machine with:
if the last thing I did was output a time: line
and the next thing I'm going to do is going to output a time line
omit the next line for now, but mark it pending
if the next line is not a time line, and I have a pending time line, emit it.
The idea is that if you just did an operation, then you probably want to know what time it ended. And if you are about to start a new operation, then you want to know what time it started. But all the times inbetween are just noise.
So if you had:
time
test.success
time
All of them would be output. If you had
time
test.success
time
time
All would be output (one is the end of the test suite, one is the length of the success run), but
time 1
test.success
time 2
time 3
time 4
would get truncated to
time 1
test.success
time 2
time 4
However, filtering a stream 2x should produce the same output as a single filter.
Related branches
- Jonathan Lange: Needs Fixing
-
Diff: 209 lines (+124/-0)3 files modifiedNEWS (+8/-0)
python/subunit/test_results.py (+34/-0)
python/subunit/tests/test_test_results.py (+82/-0)
Changed in subunit: | |
assignee: | nobody → John A Meinel (jameinel) |
status: | New → Confirmed |
Sounds fine to me. To put it a way I can understand:
when there are three or more time: statements with nothing between
them, the middle ones can be discarded.