Re: [PATCH] subunit output for zope.testing

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <20100312140916.GA17675@platonas>
On Thu, Mar 11, 2010 at 10:38:15PM +0000, Jonathan Lange wrote:
> On Thu, Mar 11, 2010 at 9:17 PM, Marius Gedminas <[email protected]> wrote:
> > Incidentally, how do you integrate it with Hudson?  subunit2junitxml, I
> > assume?  How exactly do you combine bin/test with subunit2junitxml -- I
> > assume some care with respect to exit codes?
> 
> I haven't tried myself, but from analogy with other subunit tools:
>   ./bin/test --subunit | subunit2junitxml

Ah, nice.  I was afraid that a naive attempt of something like

  bin/test --subunit > result.subunit
  subunit2junitxml result.subunit -o result.xml

would break because Hudson runs the build step as a shell script with sh
-e and therefore bin/test returning a non-zero exit code would abort the
script without running subunit2junitxml.  But a pipeline ignores the
exit code of all but the very last process.

Incidentally, does subunit2junitxml return a non-zero exit code when
there are failing tests?

I tried to easy_install subunit to experiment, but apparently subunit is
not registered on PyPI (!?)

> The formatter doesn't control exit codes, so I didn't really think
> about them in this patch. Should I produce a follow up?

It's not really in scope for this patch, but given the rising popularity
of Hudson I think it would be nice to have a small README.hudson in
zope.testing explaining the integration.

> > On Thu, Mar 11, 2010 at 08:52:11PM +0000, Jonathan Lange wrote:
> >> === modified file 'src/zope/testing/testrunner/testrunner-leaks.txt'
> >> --- src/zope/testing/testrunner/testrunner-leaks.txt  2008-05-05 18:50:48 +0000
> >> +++ src/zope/testing/testrunner/testrunner-leaks.txt  2010-02-20 22:23:32 +0000
> >> @@ -16,7 +16,7 @@
> >>      >>> from zope.testing import testrunner
> >>
> >>      >>> sys.argv = 'test --layer Layer11$ --layer Layer12$ -N4 -r'.split()
> >> -    >>> _ = testrunner.run(defaults)
> >> +    >>> _ = testrunner.run_internal(defaults)
> >
> > I'm curious about this change.
> 
> Sidnei explained it correctly. This particular file is only tested if
> you're running a Python with --with-pydebug set, so it's easy to miss
> when you make a change.

Ah!  That explains why it wasn't fixed on trunk.

(This bit should probably be committed separately.  And zope.testing
could use a bit more continuous integration with various Python
versions/build flags...)

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkuaSwkACgkQkVdEXeem14/yuACdHJ/SCALU1xORKL/7YcG0yFBr
iacAn2k2o7k4Bhxap5BHqWQNGDStsqmQ
=cgYf
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.