Merge lp://staging/~jameinel/subunit/omit-times-623654 into lp://staging/~subunit/subunit/trunk
Proposed by
John A Meinel
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Jonathan Lange | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp://staging/~jameinel/subunit/omit-times-623654 | ||||
Merge into: | lp://staging/~subunit/subunit/trunk | ||||
Diff against target: |
209 lines (+124/-0) 3 files modified
NEWS (+8/-0) python/subunit/test_results.py (+34/-0) python/subunit/tests/test_test_results.py (+82/-0) |
||||
To merge this branch: | bzr merge lp://staging/~jameinel/subunit/omit-times-623654 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange | Needs Fixing | ||
Review via email: mp+33601@code.staging.launchpad.net |
Commit message
Emit only the first and last time statements for a long stream of time calls.
Description of the change
This adds filtering for the 'time' commands while processing.
The motivation was that 'zcat pqm-stdout.gz | subunit-filter' ends up generating a ton of 'time' calls after it has filtered out all of the actual test runs.
However, it made sense to me that you only need a time call if it is 'next to' a non-time call.
This just adds a single level of buffering, such that if you call .time() repeatedly, only 2 will be emitted.
To post a comment you must log in.
Thanks for doing this John. I'm sorry it took us so long to get around to your patch. I like the approach of only including 'time:' statements that are relevant to the filtered output, but I think this patch gets it slightly wrong.
For example, given the events::
time: 2010-10-17 20:40:05.577960Z testing. layers. ZopelessLayer: tearDown testing. layers. ZopelessLayer: tearDown [
test: foo
time: 2010-10-17 20:41:05.672960Z
success: foo
time: 2010-10-17 21:29:21.727029Z
test: canonical.
tags: zope:layer
time: 2010-10-17 21:29:21.727397Z
skip: canonical.
tearDown not supported
]
where we are filtering out success and want to see skips. The output should be::
time: 2010-10-17 21:29:21.727029Z testing. layers. ZopelessLayer: tearDown testing. layers. ZopelessLayer: tearDown [ multipart
test: canonical.
time: 2010-10-17 21:29:21.727397Z
skip: canonical.
Content-Type: text/plain
reason
17
tearDown not supported
0
]
Where the output with this patch is::
time: 2010-10-17 20:40:05.577960Z testing. layers. ZopelessLayer: tearDown testing. layers. ZopelessLayer: tearDown [ multipart
time: 2010-10-17 21:29:21.727397Z
test: canonical.
skip: canonical.
Content-Type: text/plain
reason
17
tearDown not supported
0
]
The differences being that the output from this branch includes the first 'time:' statement ever, which is not relevant to the displayed events, and that it excludes the 'time:' statement from between 'test' and 'skip'. There may be a significant chunk of time between a test starting and a test getting its result, and I think we want to show that as long as we're showing time.
As a reminder, a 'time:' statement in a subunit stream means that all subsequent statements can be thought of as occurring at that time, one after the other until the next 'time:' statement.
On a simpler level: filtered_ w_add_unexpecte d_success
* there are two tests named test_timing_
* stopTestRun is defined twice