← Back to team overview

yellow team mailing list archive

Re: Tasks for bug 974622

 

On 04/13/12 17:09, Gary Poster wrote:
Benji is out on Monday, so people can take over on his work. From his
work/notes, this is what remains:

- add test in subunit for TestProtocolClient.tags method
- add .tags method to TestProtocolClient (see patch below)

These were added in revno 158 of subunit (unreleased). We just need to make our own release (after the work on subunit-filter, below).

- add test in subunit for subunit-filter command to filter by tags
- add filtering by tags
- release subunit in PPA

Brad and I will be working on these this afternoon.

- Verify that jml's three branches have landed for testtools
https://code.launchpad.net/~jml/testtools/tagger/+merge/101904

https://code.launchpad.net/~jml/testtools/wrap-result-in-concurrent-suite/+merge/101902

https://code.launchpad.net/~jml/testtools/tsfr-fixup/+merge/101898

jml says he will release these no later than tomorrow.


- verify/release new testtools in PPA

There is a testtools PPA IIRC so jml will probably release there. We will need to copy that over, maybe just over to the LP PPA.


> - Apply this patch to testrepository (see patch below)

Maybe this needs a test too?

- release testr in PPA




It might be nice to subdivide these into smaller cards...or it might
not. :-P Your call, if you take this. This would be a good task for
pairing, I think. Someone with PPA/packaging knowledge would be good to
have.

Have a great weekend.

Gary



=== modified file 'testrepository/repository/file.py'
--- testrepository/repository/file.py 2011-11-02 18:32:38 +0000
+++ testrepository/repository/file.py 2012-04-13 20:21:54 +0000
@@ -242,6 +242,10 @@
self._time = timestamp
return result

+ def tags(self, new, gone):
+ TestProtocolClient.tags(self, new, gone)
+ self._stream.write('tags: %s\n' % ' '.join(self.current_tags))
+

class _FailingInserter(_SafeInserter):
"""Insert a stream into the 'failing' file."""
@@ -270,7 +274,7 @@
failing = self._repository.get_failing()
failing.get_test().run(inserter)
inserter.stopTestRun()
- inserter= repo.get_inserter(partial=True)
+ inserter = repo.get_inserter(partial=True)
inserter.startTestRun()
run = self._repository.get_test_run(run_id)
run.get_test().run(inserter)




=== modified file 'testrepository/commands/load.py'
--- testrepository/commands/load.py 2011-11-03 15:09:02 +0000
+++ testrepository/commands/load.py 2012-04-13 18:10:23 +0000
@@ -17,13 +17,22 @@
import optparse

import subunit
-from testtools import ConcurrentTestSuite, MultiTestResult
+from testtools import ConcurrentTestSuite, MultiTestResult, Tagger

from testrepository.commands import Command
from testrepository.repository import RepositoryNotFound
from testrepository.results import TestResultFilter


+class TaggingConcurrentTestSuite(ConcurrentTestSuite):
+
+ def _wrap_result(self, result, thread_number):
+ worker_id = 'worker-%s' % thread_number
+ tags_to_add = set([worker_id])
+ tags_to_remove = set()
+ return Tagger(result, tags_to_add, tags_to_remove)
+
+
class load(Command):
"""Load a subunit stream into a repository.

@@ -62,7 +71,7 @@
streams = list(suite)[0]
for stream in streams():
yield subunit.ProtocolTestCase(stream)
- case = ConcurrentTestSuite(cases, make_tests)
+ case = TaggingConcurrentTestSuite(cases, make_tests)
inserter = repo.get_inserter(partial=self.ui.options.partial)
try:
previous_run = repo.get_latest_run()




Follow ups

References