[prev in list] [next in list] [prev in thread] [next in thread]
List: sonar-user
Subject: Re: [sonar-user] Sonar 3.3 with combined coverage
From: "Larry Shatzer, Jr." <larrys () gmail ! com>
Date: 2012-10-27 17:22:35
Message-ID: CAPr6TnQMQTm=Jap3GtVwQvcBfYLp2WKthdROPV08wn68roqN4w () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Make sure you configure Sonar is configured for the integration test exec
file in the project config.
On Oct 26, 2012 3:27 PM, "Maven User" <maven.2.user@gmail.com> wrote:
> Which kinds of tests are you running?
>
> I can see both the unit and integration .exec files get generated, but I
> feel like nothing as been recorded.
>
> We're using cucumber so I'm wondering if there is something NOT properly
> recording...
>
> On Fri, Oct 26, 2012 at 5:03 PM, Larry Shatzer, Jr. <larrys@gmail.com>wrote:
>
>> I have it point to a local path on the server where I've extracted the
>> jacoco zip file. Not 100% ideal, but works once setup.
>>
>>
>> On Fri, Oct 26, 2012 at 1:43 PM, Maven User <maven.2.user@gmail.com>wrote:
>>
>>> What are you using for the agent path? The path to the agent file in
>>> your local m2 repo?
>>>
>>>
>>> On Fri, Oct 26, 2012 at 12:52 PM, Larry Shatzer, Jr. <larrys@gmail.com>wrote:
>>>
>>>>
>>>> I have a sonar profile that adds the javaagent (Jenkins adds the right
>>>> properties for the jacoco.agent.path and jacoco.file.path)
>>>>
>>>> <profile>
>>>> <id>sonar</id>
>>>> <build>
>>>> <plugins>
>>>> <plugin>
>>>> <groupId>org.apache.maven.plugins</groupId>
>>>> <artifactId>maven-failsafe-plugin</artifactId>
>>>> <configuration>
>>>>
>>>> <argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine>
>>>> </configuration>
>>>> </plugin>
>>>> </plugins>
>>>> </build>
>>>> </profile>
>>>>
>>>> Then I have a profile for my integration tests that kick off failsafe,
>>>> and to only run the integration tests (they are in the same project, just
>>>> named with IT at the start or end)
>>>>
>>>> <profile>
>>>> <id>it</id>
>>>> <build>
>>>> <plugins>
>>>> <plugin>
>>>> <groupId>org.apache.maven.plugins</groupId>
>>>> <artifactId>maven-surefire-plugin</artifactId>
>>>> <configuration>
>>>> <excludes>
>>>> <exclude>**/Test*.java</exclude>
>>>> <exclude>**/*Test.java</exclude>
>>>> <exclude>**/*TestCase.java</exclude>
>>>> </excludes>
>>>> </configuration>
>>>> </plugin>
>>>> <plugin>
>>>> <groupId>org.apache.maven.plugins</groupId>
>>>> <artifactId>maven-failsafe-plugin</artifactId>
>>>> <configuration>
>>>> <excludes>
>>>> <exclude>**/Test*.java</exclude>
>>>> <exclude>**/*Test.java</exclude>
>>>> <exclude>**/*TestCase.java</exclude>
>>>> </excludes>
>>>> <includes>
>>>> <include>**/IT*.java</include>
>>>> <include>**/*IT.java</include>
>>>> <include>**/*ITCase.java</include>
>>>> </includes>
>>>> </configuration>
>>>> <executions>
>>>> <execution>
>>>> <goals>
>>>> <goal>integration-test</goal>
>>>> <goal>verify</goal>
>>>> </goals>
>>>> </execution>
>>>> </executions>
>>>> </plugin>
>>>> </plugins>
>>>> </build>
>>>> </profile>
>>>>
>>>>
>>>>
>>>> On Fri, Oct 26, 2012 at 10:29 AM, Smith, Larry (ECS - Enterprise Cloud
>>>> Service) <larry.smith5@hp.com> wrote:
>>>>
>>>>> Larry,****
>>>>>
>>>>> ** **
>>>>>
>>>>> Can you post your pom?****
>>>>>
>>>>> ** **
>>>>>
>>>>> Larry Smith****
>>>>>
>>>>> ** **
>>>>>
>>>>> *From:* Larry Shatzer, Jr. [mailto:larrys@gmail.com]
>>>>> *Sent:* Friday, October 26, 2012 9:05 AM
>>>>>
>>>>> *To:* user@sonar.codehaus.org
>>>>> *Subject:* Re: [sonar-user] Sonar 3.3 with combined coverage****
>>>>>
>>>>> ** **
>>>>>
>>>>> I got my combined coverage separated since I was long ago using just
>>>>> cobertura for code coverage, and using jacoco for integration test
>>>>> coverage. I used jacoco.exec as the name of the integration test coverage
>>>>> file. I then had to rename the one integration tests produced to
>>>>> itjacoco.exec, and then it separated them.
>>>>>
>>>>> See:****
>>>>>
>>>>> ** **
>>>>>
>>>>> [image: Inline image 1]****
>>>>>
>>>>> ** **
>>>>>
>>>>> On Fri, Oct 26, 2012 at 9:54 AM, Smith, Larry (ECS - Enterprise Cloud
>>>>> Service) <larry.smith5@hp.com> wrote:****
>>>>>
>>>>> I’m really struggling with the combined coverage in 3.3.****
>>>>>
>>>>> ****
>>>>>
>>>>> The two widgets are showing the same results, I would expect that
>>>>> coverage would be different for the unit tests and the integration test,
>>>>> and then there would be an overall coverage that combined the two.****
>>>>>
>>>>> ****
>>>>>
>>>>> I would also expect a separate integration results widget, so that I
>>>>> could quickly drill down to problems in the integration tests.****
>>>>>
>>>>> ****
>>>>>
>>>>> So in V3.3 if UT and IT are really combined values, I am always going
>>>>> to have a discrepancy between what developers see doing UT, and what we
>>>>> show on the server when running both UT and IT. Or do I really have to run
>>>>> two separate jobs in Jenkins (using Sonar), one for normal CI only running
>>>>> UT, and another for a deployment test where both UT and IT are run?***
>>>>> *
>>>>>
>>>>> ****
>>>>>
>>>>> Even though the documentation has been updated for V3.3 regarding the
>>>>> combined coverage with jacoco, it still lacks enough information to
>>>>> configure it correctly. I have looked at the source in github that was
>>>>> recently updated, but it was still difficult to determine how to properly
>>>>> configure maven so that surefire and failsafe were configured correctly to
>>>>> work with jacoco and Sonar.****
>>>>>
>>>>> ****
>>>>>
>>>>> Am I missing something here?****
>>>>>
>>>>> ****
>>>>>
>>>>> Larry Smith****
>>>>>
>>>>> ****
>>>>>
>>>>> *From:* David Gageot [mailto:david.gageot@sonarsource.com]
>>>>> *Sent:* Friday, October 26, 2012 12:18 AM
>>>>> *To:* user@sonar.codehaus.org
>>>>> *Subject:* Re: [sonar-user] Sonar 3.3 with combined coverage****
>>>>>
>>>>> ****
>>>>>
>>>>> Thank you Larry,****
>>>>>
>>>>> ****
>>>>>
>>>>> Here's the ticket: http://jira.codehaus.org/browse/SONAR-3912****
>>>>>
>>>>> It should be fixed in sonar 3.3.1****
>>>>>
>>>>> ****
>>>>>
>>>>> --
>>>>> -- David****
>>>>>
>>>>> ****
>>>>>
>>>>> On 25 October 2012 21:43, Larry Shatzer, Jr. <larrys@gmail.com> wrote:
>>>>> ****
>>>>>
>>>>> I have the Integration Test widget on my dashboard, and now with the
>>>>> combined coverage between both unit test and integration tests (as long as
>>>>> JaCoCo is used for both), the widget has a property showing up instead of a
>>>>> label****
>>>>>
>>>>> ****
>>>>>
>>>>> See the following screenshot:****
>>>>>
>>>>> ****
>>>>>
>>>>> [image: Inline image 1]****
>>>>>
>>>>> ****
>>>>>
>>>>> Ignore the values for each are the same instead of
>>>>> being separated out. That could possibly be a misconfiguration on my side
>>>>> I'm working through. I'm just bringing up the "
>>>>> widget.overall-coverage.name" part. If I still have issues with
>>>>> combined coverage beyond just this label, I'll let you know.****
>>>>>
>>>>> ****
>>>>>
>>>>> -- Larry****
>>>>>
>>>>> ****
>>>>>
>>>>> ** **
>>>>>
>>>>
>>>>
>>>
>>
>
[Attachment #5 (text/html)]
<p>Make sure you configure Sonar is configured for the integration test exec file in \
the project config.</p> <div class="gmail_quote">On Oct 26, 2012 3:27 PM, \
"Maven User" <<a \
href="mailto:maven.2.user@gmail.com">maven.2.user@gmail.com</a>> wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"> Which kinds of tests are you \
running?<br><br>I can see both the unit and integration .exec files get generated, \
but I feel like nothing as been recorded.<br><br>We're using cucumber so I'm \
wondering if there is something NOT properly recording...<br>
<br><div class="gmail_quote">On Fri, Oct 26, 2012 at 5:03 PM, Larry Shatzer, Jr. \
<span dir="ltr"><<a href="mailto:larrys@gmail.com" \
target="_blank">larrys@gmail.com</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">
I have it point to a local path on the server where I've extracted the jacoco zip \
file. Not 100% ideal, but works once setup.<div><div><br><br><div \
class="gmail_quote">On Fri, Oct 26, 2012 at 1:43 PM, Maven User <span \
dir="ltr"><<a href="mailto:maven.2.user@gmail.com" \
target="_blank">maven.2.user@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">What are you using for the agent path? The path to the agent \
file in your local m2 repo?<div><div> <br><br><div class="gmail_quote">On Fri, Oct \
26, 2012 at 12:52 PM, Larry Shatzer, Jr. <span dir="ltr"><<a \
href="mailto:larrys@gmail.com" target="_blank">larrys@gmail.com</a>></span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div><br></div>I have a sonar profile that adds the \
javaagent (Jenkins adds the right properties for the jacoco.agent.path and \
jacoco.file.path)<div>
<br></div><div><div> <profile></div><div> \
<id>sonar</id></div> <div> <build></div><div> \
<plugins></div><div> <plugin></div><div> \
<groupId>org.apache.maven.plugins</groupId></div><div> \
<artifactId>maven-failsafe-plugin</artifactId></div>
<div> <configuration></div><div> \
<argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine></div><div> \
</configuration></div><div> </plugin></div>
<div> </plugins></div><div> </build></div><div> \
</profile></div><div><br></div><div>Then I have a profile for my integration \
tests that kick off failsafe, and to only run the integration tests (they are in the \
same project, just named with IT at the start or end)</div>
<div><br></div><div><div> <profile></div><div> \
<id>it</id></div><div> <build></div><div> \
<plugins></div><div> <plugin></div><div> \
<groupId>org.apache.maven.plugins</groupId></div>
<div> <artifactId>maven-surefire-plugin</artifactId></div><div> \
<configuration></div><div> <excludes></div><div> \
<exclude>**/Test*.java</exclude></div>
<div> <exclude>**/*Test.java</exclude></div><div> \
<exclude>**/*TestCase.java</exclude></div><div> \
</excludes></div><div> </configuration></div>
<div> </plugin></div><div> <plugin></div><div> \
<groupId>org.apache.maven.plugins</groupId></div><div> \
<artifactId>maven-failsafe-plugin</artifactId></div>
<div> <configuration></div><div> \
<excludes></div><div> \
<exclude>**/Test*.java</exclude></div><div> \
<exclude>**/*Test.java</exclude></div>
<div> <exclude>**/*TestCase.java</exclude></div><div> \
</excludes></div><div> <includes></div><div> \
<include>**/IT*.java</include></div>
<div> <include>**/*IT.java</include></div><div> \
<include>**/*ITCase.java</include></div><div> \
</includes></div><div> </configuration></div>
<div> <executions></div><div> \
<execution></div><div> <goals></div><div> \
<goal>integration-test</goal></div><div> \
<goal>verify</goal></div>
<div> </goals></div><div> \
</execution></div><div> </executions></div><div> \
</plugin></div><div> </plugins></div><div> \
</build></div>
<div> </profile></div></div><div><div><div><br></div><div><br></div><br><div \
class="gmail_quote">On Fri, Oct 26, 2012 at 10:29 AM, Smith, Larry (ECS - Enterprise \
Cloud Service) <span dir="ltr"><<a href="mailto:larry.smith5@hp.com" \
target="_blank">larry.smith5@hp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Larry,<u></u><u></u></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> \
<u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Can \
you post your pom?<u></u><u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> \
<u></u></span></p> <p class="MsoNormal" style="text-autospace:none"><span \
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Larry \
Smith<u></u><u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> \
<u></u></span></p> <p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span \
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Larry \
Shatzer, Jr. [mailto:<a href="mailto:larrys@gmail.com" \
target="_blank">larrys@gmail.com</a>] <br>
<b>Sent:</b> Friday, October 26, 2012 9:05 AM</span></p><div><div><br>
<b>To:</b> <a href="mailto:user@sonar.codehaus.org" \
target="_blank">user@sonar.codehaus.org</a><br> <b>Subject:</b> Re: [sonar-user] \
Sonar 3.3 with combined coverage<u></u><u></u></div></div><p></p><div><div> <p \
class="MsoNormal"><u></u> <u></u></p> <p class="MsoNormal">I got my combined coverage \
separated since I was long ago using just cobertura for code coverage, and using \
jacoco for integration test coverage. I used jacoco.exec as the name of the \
integration test coverage file. I then had to rename the one integration tests \
produced to itjacoco.exec, and then it separated them.<br> <br>
See:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><img src="cid:image002.png@01CDB35C.755A55B0" alt="Inline image \
1" height="288" width="466"><u></u><u></u></p> </div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">On Fri, Oct 26, 2012 at 9:54 AM, Smith, Larry (ECS - Enterprise \
Cloud Service) <<a href="mailto:larry.smith5@hp.com" \
target="_blank">larry.smith5@hp.com</a>> wrote:<u></u><u></u></p> <div>
<div>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m \
really struggling with the combined coverage in 3.3.</span><u></u><u></u></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The \
two widgets are showing the same results, I would expect that coverage would be \
different for the unit tests and the integration test, and then there would be an \
overall coverage that combined the two.</span><u></u><u></u></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I \
would also expect a separate integration results widget, so that I could quickly \
drill down to problems in the integration tests.</span><u></u><u></u></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So \
in V3.3 if UT and IT are really combined values, I am always going to have a \
discrepancy between what developers see doing UT, and what we show on the server \
when running both UT and IT. Or do I really have to run two separate jobs in Jenkins \
(using Sonar), one for normal CI only running UT, and another for a deployment test \
where both UT and IT are run?</span><u></u><u></u></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Even \
though the documentation has been updated for V3.3 regarding the combined coverage \
with jacoco, it still lacks enough information to configure it correctly. I have \
looked at the source in github that was recently updated, but it was still difficult \
to determine how to properly configure maven so that surefire and failsafe were \
configured correctly to work with jacoco and Sonar.</span><u></u><u></u></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Am \
I missing something here?</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Larry \
Smith</span><u></u><u></u></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> \
</span><u></u><u></u></p> <p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span \
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David \
Gageot [mailto:<a href="mailto:david.gageot@sonarsource.com" \
target="_blank">david.gageot@sonarsource.com</a>] <br>
<b>Sent:</b> Friday, October 26, 2012 12:18 AM<br>
<b>To:</b> <a href="mailto:user@sonar.codehaus.org" \
target="_blank">user@sonar.codehaus.org</a><br> <b>Subject:</b> Re: [sonar-user] \
Sonar 3.3 with combined coverage</span><u></u><u></u></p> <div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thank you Larry,<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Here's the ticket: <a \
href="http://jira.codehaus.org/browse/SONAR-3912" \
target="_blank">http://jira.codehaus.org/browse/SONAR-3912</a><u></u><u></u></p> \
</div> <div>
<p class="MsoNormal">It should be fixed in sonar 3.3.1<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-- <br>
<span style="color:#999999">-- David</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On 25 October 2012 21:43, Larry Shatzer, Jr. <<a \
href="mailto:larrys@gmail.com" target="_blank">larrys@gmail.com</a>> \
wrote:<u></u><u></u></p> <p class="MsoNormal">I have the Integration Test widget on \
my dashboard, and now with the combined coverage between both unit test and \
integration tests (as long as JaCoCo is used for both), the widget has a property \
showing up instead of a label<u></u><u></u></p> <div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">See the following screenshot:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><img src="cid:image003.png@01CDB35C.755A55B0" alt="Inline image \
1" height="284" border="0" width="470"><u></u><u></u></p> </div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Ignore the values for each are the same instead of being \
separated out. That could possibly be a misconfiguration on my side I'm working \
through. I'm just bringing up the "<a \
href="http://widget.overall-coverage.name" \
target="_blank">widget.overall-coverage.name</a>" part. If I still have issues \
with combined coverage beyond just this label, I'll let you \
know.<u></u><u></u></p> </div>
<div>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">-- Larry</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</blockquote></div>
--20cf30334e41b7790d04cd0dae57--
["image002.png" (image/png)]
["image003.png" (image/png)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic