Merge lp:~jml/subunit/filter-tags into lp:~subunit/subunit/trunk
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 165 | ||||
| Proposed branch: | lp:~jml/subunit/filter-tags | ||||
| Merge into: | lp:~subunit/subunit/trunk | ||||
| Prerequisite: | lp:~jml/subunit/tag-collapsing-rigor | ||||
| Diff against target: |
798 lines (+431/-201) 3 files modified
filters/subunit-filter (+89/-59) python/subunit/test_results.py (+209/-140) python/subunit/tests/test_subunit_filter.py (+133/-2) |
||||
| To merge this branch: | bzr merge lp:~jml/subunit/filter-tags | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robert Collins | 2012-04-20 | Needs Fixing on 2012-05-02 | |
|
Review via email:
|
|||
Commit Message
Add options to filter streams by tags.
Description of the Change
This branch adds options to subunit-filter to have it filter by tags. It has three main components:
1. Separating out a _PredicateFilter from TestResultFilter.
This simplifies TestResultFilter, leaving it managing two concerns: assembling options into a predicate and transforming results. It will be much easier to separate out the 'transforming results' concern after this change.
It is likely that _PredicateFilter could also be written in terms of TestByTestResult at some point.
2. Extending the predicate function to take 'tags'.
I've tried to do this in a way that preserves backwards compatibility and allows any users of TestResultFilter who've had a predicate function that does not support tags to continue using their code unchanged. Perhaps this is not needed.
3. Cleaning up subunit-filter
It behaves a little differently to the other filter commands, and has a different set of options, but these cleanups share code where we can and make the differences -- I hope -- more obvious.
None of this works without the fixes to TagCollapsingDe
jml
- 185. By Jonathan Lange on 2012-04-20
-
Factor a TagsMixin out of TagCollapsingDe
corator - 186. By Jonathan Lange on 2012-04-20
-
Use the TagsMixin on the predicate so local and global tags are tracked correctly.
| Jonathan Lange (jml) wrote : | # |
On 26 April 2012 03:07, Robert Collins <email address hidden> wrote:
> Review: Needs Information
>
> I don't get
> 353 + # XXX: ExtendedToOrigi
> 354 + # https:/
>
Detritus from an earlier version. Have removed it.
jml
- 187. By Jonathan Lange on 2012-04-26
-
Merge trunk
- 188. By Jonathan Lange on 2012-04-26
-
Fix up some XXX comments.
| Robert Collins (lifeless) wrote : | # |
I merged this to a worktree tree of trunk. There was a trivial conflict (mis-bound hunks in test_results.py), but tests failed:
=======
FAIL: test_time_
subunit.
-------
_StringException: Traceback (most recent call last):
File "/home/
('time', date_c)], result._events)
AssertionError: Sequences differ: [('time', datetime.
First differing element 1:
('time', datetime.
('startTest', <subunit.
+ [('time', datetime.
- [('time',
- datetime.
- ('time',
- datetime.
('startTest', <subunit.
+ ('time', datetime.
('addError', <subunit.
('stopTest', <subunit.
+ ('time', datetime.
- ('time',
- datetime.
| Robert Collins (lifeless) wrote : | # |
The TestResultFilter :predicate: parameter docs need updating too:
:param filter_predicate: A callable taking (test, outcome, err,
as 'success' or 'failure'. tags is new in 0.0.8; 0.0.7 filters
are still supported but should be updated to accept the tags
| Robert Collins (lifeless) wrote : | # |
The FixedOffset class is also coming from iso8601.py.
| Robert Collins (lifeless) wrote : | # |
Ah, redundant time statement dropped.
| Robert Collins (lifeless) wrote : | # |
(where by dropped I mean 'I am tired and it moved').
| Jonathan Lange (jml) wrote : | # |
Thanks for landing this.
> "The FixedOffset class is also coming from iso8601.py."
I don't know what this means or is in relation to. Mentioned on IRC, but putting here as it's better suited to async comms.

I don't get nalDecorator doesn't properly wrap current_tags. /bugs.launchpad .net/testtools/ +bug/978027
353 + # XXX: ExtendedToOrigi
354 + # https:/