Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Writing output logs from zope.testing.testrunner

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


optilude+lists at gmail

Nov 6, 2009, 7:12 AM

Post #1 of 3 (184 views)
Permalink
Writing output logs from zope.testing.testrunner

Hi,

I'm trying to turn the results of a test run using zope.testing
(zc.recipe.testrunner) into a JUnit compliant XML format so that I can
graph it with Hudson (a continuous integration tool).

Are there any hooks in zope.testing to write reporting to a file?

The output I want is something like this:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="1" failures="3" hostname="hazelnut.osuosl.org"
name="net.cars.engine.PistonTest" tests="5" time="0.048"
timestamp="2007-11-02T23:13:50">
<properties>
...
</properties>
<testcase classname="net.cars.engine.PistonTest" name="moveUp"
time="0.022">
<error message="test timed out after 1 milliseconds"
type="java.lang.Exception">java.lang.Exception: test timed out after 1
milliseconds
</error>
</testcase>
<testcase classname="net.cars.engine.PistonTest" name="moveDown"
time="0.0010" />
<testcase classname="net.cars.engine.PistonTest" name="checkStatus"
time="0.0030">
<failure message="Plunger status invalid to proceed driving."
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
Plunger status invalid to proceed driving.
at net.cars.engine.PistonTest.checkStatus(PistonTest.java:42)
</failure>
</testcase>
<testcase classname="net.cars.engine.PistonTest" name="checkSpeed"
time="0.0080">
<failure message="Plunger upward speed below specifications."
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
Plunger upward speed below specifications.
at net.cars.engine.PistonTest.checkSpeed(PistonTest.java:47)
</failure>
</testcase>
<testcase classname="net.cars.engine.PistonTest" name="lubricate"
time="0.0030">
<failure message="Failed to lubricate the plunger."
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
Failed to lubricate the plunger.
at net.cars.engine.PistonTest.lubricate(PistonTest.java:52)
</failure>
</testcase>
<system-out><![CDATA[Slowly moving up]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

Obviously, this is a Java test case, but you get the idea. Incidentally,
I think nose supports this kind of thing already, but I don't think I
can run zope-like tests using layers etc via nose?

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
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 )


chris at simplistix

Nov 6, 2009, 7:33 AM

Post #2 of 3 (182 views)
Permalink
Re: Writing output logs from zope.testing.testrunner [In reply to]

Martin Aspeli wrote:
> Obviously, this is a Java test case, but you get the idea. Incidentally,
> I think nose supports this kind of thing already, but I don't think I
> can run zope-like tests using layers etc via nose?

Someone proposed writing a nose plugin to do zope.testing layers.
My vote would be to duplicate that rather than trying to rewrite the
output stack of zope.testing.

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
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 )


optilude+lists at gmail

Nov 7, 2009, 8:46 AM

Post #3 of 3 (170 views)
Permalink
Re: Writing output logs from zope.testing.testrunner [In reply to]

Martin Aspeli wrote:
> Hi,
>
> I'm trying to turn the results of a test run using zope.testing
> (zc.recipe.testrunner) into a JUnit compliant XML format so that I can
> graph it with Hudson (a continuous integration tool).
>
> Are there any hooks in zope.testing to write reporting to a file?

I couldn't find any, so I created a new test runner which basically
wraps the output formatter to capture key events.

http://pypi.python.org/pypi/collective.xmltestreport

I was able to use this successfully with Hudson:

http://www.martinaspeli.net/articles/using-hudson-ci-for-plone-projects

(this is not Plone specific and would work for anyone using zope.testing)

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
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 )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.