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()