You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien Smadja <js...@xebia.fr> on 2013/01/28 15:58:15 UTC

How to get code coverage of Integration Test ?

Hello,

I'm working on a  40K lines of code project.

We're using :

<tapestry-release-version>5.3.3</tapestry-release-version>

<tapestry-security-version>0.4.4</tapestry-security-version>

<got5-release-version>3.3.3</got5-release-version>

<jacoco.version>0.6.1.201212231917</jacoco.version>

I'm launching my application with *mvn clean tomcat:run* with agent : *
-javaagent:/Users/juliensmadja/.m2/repository/org/jacoco/org.jacoco.agent/0.6.1.201212231917/jacocoagent.jar=destfile=/tmp/jacoco.file.path
*

Then, I launch my selenium tests.

After the execution,  I start my *Sonar 3.4.1* and execute goal *
sonar:sonar *on my project*.*

*mvn sonar:sonar -Dsonar.jacoco.itReportPath=/tmp/jacoco.dump -fn*

And my problem is : *tapestry's components, pages, forms don't seem to be
instrumented* because there is no coverage when watching in Sonar Report.

I have a coverage percent for classes in packages like domain, but nothing
in pages or components.

Do you have a solution for this ? Is this a problem with javassist ?

Thank you

-- 

*Julien Smadja*

 Email : jsmadja@xebia.fr

Mobile : +33(0)6 59 11 72 31

http://www.xebia.fr

http://blog.xebia.fr

*Siège Social*

La Défense Colisée

10 / 12 Avenue de l'arche

Faubourg de l'Arche

92419 Courbevoie Cedex

Re: How to get code coverage of Integration Test ?

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 29.01.2013 11:29, Julien Smadja wrote:

> Unfortunately, I think I won't be able to automatize this task.

You could try the integration server from Jetbrains, Teamcity, but I do
not know if it is able to perform the same instrumentation as IDEA.

http://www.jetbrains.com/teamcity/

- Stephan


Re: How to get code coverage of Integration Test ?

Posted by Julien Smadja <js...@xebia.fr>.
Yes, it works.

I had to use Tomcat server instead of mvn tomcat:run command in Intellij
Idea.

Unfortunately, I think I won't be able to automatize this task.

Thank you for your answer.

Re: How to get code coverage of Integration Test ?

Posted by Julien Smadja <js...@xebia.fr>.
Thank you, I'll test your solution with Idea 12, and I'll tell you if it
works too.


2013/1/29 Stephan Windmüller <st...@tu-dortmund.de>

> On 28.01.2013 15:58, Julien Smadja wrote:
>
> > I have a coverage percent for classes in packages like domain, but
> nothing
> > in pages or components.
> >
> > Do you have a solution for this ? Is this a problem with javassist ?
>
> IIRC we had the same problem using EMMA[0].
>
> What did work was the code coverage integrated in IntelliJ IDEA[1]. We
> started our application server from within the IDE and were able to
> measure the code coverage of Tapestry pages.
>
> HTH
>  Stephan
>
> [0] http://emma.sourceforge.net/
> [1] http://www.jetbrains.com/idea/webhelp/code-coverage-2.html
>
>


-- 

*Julien Smadja*

 Email : jsmadja@xebia.fr

Mobile : +33(0)6 59 11 72 31

http://www.xebia.fr

http://blog.xebia.fr

*Siège Social*

La Défense Colisée

10 / 12 Avenue de l'arche

Faubourg de l'Arche

92419 Courbevoie Cedex

Re: How to get code coverage of Integration Test ?

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 29.01.2013, Lenny Primak wrote:

> Have you tried running in production mode?  That might work better. 

Just tested it, enabling production mode has no effect.

- Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to get code coverage of Integration Test ?

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Have you tried running in production mode?  That might work better. 

On Jan 29, 2013, at 3:05 AM, Stephan Windmüller <st...@tu-dortmund.de> wrote:

> On 28.01.2013 15:58, Julien Smadja wrote:
> 
>> I have a coverage percent for classes in packages like domain, but nothing
>> in pages or components.
>> 
>> Do you have a solution for this ? Is this a problem with javassist ?
> 
> IIRC we had the same problem using EMMA[0].
> 
> What did work was the code coverage integrated in IntelliJ IDEA[1]. We
> started our application server from within the IDE and were able to
> measure the code coverage of Tapestry pages.
> 
> HTH
> Stephan
> 
> [0] http://emma.sourceforge.net/
> [1] http://www.jetbrains.com/idea/webhelp/code-coverage-2.html
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to get code coverage of Integration Test ?

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 28.01.2013 15:58, Julien Smadja wrote:

> I have a coverage percent for classes in packages like domain, but nothing
> in pages or components.
> 
> Do you have a solution for this ? Is this a problem with javassist ?

IIRC we had the same problem using EMMA[0].

What did work was the code coverage integrated in IntelliJ IDEA[1]. We
started our application server from within the IDE and were able to
measure the code coverage of Tapestry pages.

HTH
 Stephan

[0] http://emma.sourceforge.net/
[1] http://www.jetbrains.com/idea/webhelp/code-coverage-2.html


Re: How to get code coverage of Integration Test ?

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 28.01.2013, Julien Smadja wrote:

> And my problem is : *tapestry's components, pages, forms don't seem to be
> instrumented* because there is no coverage when watching in Sonar Report.
> 
> I have a coverage percent for classes in packages like domain, but nothing
> in pages or components.

This post is rather old, but I stumpled upon this problem again and
thought about sharing a possible solution.

As explained in the FAQ[0] of Jacoco, there can be issues when classes
are changed in the application server, this changing the class id[1].
There are two possible solutions:

1. Specify a classdumpdir for the agent and use those classes for reporting.

2. Use offline instrumentation.

Both worked for me, but the first option produced duplicates of classes
which caused the reporting to fail.

Regards
 Stephan

[0] http://www.eclemma.org/jacoco/trunk/doc/faq.html
[1] http://www.eclemma.org/jacoco/trunk/doc/classids.html
[2] http://www.eclemma.org/jacoco/trunk/doc/offline.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to get code coverage of Integration Test ?

Posted by Steve Eynon <st...@alienfactory.co.uk>.
T5 instruments pages and components itself and uses it's own class
loader to reload them, so it's very unlikely Sonar is able to hook
that. (Not that I know anything of Sonar.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org