[TIP] including tests in packages, or not
robertc at robertcollins.net
Sun Sep 20 21:01:53 PDT 2009
On Sun, 2009-09-20 at 20:14 -0700, C. Titus Brown wrote:
> On Mon, Sep 21, 2009 at 12:56:07PM +1000, Robert Collins wrote:
> > As for your CI server; if it speaks Pandokia or Subunit, you could just
> > toss the tests at an anonymous RPC.
> > For subunit that would be
> > python -m subunit.run tagnabbit.test_suite | <something that pipes stdin
> > to your RPC>
> Hi Rob,
> could you explain? I have lots of RPC - RPC is coming out of my ears
> ;). However, all of my RPC speaks some specific protocol (XML-RPC,
> JSON-RPC, etc.) and wants to connect to some specific URL...
There was a certain amount of fiction, as all the uses I've seen made of
Subunit have been either client driven (e.g. my using ec2 to distribute
bzr test runs and show the results locally) or static reporting (e.g.
+Build;host=snab;tree=samba_3_master;compiler=checker) so far.
The amount of fiction is pretty small though. Subunit already defines a
wire protocol, so if you had a server at http://example.com/submit-tests
which accepts a POST and interprets the body of the POST as Subunit, it
could then insert that into whatever CI format you're using [by using
whatever listener/testresult/$foo your CI uses].
On the client side, it just needs something to take the subunit stream
and do an HTTP Post of it. For instance:
--- subunit-submit ---
cat - > postdata.tmp
curl $1 -d "@postdata.tmp"
echo "test report submitted"
$ python -m subunit.run tagnabbit.test_suite | subunit-submit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090921/641cf3ca/attachment.pgp
More information about the testing-in-python