NUnit test report support

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

NUnit test report support

Erik Ramfelt
Hi

I have just found out about the Hudson project, and I must say that I
was amazed on how simple it was to set it up and get the builds going.
I really like the unit test trends, and as I use C# at my current job
I got thinking of how difficult it would be to integrate NUnit reports
into Hudson. I was looking through the Hudson API, and even if
everything was named JUnit I didnt see any hard coupling to JUnit. The
classes would probably work fine with NUnit reports.

So what do you think? Is it that simple to just create a different XML
parser for the NUnit reports; or is it much more than has to be fixed?


Would you be interested into adding NUnit support to Hudson if I
started building a plugin?

Regards
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:

> Hi
>
> I have just found out about the Hudson project, and I must say that I
> was amazed on how simple it was to set it up and get the builds going.
> I really like the unit test trends, and as I use C# at my current job
> I got thinking of how difficult it would be to integrate NUnit reports
> into Hudson. I was looking through the Hudson API, and even if
> everything was named JUnit I didnt see any hard coupling to JUnit. The
> classes would probably work fine with NUnit reports.
>
> So what do you think? Is it that simple to just create a different XML
> parser for the NUnit reports; or is it much more than has to be fixed?
I don't know much about NUnit, but if it produces a format similar to
JUnit, then reusing most of the JUnit support code should be relatively
straightforward.

> Would you be interested into adding NUnit support to Hudson if I
> started building a plugin?

Yes. Definitely. If you'd be willing to develop the plugin at
http://hudson.dev.java.net/ , let me know your java.net id so that I can
give you the commit access.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Erik Ramfelt
> I don't know much about NUnit, but if it produces a format similar to
> JUnit, then reusing most of the JUnit support code should be relatively
> straightforward.

The layout is some what different but they are very similar. Heres an
example of the nunit XML layout:
<test-results>
  <test-suite name="namespace1" time="0.047">
    <results>
      <test-suite name="namespace2" time="0.047">
        <test-case name="Name" executed="True" success="True"
                time="0.047" asserts="1" />
      </test-suite>
    </results>
  </test-suite>
</test-results>

> > Would you be interested into adding NUnit support to Hudson if I
> > started building a plugin?
> Yes. Definitely. If you'd be willing to develop the plugin at
> http://hudson.dev.java.net/ , let me know your java.net id so that I can
> give you the commit access.

Ok, I will start looking into it, I need a java project to keep me
sane as at my current gig they only use .NET ;)

My java.net id is 'redsolo'. I havent used maven before, but I guess
it shouldnt be to hard to use.

Cheers
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:

>> I don't know much about NUnit, but if it produces a format similar to
>> JUnit, then reusing most of the JUnit support code should be relatively
>> straightforward.
>
> The layout is some what different but they are very similar. Heres an
> example of the nunit XML layout:
> <test-results>
>   <test-suite name="namespace1" time="0.047">
>     <results>
>       <test-suite name="namespace2" time="0.047">
>         <test-case name="Name" executed="True" success="True"
>                 time="0.047" asserts="1" />
>       </test-suite>
>     </results>
>   </test-suite>
> </test-results>
OK. This seems easy enough (although often devils are in the details!)

>> > Would you be interested into adding NUnit support to Hudson if I
>> > started building a plugin?
>> Yes. Definitely. If you'd be willing to develop the plugin at
>> http://hudson.dev.java.net/ , let me know your java.net id so that I can
>> give you the commit access.
>
> Ok, I will start looking into it, I need a java project to keep me
> sane as at my current gig they only use .NET ;)

:-) I sometimes need to do the other way around to keep me sane
(http://www.kohsuke.org/freetrain/)

> My java.net id is 'redsolo'. I havent used maven before, but I guess
> it shouldnt be to hard to use.

Added as a developer. Welcome on board. I created hudson/plugins/nunit
directory for you. You should probably start by copying POM and some
skeleton code from another plugin (perhaps from hello-world plugin). Let
me know if you need any help.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

logist
Hi.

 >>> I don't know much about NUnit, but if it produces a format similar to
 >>> JUnit, then reusing most of the JUnit support code should be relatively
 >>> straightforward.
 >> The layout is some what different but they are very similar.

Maybe it would be easier to convert NUnit report to JUnit format with XSLT? I've
found an XSLT stylesheet for this:

http://issues.apache.org/bugzilla/show_bug.cgi?id=40886

Can't test it because I don't use Net.

=logist (Sergei Shutov)
Dimas ltd., Khabarovsk

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Kohsuke Kawaguchi
Administrator
Yeah, I guess that could be one way to do this. Run XSLT
transformation and feed the result into JUnit result archiver.

2007/7/23, logist <[hidden email]>:

> Hi.
>
>  >>> I don't know much about NUnit, but if it produces a format similar to
>  >>> JUnit, then reusing most of the JUnit support code should be relatively
>  >>> straightforward.
>  >> The layout is some what different but they are very similar.
>
> Maybe it would be easier to convert NUnit report to JUnit format with XSLT? I've
> found an XSLT stylesheet for this:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=40886
>
> Can't test it because I don't use Net.
>
> =logist (Sergei Shutov)
> Dimas ltd., Khabarovsk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Erik Ramfelt
That would mean less code to maintain, and that is always good. I will
try out the XSLT today and see how it looks when feed into the JUnit
result archiver.

Of course this could be a part of a build sequence of a .NET project,
but I think a plugin with direct support for NUnit is preferable than
making the developers jump through hoops. (Which I really liked with
hudson that it was so easy to get going)

cheers
//Erik

On 7/24/07, Kohsuke Kawaguchi <[hidden email]> wrote:

> Yeah, I guess that could be one way to do this. Run XSLT
> transformation and feed the result into JUnit result archiver.
>
> 2007/7/23, logist <[hidden email]>:
> > Hi.
> >
> >  >>> I don't know much about NUnit, but if it produces a format similar to
> >  >>> JUnit, then reusing most of the JUnit support code should be relatively
> >  >>> straightforward.
> >  >> The layout is some what different but they are very similar.
> >
> > Maybe it would be easier to convert NUnit report to JUnit format with XSLT? I've
> > found an XSLT stylesheet for this:
> >
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=40886
> >
> > Can't test it because I don't use Net.
> >
> > =logist (Sergei Shutov)
> > Dimas ltd., Khabarovsk
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Kohsuke Kawaguchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:
> That would mean less code to maintain, and that is always good. I will
> try out the XSLT today and see how it looks when feed into the JUnit
> result archiver.
>
> Of course this could be a part of a build sequence of a .NET project,
> but I think a plugin with direct support for NUnit is preferable than
> making the developers jump through hoops. (Which I really liked with
> hudson that it was so easy to get going)

Agreed.

If the stylesheet is working, what you can do is to create a very simple
plugin which runs XSLT and then programatically feed the result into the
JUnit archiver, instead of doing that as a part of the build script. I
think that's quite doable.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NUnit test report support

Erik Ramfelt
> If the stylesheet is working, what you can do is to create a very simple
> plugin which runs XSLT and then programatically feed the result into the
> JUnit archiver, instead of doing that as a part of the build script. I
> think that's quite doable.

I just have done some tests with the XSL file and the hudson test
report, it works mostly but it fails to transform the
package/namespace names correctly. The package/namespace name is set
to "(root)", and the test class name includes the package/namespace.
Perhaps it wont be that hard to fix, I will give it a try and then
integrate it into the plugin.


//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]