Re: [java code coverage] what if I want the coverage of the different code between my branch and master

2018-08-24 Thread Mirko Friedenhagen
Hello,

a bit off-topic, please hop to the sonarqube forum for further details.

Basically you have to create the coverage beforehand by running e.g. “mvn
Test” after configuring the jacoco-maven-plugin in your project.

mvn sonar:sonar will then pick up the coverage data and show you detailed
reports. How to create separate reports for integration tests is better
asked in the sonarqube forum.

Regards
Mirko

 schrieb am Fr. 24. Aug. 2018 um 02:28:

> Hi
>
>   Thanks for your answer.
>   I have googled the sonarqube and find it is a code analysis tool.It
> also can do code coverage anlysis.Do you know the principle ? I mean does
> sonarqube use jacoco to get the full code coverage and do some analysis to
> get the code coverage on new line? Or it does this all by itself?
>Besides , I want get integration test report,not the unit test
> (which the test code and the tested code are in the same project) report, I
> have created a integration test project which is separated from the tested
> project. Does sonarqube support this scenario?
>
> Best regards
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/25f3f405-23dc-42e1-adba-818aa32aafea%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwc4D5Yn%2BVE4sDDVLJFSVdiGUWOxhw4OEhiO2iX8hhvpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] what if I want the coverage of the different code between my branch and master

2018-08-22 Thread Mirko Friedenhagen
Hello,

I do not think Jacoco offers this out of the box. What you would need is
historisation of data.

I would recommend to setup sonarqube for this which will not only historise
coverage but additionally will do a lot of other useful analysises of your
code which will help you to find and fix errors in your code.

Regards
Mirko

 schrieb am Do. 23. Aug. 2018 um 06:35:

> Hi,
>
> I have a requirement.
>
> In enterprise ,we release new version nearly every week,I only need to
> test the new function,i.e.,i only need test the code that added or modified
> for the new fuction.So ,I want the coverage rate of this part of the code
> instead of the full code.
>
> Does Jacoco supports my request?
> Best regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/038b17ee-8c47-4ae6-b2f9-f9232113c703%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwBYvV9395KEfbosba84pVygw6PXqOT-o4YeaQvXyWjbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Jenkins Plugin and Jacoco Agent Jar delivered exec file

2018-04-11 Thread Mirko Friedenhagen
Hello Aswak,

this is something you would better ask on the jenkins user mailing list, as
the jacoco developers do not track which versions of derived software are
using which version of jacoco itself.

That said I do not think there is a wiki-page, however you could go to the
github page of the plugin and look into the history of the pom.xml to
gather this information.

Best regards
Mirko
-- 
Sent from my mobile

 schrieb am Mi., 11. Apr. 2018, 19:55:

> hi , i was looking for some information on which Jacoco plugin in Jenkins
> support the parsing of exec files generated by a specific version of Jacoco
> Agent.Is there a mapping that i can look into.My current version of Jenkins
> is Jenkins ver. 1.651.3.
> Thanks,
> aswak
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/ba9f42a6-7940-4e89-9e87-2898fb015dee%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwp2c8mKnWGesdTUsP6wERQHEg54DEcugdDv45-3-ewzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Combined results for Maven surefire and failsafe?

2018-03-22 Thread Mirko Friedenhagen
Hello Mike,

if you only configure the goals "prepare-agent" and "report" as executions
the coverage should be automatically measured for tests run by surefire and
failsafe combined.

Just *do not* define executions for prepare-agent-integration resp.
report-integration.

Could you show the configuration of the jacoco-maven-plugin?

Best regards
Mirko
-- 
Sent from my mobile

Am 22.03.2018 20:01 schrieb "Mike Duigou" :

First off: Thank you for an excellent tool and the ongoing support you've
been doing. We have been using jacoco since 0.7.2 and it have been
extremely reliable and useful for us. Timely support of new JDK releases is
definitely appreciated!

Our build environment includes both unit and integration tests which are
run by Maven Surefire and Failsafe plugins respectively. Unfortunately I
have been unsuccessful producing a code coverage report that includes the
results of both types of tests. The default jacoco maven plugin recipe is
geared towards unit tests. I was able to figure out a way to switch
reporting to the integration tests by forcing the filename of the jacoco
output but I haven't been able to come up with a recipe for producing a
combined report.

Is it possible? Should perhaps combined reports be the default with split
reports for unit and integration tests being an option?

Thanks,

Mike

--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/jacoco/0d915fe7-0dfd-4ce2-819a-b62605e437c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqx2YD0UKPB41msfVFx2eTsh%2BR3LyDe1%2B0hHa%3D7eFffMFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] JaCoCo Test Coverage Badges?

2018-02-11 Thread Mirko Friedenhagen
Hello,

another caveat: which metric to use for this. I would go for complexity, as
it is the most valuable IMO.

Best regards
Mirko
-- 
Sent from my mobile

Am 11.02.2018 22:42 schrieb "Marc Hoffmann" :

> Hi Andy,
>
> If the coverage is greater than or equal to the passing score, the badge
>> is green;
>> otherwise, it's red, indicating more tests are needed.
>>
>
> I'm a bit scared about such customization requirements especially when it
> comes to UI. They tend to draw a lot of attention, cause many discussions
> and keep us from working on the core. That's why we typically refuse them.
>
> I would propose to use a linear gradient from red to green depending on
> statement coverage. Would that work for you?
>
> Cheers,
> -marc
>
> On 2018-02-11 21:51, andy.boo...@gmail.com wrote:
>
>> Hi Marc,
>>
>> That was quick! And the badge looks great! It also makes sense that it
>> wouldn't be a new goal, now that you've said it.
>>
>> Here's a brief wish list, based on how our builds work:
>>
>> * The badge should also be generated for the aggregate goal in the maven
>> plugin
>> * It would be nice to have a new optional parameter with value 0-100
>> default 70 -- maybe called something like "passing" -- that represents
>> the minimum passing score. If the coverage is greater than or equal to
>> the passing score, the badge is green; otherwise, it's red, indicating
>> more tests are needed.
>>
>> Thank you for taking the idea so seriously! Please let me know if
>> there's anything I can do to help development!
>>
>> On Sunday, February 11, 2018 at 12:32:50 PM UTC-8, Marc R. Hoffmann wrote:
>>
>>> Hi,
>>>
>>> I played a bit with svg badges. Would something as simple as the one
>>> attached to the job? This would be quite simple to generate.
>>>
>>> I wouldn't create a new goal for this. It could simply be another report
>>> format of the existing reporting tools (Maven, Ant, Command Line).
>>>
>>> Cheers,
>>> -marc
>>>
>>> On 2018-02-11 00:39, andy wrote:
>>> > Hello,
>>> >
>>> > I'm using JaCoCo in Maven to generate test coverage reports. It's
>>> > working great! It works so well I want to put a badge in my GitHub
>>> > README -- like the "build: passing" badges you see all over -- to
>>> > motivate me to keep my test coverage up.
>>> >
>>> > I've poked around for ways to generate a badge from JaCoCo Test
>>> > Coverage data. It looks like there are plugins for Jenkins and Travis,
>>> > but both of those cost a good bit of money for use on private
>>> > repositories. I'm using AWS CodeBuild -- which is cheap and has been
>>> > working great for me -- but has no JaCoCo badge support that I can
>>> > see.
>>> >
>>> > Is there a good way to build test coverage badges in JaCoCo?
>>> >
>>> > If there isn't currently a good way, would the JaCoCo team be
>>> > interested in a new goal in the maven plugin to generate said badges?
>>> > I imagine the goal could be called "badge" (or similar) and would be
>>> > designed to consume the report-aggregate output, and it would generate
>>> > an SVG file reflecting total test coverage across all files.
>>> >
>>> > If this sounds interesting to the team, I'd be happy to rough out an
>>> > implementation for review!
>>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/jacoco/ffaa673c2496a59945520dc6a8097138%40mountainminds.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqyF2jrCUu20SYSqr9_ginSn5XkPG0xw0MTqn104G1fF4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Does JaCoCo work with mocking frameworks?

2017-10-04 Thread Mirko Friedenhagen
Hello,  at my company we use jacoco with mockito all the time,
power-mockito or any framework which manipulates the classes when loading
them is more tricky.

Regards
Mirko
-- 
Sent from my mobile

Am 05.10.2017 03:37 schrieb :

> I've banging my head against the wall trying to make JaCoCo include
> coverage for tests that use Mockito. I'm writing unit & instrumentation
> test for Android and JaCoCo keep yielding 0% code coverage for the tests
> that use Mockito to mock objects.
>
> Can someone please confirm if JaCoCo works with Mockito?
>
> I have a question in SO with all the details, so please feel free to take
> a look https://stackoverflow.com/questions/46517471/jacoco-
> mockito-android-tests-zero-coverage-reported
>
> Cheers!
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/d558e2cc-6697-47eb-a1f2-59dd4905325d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqyMtHjY_RpHQTUG9Urd5PFexzqnD6bdsCE2wv%2BnAkRHTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Re: Best way to view JaCoCo.exec

2017-02-17 Thread Mirko Friedenhagen
Hello,

one hint: reports using the Maven plugin may report different coverages
than the ones found in SonarQube because aggregation done by the tools is
different.
So if you have hard limits for a failing QA gate in SonarQube you may have
discussions with developers.

Regards
Mirko
-- 
Sent from my mobile

Am 15.02.2017 21:53 schrieb "Evgeny Mandrikov" :

> Hi,
>
> Please have a look at JaCoCo documentation at http://www.jacoco.org/
> jacoco/trunk/doc/
> SonarQube is not the only one that can generate/show reports - there are
> Maven plugin, Ant tasks, etc
>
> On Wednesday, February 15, 2017 at 8:45:45 PM UTC+1,
> rahul.s.rath...@gmail.com wrote:
>>
>> Hi,
>>
>> I have an environment having TC sever as application server where I have
>> configured JaCoCo. It successfully generates JaCoCo.exec. Currently, I view
>> this JaCoCo.exec report using SonarQube but the way I am following in
>> SonarQube takes several Hrs to complete. When I run Sonar it first scans
>> all source files and then runs code coverage report. May be I am doing
>> something wrong and directly JaCoCo report can be viewed. Is it possible?
>> Or is there any way to view this report faster and correctly? What things I
>> should keep in mind when I am using this report generated at TC server in
>> some other tool.
>>
>> Thanks!
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/cf5d3c6b-e583-487c-a2fe-963fd2a33a17%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqxEgT50z%3D2ySbzDP%2B480fnkE3Gwutp%2B4EGd_v6cOpuwXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Off by behavior for source code lines with kotlin?

2017-01-26 Thread Mirko Friedenhagen
Hello,

just for the record: But in the kotlin-tracker
https://youtrack.jetbrains.com/issue/KT-16002

Regards
Mirko
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/


On Thu, Jan 26, 2017 at 5:16 PM, Marc R. Hoffmann
 wrote:
> Hi Mirko,
>
> first of all: Nice to see you back here :-)
>
> This seems to be an issue with the Kotlin compiler. The compiled class file
> AppKt has a reference to line 18 in method outer(). See decmpiled version
> below. JaCoCo simply takes this debug line information from the class file.
>
> Cheers,
> -marc
>
>
>
>
> Classfile
> /Users/marc/git/jacoco-kotlin-sample/target/classes/de/friedenhagen/jacocokotlinsample/AppKt.class
>   Last modified 26.01.2017; size 1107 bytes
>   MD5 checksum 5f18406d76db819836b94e2d5a6193df
>   Compiled from "App.kt"
> public final class de.friedenhagen.jacocokotlinsample.AppKt
>   SourceFile: "App.kt"
>   SourceDebugExtension:
> SMAP
> App.kt
> Kotlin
> *S Kotlin
> *F
> + 1 App.kt
> de/friedenhagen/jacocokotlinsample/AppKt
> + 2 IntrinsicArrayConstructors.kt
> org/jetbrains/kotlin/codegen/intrinsics/IntrinsicArrayConstructorsKt
> *L
> 1#1,17:1
> 39#2:18
> *E
> *S KotlinDebug
> *F
> + 1 App.kt
> de/friedenhagen/jacocokotlinsample/AppKt
> *L
> 16#1:18
> *E
>   RuntimeVisibleAnnotations:
> 0:
> #26(#27=[I#28,I#28,I#28],#29=[I#28,I#30,I#30],#31=I#32,#33=[s#34],#35=[s#5,s#36,s#37])
>   minor version: 0
>   major version: 50
>   flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER
> Constant pool:
>#1 = Utf8   de/friedenhagen/jacocokotlinsample/AppKt
>#2 = Class  #1 //
> de/friedenhagen/jacocokotlinsample/AppKt
>#3 = Utf8   java/lang/Object
>#4 = Class  #3 //  java/lang/Object
>#5 = Utf8   outer
>#6 = Utf8   ()V
>#7 = Utf8   de/friedenhagen/jacocokotlinsample/App
>#8 = Class  #7 //
> de/friedenhagen/jacocokotlinsample/App
>#9 = Utf8   Companion
>   #10 = Utf8
> Lde/friedenhagen/jacocokotlinsample/App$Companion;
>   #11 = NameAndType#9:#10 //
> Companion:Lde/friedenhagen/jacocokotlinsample/App$Companion;
>   #12 = Fieldref   #8.#11 //
> de/friedenhagen/jacocokotlinsample/App.Companion:Lde/friedenhagen/jacocokotlinsample/App$Companion;
>   #13 = Utf8   java/lang/String
>   #14 = Class  #13//  java/lang/String
>   #15 = Utf8   [Ljava/lang/Object;
>   #16 = Class  #15//  "[Ljava/lang/Object;"
>   #17 = Utf8   [Ljava/lang/String;
>   #18 = Class  #17//  "[Ljava/lang/String;"
>   #19 = Utf8   de/friedenhagen/jacocokotlinsample/App$Companion
>   #20 = Class  #19//
> de/friedenhagen/jacocokotlinsample/App$Companion
>   #21 = Utf8   main
>   #22 = Utf8   ([Ljava/lang/String;)V
>   #23 = NameAndType#21:#22//  main:([Ljava/lang/String;)V
>   #24 = Methodref  #20.#23//
> de/friedenhagen/jacocokotlinsample/App$Companion.main:([Ljava/lang/String;)V
>   #25 = Utf8   elements$iv
>   #26 = Utf8   Lkotlin/Metadata;
>   #27 = Utf8   mv
>   #28 = Integer1
>   #29 = Utf8   bv
>   #30 = Integer0
>   #31 = Utf8   k
>   #32 = Integer2
>   #33 = Utf8   d1
>   #34 = Utf8
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/13e7fb57-0c08-4800-d173-7947387f7453%40mountainminds.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwjHacqzUFrsEPzHwz6cVUQn66ELN1O7P46q92dd6%3Dj7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[java code coverage] Off by behavior for source code lines with kotlin?

2017-01-25 Thread Mirko Friedenhagen
Hello,

I am playing with Kotlin and tried to do a POC for a SonarQube plugin[0]
While doing this I encountered a strange behavior (at least for me)
SonarQube  iterates on iSourceFileCoverage and checks that  the number
of lines in  iSourceFileCoverage do not exceed the number of lines of
the source code.

I developed a small sample project which should show the behavior[1]
If you look at the output the line count:

XXX de/friedenhagen/jacocokotlinsample/App: iClassCoverage.lastLine=6,
iSourceFileCoverage.lastLine=18
XXX de/friedenhagen/jacocokotlinsample/App: lines=17 lastLine=18

lastLine is 18 but only 17 lines are found in the source[2].

The jacoco-maven-plugin is able to render the coverage correctly[3].

Note that kotlin creates a synthetic class AppKt file for methods not
found directly in the class, i.e. the companion object and the outer
method defined in [2].

Best Regards Mirko

[0] https://groups.google.com/d/topic/sonarqube/eyJa_y_-aoU/discussion
[1] https://gitlab.com/mfriedenhagen/jacoco-kotlin-sample/builds/9289284
[2] 
https://gitlab.com/mfriedenhagen/jacoco-kotlin-sample/blob/e1dacb838191920ddf9eeeffc3dfb20d622e3bd1/src/main/kotlin/de/friedenhagen/jacocokotlinsample/App.kt
[3] https://mfriedenhagen.gitlab.io/jacoco-kotlin-sample/
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwa6WzHVAuK7mUqpZDy8Ae76yEvXC8R5k_-7AscoH0gvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] default lifecycle phase of jacoco:prepare-agent

2016-11-12 Thread Mirko Friedenhagen
skipTests and maven.skip.test have different semantics, the first one will
only skip execution of surefire and failsafe while with the latter even the
compilation of test sources will be skipped. So if you want to run your ITs
only you would need skipTests=true and skipITs=false.

You could set two properties in your project:
false
${skipTests}

I do not run the projects with skipTests. I do not know why prepare-agent
comes that early but it should definitely be latest in phase testCompile.
Maybe Marc has a better explanation why he chose to use initialize.

Regards
Mirko
-- 
Sent from my mobile

Am 12.11.2016 10:30 schrieb <andreas.man...@gmail.com>:

> Hello Mirko,
>
> sure I can switch away from the default phase, but shouldn't the default
> be the best value for most cases? I'd expect that the agent init could run
> right before the test case execution? Might be i miss something here?
>
> For the skip - do you run these projects with skipTests set?
>
> Kind Regards,
> Andreas.
>
>
> Am Samstag, 29. Oktober 2016 12:59:52 UTC+2 schrieb Mirko Friedenhagen:
> > Hello,
> >
> > you mean skip when maven.test.skip is set?
> >
> > You may achieve this easily by referencing this property in the
> default-prepare-agent execution. There you may easily redefine the bound
> phase as well.
> >
> > I use jacoco in projects which have no tests run by surefire or failsafe
> but the invoker plugin, so this could break my use case :-).
> >
> > Regards
> >
> > Mirko
> >
> > --
> >
> > Sent from my mobile
> >
> >
> >
> > Am 29.10.2016 12:15 schrieb  <andreas...@gmail.com>:
> > Hello list,
> >
> >
> >
> > sorry if this has been already discussed. I just came across this and
> I'm not sure to understand it fully.
> >
> >
> >
> > I wonder why the jacoco:prepare-agent maven goal is bound to the very
> early lifecycle phase "initialize"? Wouldn't be a later phase be more
> reasonable?
> >
> >
> >
> > I assume in most cases this does not matter - nevertheless I've a nested
> multi module maven project here which breaks because the inherited
> "prepare-agent" needs to be evaluated so early and maven misses to find
> dependent modules.
> >
> >
> >
> > One 2nd thing, would it be possible to automatically ignore the
> "prepare-agent" if tests are skipped?
> >
> >
> >
> > Thanks for feedback,
> >
> >
> >
> > Kind Regards, Andreas.
> >
> >
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "JaCoCo and EclEmma Users" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to jacoco+un...@googlegroups.com.
> >
> > To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com.
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/c2538d47-d56d-4531-9cc7-3aefca44d614%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqzjicfbqOyZOs7vDYhe-oOVv8LDK6503mDvnCZyLpr7Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] default lifecycle phase of jacoco:prepare-agent

2016-10-29 Thread Mirko Friedenhagen
Hello,

you mean skip when maven.test.skip is set?
You may achieve this easily by referencing this property in the
default-prepare-agent execution. There you may easily redefine the bound
phase as well.

I use jacoco in projects which have no tests run by surefire or failsafe
but the invoker plugin, so this could break my use case :-).
Regards
Mirko
-- 
Sent from my mobile

Am 29.10.2016 12:15 schrieb :

> Hello list,
>
> sorry if this has been already discussed. I just came across this and I'm
> not sure to understand it fully.
>
> I wonder why the jacoco:prepare-agent maven goal is bound to the very
> early lifecycle phase "initialize"? Wouldn't be a later phase be more
> reasonable?
>
> I assume in most cases this does not matter - nevertheless I've a nested
> multi module maven project here which breaks because the inherited
> "prepare-agent" needs to be evaluated so early and maven misses to find
> dependent modules.
>
> One 2nd thing, would it be possible to automatically ignore the
> "prepare-agent" if tests are skipped?
>
> Thanks for feedback,
>
> Kind Regards, Andreas.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqz6ssmOp2_rokktu%2B_BzvpMpyWmdNsSYSYuHKGvRepBAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] "Skipping JaCoCo execution due to missing execution data file." only in CI environment

2016-07-04 Thread Mirko Friedenhagen
Hello,

the prepare steps only set a system property argLine, which is picked up by
surefire resp. failsafe plugins and added for the forked test JVM. You are
using the invoker plugin, where an equivalent option is called invokerOpts,
see http://maven.apache.org/plugins/maven-invoker-plugin/run-mojo.html.

Try setting a property ${argLine}.

Regards
Mirko
-- 
Sent from my mobile
Am 05.07.2016 00:38 schrieb <teunic...@gmail.com>:

Hi Mirko,

Unfortunately that did not solve the issue.

Commands executed:
mvn -N io.takari:maven:wrapper -Dmaven=3.3.9
./mvnw --show-version clean verify

Output here:
https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/fac1d3372bb24d18f3df7fcba5a8acc9a0c4296a/wrapper_test.txt

On Monday, July 4, 2016 at 4:36:02 PM UTC-5, Mirko Friedenhagen wrote:
> Hello,
>
> you could try to use Maven 3.3.9 as well in Travis, see
>
> https://github.com/mojohaus/mojo-parent/blob/master/.travis.yml for how
to use the takari wrapper plugin.
>
> Regards
>
> Mirko
>
> --
>
> Sent from my mobile
>
> Am 04.07.2016 22:15 schrieb  <pilch.p...@gmail.com>:
> Hello,
>
>
>
> I am trying to debug an issue I'm experiencing with JaCoCo that manifests
in my CI environment (Travis), but not locally on my workstation. My
intended goal is to have two separate reports produced by JaCoCo - one for
unit tests, and the other for integration tests.
>
>
>
> On my workstation running Maven 3.3.9 and JDK 1.8.0_91, everything works
as intended when I run standard lifecycle goals like "install" or "verify".
I based my configuration off of
https://github.com/Godin/sonar-experiments/blob/master/jacoco-examples/maven-invoker-plugin-example/pom.xml
>
> My ${project.reporting.outputDirectory} successfully contains "jacoco-it"
and "jacoco-ut".
>
> My POM file is here:
https://github.com/patrickpilch/dependency-license-checker/blob/d4a3e3370639c2f52d7083ca5163cdaaace3ba15/pom.xml#L153
and a debug log of a successful local build is here:
https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/local_build_log.md
>
>
>
> The problem I'm experiencing is that when trying to build in my CI
environment, only the JaCoCo unit tests .exec file and reports appear. The
Travis build debug output with environment details and versions is here:
https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/ci_build_output.md
>
>
>
> It's easy to reproduce this on a Travis docker container. Instructions
here:
https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/steps_to_reproduce.md
>
>
>
> Any help would be appreciated. Thank you!
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an
email to jacoco+un...@googlegroups.com.
>
> To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/0ebc42d3-0228-4ab5-a4a8-d6e54050a554%40googlegroups.com
.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/952a70a2-8f42-4b3b-b563-acfc278319c6%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqzGNxt-QR92E6ZLKwSJU1xY6f05qMAn-sNFjq%2BD%3DxQDVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] "Skipping JaCoCo execution due to missing execution data file." only in CI environment

2016-07-04 Thread Mirko Friedenhagen
Hello,

you could try to use Maven 3.3.9 as well in Travis, see
https://github.com/mojohaus/mojo-parent/blob/master/.travis.yml for how to
use the takari wrapper plugin.

Regards
Mirko
-- 
Sent from my mobile
Am 04.07.2016 22:15 schrieb :

> Hello,
>
> I am trying to debug an issue I'm experiencing with JaCoCo that manifests
> in my CI environment (Travis), but not locally on my workstation. My
> intended goal is to have two separate reports produced by JaCoCo - one for
> unit tests, and the other for integration tests.
>
> On my workstation running Maven 3.3.9 and JDK 1.8.0_91, everything works
> as intended when I run standard lifecycle goals like "install" or "verify".
> I based my configuration off of
> https://github.com/Godin/sonar-experiments/blob/master/jacoco-examples/maven-invoker-plugin-example/pom.xml
> My ${project.reporting.outputDirectory} successfully contains "jacoco-it"
> and "jacoco-ut".
> My POM file is here:
> https://github.com/patrickpilch/dependency-license-checker/blob/d4a3e3370639c2f52d7083ca5163cdaaace3ba15/pom.xml#L153
> and a debug log of a successful local build is here:
> https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/local_build_log.md
>
> The problem I'm experiencing is that when trying to build in my CI
> environment, only the JaCoCo unit tests .exec file and reports appear. The
> Travis build debug output with environment details and versions is here:
> https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/ci_build_output.md
>
> It's easy to reproduce this on a Travis docker container. Instructions
> here:
> https://gist.githubusercontent.com/patrickpilch/21d32e367b312443c98cbf2bcaa687fa/raw/c0784a269d744e165ab5cdf533c87e01c668/steps_to_reproduce.md
>
> Any help would be appreciated. Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/0ebc42d3-0228-4ab5-a4a8-d6e54050a554%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqzD%2BQ%2BH3a7sKhaeDLOTYDDzAM4%3DCUrwhCHhsLKiyDkhbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] How to configure jacoco for integration tests written in jersey test framework

2016-06-07 Thread Mirko Friedenhagen
Hello,

if you only execute one module the other modules will be pulled from your
maven repository manager and the class files will probably be different. So
this is to be expected.

Regards
Mirko
-- 
Sent from my mobile
Am 07.06.2016 20:31 schrieb "Thanuku Krishna Chaitanya" <
yours.m...@gmail.com>:

> I just observed that the plugin is generating an empty report if i build
> only the integration module. It is generating the full/actual report only
> if i build the root/parent project. I just tried with Jersey Test framework
> and the report is getting generated fine.
>
> I think my work environment has some problem.
>
> Thanks for the support guys.
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/62679a30-3db9-46c7-a5c7-f86871b70c79%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqyh1Qq4O%2BypxNx4aSnRaspKegxjCf6z3Mdb2UF1wZrCvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] How to configure jacoco for integration tests written in jersey test framework

2016-06-07 Thread Mirko Friedenhagen
Hello Thanuku,

I have seen this as well, when I had  scope for a dependency. Just to be
sure: the single module reports are created correctly? Aggregate only
collects previously created jacoco.exec files.

Regards
Mirko
-- 
Sent from my mobile
Am 07.06.2016 17:19 schrieb "Thanuku Krishna Chaitanya" <
yours.m...@gmail.com>:

> Actually I see an empty report when I open the html file under
> jacoco-aggregate
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/88a6ae49-674f-49ec-b40c-ed51b4872ef5%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqyuyLVotAOw-JuoW2vuzcsaZDBgK%2BvaBj2Ai3E9biq7yA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] How to configure jacoco for integration tests written in jersey test framework

2016-06-07 Thread Mirko Friedenhagen
Hello Thanuku,

* you have to include all modules for which you want to have the aggregated
report as dependencies of the aggregating module
* in your aggregating module you only need the report-aggregate execution.
* you have to bind the execution to a phase, e.g. verify.

See
https://gitlab.com/mfriedenhagen/testlink-junit/blob/master/tljunit-jacoco-aggregate/pom.xml
for an example.

Regards
Mirko
-- 
Sent from my mobile
Am 07.06.2016 12:06 schrieb "Thanuku Krishna Chaitanya" <
yours.m...@gmail.com>:

> This is testing my patience.
>
> Let me explain again. I have a project which has 20 modules in it. In one
> of the module we started writing integration tests.
>
> We are using jersey test frameowork for the integration tests.
>
> I added 0.7.7 jacoco maven plugin with report-aggregate goal as described
> above  and i still dont see the reports.
>
> I added the plugin with prepare-agent-integration and report-aggregate but
> the reports are not getting generated
>
> Then changed it to use prepare-agent and report as the goals. The reports
> are generated but only for the classes current module.
>
> I have another module which is completely for integration tests. It won't
> contain source files under main/java. When i run coverage for it, no
> reports are getting generated.
>
> Can anyone please help me?
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/b16fdd2e-0f29-4e19-afb4-315a728ae3fb%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqyROb5poH16bX_qN0qz01QeQF38vWGU4NGGLRN93Zt0RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Maven site integration for projects with offline instrumentation

2016-04-20 Thread Mirko Friedenhagen
Hello Florian,

this somewhat by Design. Maven has life cycles which are structured into a
sequence of phases where each phase executes plugin goals attach to the
phase. When executing mvn clean deploy site you are invoking the clean
phase of the clean life cycle, the deploy phase of the default life cycle
and the site phase of the site life cycle. Each life cycle is independent
on purpose.

For your usecase you may reconfigure surefire-report to use the report-only
goal
https://maven.apache.org/surefire/maven-surefire-report-plugin/report-only-mojo.html
which relies upon existing test-results.

Regards
Mirko
-- 
Sent from my mobile
Am 20.04.2016 12:20 schrieb "Florian Wiesner" <fwies...@gmail.com>:

> there is btw. another drawback of the workaround: it breaks surefire's
> capability to detect that it was already running the tests. So, binding
> restore-instrumented-classes to the test phase, leads to the tests running
> twice.
>
> 2016-04-20 12:01 GMT+02:00 Florian Wiesner <fwies...@gmail.com>:
>
>> Sorry - typo correction ...
>>
>> Instead of
>> Whereas surefire:test detects that it was already ran, jacoco:instrument
>> does realize that it was already executed
>>
>> it should have been
>> Whereas surefire:test detects that it was already ran, jacoco:instrument
>> does *not* realize that it was already executed
>>
>> 2016-04-20 11:59 GMT+02:00 Florian Wiesner <fwies...@gmail.com>:
>>
>>> Looks like I was able to isolate the problem:
>>>
>>> *[INFO] configuring report plugin
>>> org.apache.maven.plugins:maven-surefire-report-plugin:2.19.1*
>>>
>>> *[INFO] preparing 'report' report requires '[surefire]test' forked phase
>>> execution*
>>>
>>> [INFO]
>>>
>>> [INFO] >>> maven-surefire-report-plugin:2.19.1:report > [surefire]test @
>>> PROJECT >>>
>>>
>>> [INFO]
>>>
>>> [INFO] --- xmlbeans-maven-plugin:2.3.3:xmlbeans (default) @ PROJECT ---
>>>
>>> [INFO] All schema objects are up to date.
>>>
>>> [INFO]
>>>
>>> [INFO] --- maven-resources-plugin:2.7:resources (default-resources)
>>> @ PROJECT ---
>>>
>>> [INFO] Using 'utf-8' encoding to copy filtered resources.
>>>
>>> [INFO] Copying 7 resources
>>>
>>> [INFO] Copying 103 resources
>>>
>>> [INFO] Copying 103 resources
>>>
>>> [INFO]
>>>
>>> [INFO] --- jrebel-maven-plugin:1.1.5:generate (generate-rebel-xml)
>>> @ PROJECT ---
>>>
>>> [INFO] Processing PROJECT with packaging jar
>>>
>>> [INFO]
>>>
>>> [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile)
>>> @ PROJECT ---
>>>
>>> [INFO] Changes detected - recompiling the module!
>>>
>>> [INFO] Compiling 77 source files to ...
>>>
>>>
>>> [INFO] ---* jacoco-maven-plugin:0.7.6.201602180812:instrument
>>> (offline-instrument) @ PROJECT* ---
>>>
>>> [INFO]
>>>
>>> [INFO] --- maven-resources-plugin:2.7:testResources
>>> (default-testResources) @ PROJECT ---
>>>
>>> [INFO] Using 'utf-8' encoding to copy filtered resources.
>>>
>>> [INFO] Copying 3 resources
>>>
>>> [INFO]
>>>
>>> [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile)
>>> @ PROJECT ---
>>>
>>> [INFO] Nothing to compile - all classes are up to date
>>>
>>> [INFO]
>>>
>>> [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ PROJECT ---
>>>
>>> [INFO] *Skipping execution of surefire because it has already been run
>>> for this configuration*
>>>
>>> [INFO]
>>>
>>> [INFO] <<< maven-surefire-report-plugin:2.19.1:report < [surefire]test @
>>> PROJECT <<<
>>>
>>>
>>> So, surefire-reports reruns surefire:test with all the preparation
>>> steps. Whereas surefire:test detects that it was already ran,
>>> jacoco:instrument does realize that it was already executed. And as the
>>> post-processing steps do not get executed, restore-instrumented-classes is
>>> not invoked a second time. Therefore - after the surefire-report to
>>> surefire call - the classes contain instrumentation data, which then tricks
>>> the jacoco report generation that the Maven Site Plugin performs. I moved
>>> the restore-instrumented-classes invocation from its default phase to the
>>> test phase

Re: [java code coverage] Maven site integration for projects with offline instrumentation

2016-04-19 Thread Mirko Friedenhagen
Hello Florian,

did you put the reporting section into the profile as well? This should
just work AFAIK.

Regards
Mirko
-- 
Sent from my mobile
Am 19.04.2016 13:42 schrieb :

> Hi,
>
> In our project we use offline instrumentation as we are doing AspectJ
> compile-time weaving. The report generated by the Maven report goal is
> accurate (although we use PowerMockito), but it is currently generated from
> the Maven default lifecycle, not the site lifecycle:
> 
> jacoco-coverage
> 
> 
> 
> org.jacoco
> jacoco-maven-plugin
> 
> 
> 
> 
> 
> 
> 
> offline-instrument
> 
> instrument
> 
> 
> 
> restore-classes
> 
>
> restore-instrumented-classes
> 
> 
> 
> default-report
> 
> report
> 
> 
> 
> 
> 
> maven-surefire-plugin
> 
> 
>
> target/jacoco.exec
> 
> 
> 
> 
> 
> 
>
>
> Now, when I invoke mvn clean install site -P jacoco-coverage, this of
> course leads to the JaCoCo report not being shown under Project Reports.
> On the other hand, adding
>
>   
>   
>   
>   org.jacoco
>   jacoco-maven-plugin
>   
>   
>   
>
> leads to JaCoCo attempting another instrumentation of the classes in the
> site rendering phase, which then fails.
>
> Is there a way to tell the jacoco-maven-plugin to not perform a second
> report generation, if there is already a generated report in the build
> sequence, so that it only attaches it as site artifact?
>
>
> Thank you!
> Florian
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/82e705e3-1694-44ec-89f4-2fbdc42c5642%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqxJSdvP0RtuzQiPschUSuMOxqZ-W48CCtYGw8yWJHUEyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Jacoco creates a tmp folder which has a very lengthy name

2016-03-07 Thread Mirko Friedenhagen
Hello Sahana,

it looks like your build server is running on Windows. Back in the day I
always set my basic workspace directory to sth. like C:\\ws to make sure I
do not run into the 255 character path limit.

Regards
Mirko
-- 
Sent from my mobile
Am 04.03.2016 20:36 schrieb :

> Hi,
>
> I am using Jacoco for code coverage in Android applciations. My jacoco
> gradle script looks as follows:
>
> apply plugin: 'jacoco'
>
> jacoco {
> toolVersion = "0.7.5.201505241946"
> }
>
> project.afterEvaluate {
> // Grab all build types and product flavors
> def buildTypes = android.buildTypes.collect { type -> type.name }
> def productFlavors = android.productFlavors.collect { flavor ->
> flavor.name }
>
> // When no product flavors defined, use empty
> if (!productFlavors) productFlavors.add('')
>
> productFlavors.each { productFlavorName ->
> buildTypes.each { buildTypeName ->
> def sourceName, sourcePath
> if (!productFlavorName) {
> sourceName = sourcePath = "${buildTypeName}"
> } else {
> sourceName =
> "${productFlavorName}${buildTypeName.capitalize()}"
> sourcePath = "${productFlavorName}/${buildTypeName}"
> }
> def testTaskName = "test${sourceName.capitalize()}UnitTest"
>
> // Create coverage task of form 'testFlavorTypeCoverage'
> depending on 'testFlavorTypeUnitTest'
> task "${testTaskName}Coverage" (type:JacocoReport, dependsOn:
> "$testTaskName") {
> group = "Reporting"
> description = "Generate Jacoco coverage reports on the
> ${sourceName.capitalize()} build."
>
> classDirectories = fileTree(
> dir:
> "${project.buildDir}/intermediates/classes/${sourcePath}",
> excludes: ['**/R.class',
>'**/R$*.class',
>'**/*$ViewInjector*.*',
>'**/*$ViewBinder*.*',
>'**/BuildConfig.*',
>'**/Manifest*.*']
> )
>
> def coverageSourceDirs = [
> "src/main/java",
> "src/$productFlavorName/java",
> "src/$buildTypeName/java"
> ]
> additionalSourceDirs = files(coverageSourceDirs)
> sourceDirectories = files(coverageSourceDirs)
> executionData =
> files("${project.buildDir}/jacoco/${testTaskName}.exec")
>
> reports {
> xml.enabled = true
> html.enabled = true
> html.destination =
> "${System.getenv('View_Root')}/_Build/Jacoco"
> }
> }
> }
> }
> }
>
> However when I build the application and run jacoco tasks, it creates the
> following tmp folder
>
> TestCodeCoverageGradle\app\build\tmp\expandedArchives\org.jacoco.agent-0.7.5.201505241946.jar_4kl8n0og88tqsbq2l6n2wtmaa
>
> The name is too long for workspace to be deleted on a build server.
>
> Is there a way that I can configure to delete these tmp folder or create
> tmp folder which has smaller names?
>
> I greatly appreciate any inputs.
>
> Thanks,
> ST
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/6b80ccb5-a668-423b-a0ee-5fe97e6d231a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqzWRbGGrH7AYyrQHaX9-Z_5Yfo3EiAmXvcn7u%3DGmpfWjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Change name of JaCoCo ".resources" directory?

2015-10-20 Thread Mirko Friedenhagen
Hello Michael

are you using mvn site? Just create a file src/sites/resources/.nojekyll
otherwise GitHub will take a gh-pages branch as to be processed by the
Jekyll blog software.

Regards
Mirko
-- 
Sent from my mobile
Am 20.10.2015 15:49 schrieb "Michael Remijan" :

> It looks like the JaCoCo creates a directory named ".resources"  (the name
> of the directory begins with a dot "." character).
>
> Is there a way to configure JaCoCo to change this to a different name?
>
> The reason I ask is because when I publish my project's site to GitHub
> pages, GitHub can't handle a URL where the directory name begins with a dot
> "." character.
>
> Worse case scenario, where In the JaCoCo code could I change this and make
> my own JaCoCo build?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jacoco+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/bf9b155c-ee60-4b01-920b-c78657892760%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwDAfgLO8ONeL9tJ8x0qa-5sm1xbTH5wB_sfqTZHXyydQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Jacoco not showing coverage from powermock unit test cases.

2015-05-06 Thread Mirko Friedenhagen
Hello Leela,

please just google for jacoco and powermock, both modify the loaded
classes, so depending on your scenario different approaches are valid.

Regards
Mirko
-- 
Sent from my mobile
On May 6, 2015 7:05 PM, leela kumili lkum...@gmail.com wrote:

 Have a multi-module maven project.

 Each module has couple of testng and powermock unit test cases. We are
 using jacoco for code coverage report. But, jacoco is analyzing unit test
 coverage based on testng unit test cases and ignoring powermock unit test
 case. So, total code coverage is coming low.

 Here is how I have configured the jacoco-maven-plugin and unit-test cases:

 Jacoco-Maven-Plugin configuration:

 plugin
 groupIdorg.jacoco/groupId
 artifactIdjacoco-maven-plugin/artifactId
 version${jacoco-maven-plugin.version}/version
 configuration
 propertyNamecoverageAgent/propertyName
 appendtrue/append
 /configuration
 executions
 !-- Prepares the property pointing to the JaCoCo runtime agent which
 is passed as VM argument when Maven the Surefire plugin is executed. --
 execution
 idpre-unit-test/id
 goals
 goalprepare-agent/goal
 /goals
 configuration
 !-- Sets the path to the file which contains the execution data. --
 destFile${sonar.jacoco.reportPath}/destFile
 !-- Sets the name of the property containing the settings for JaCoCo
 runtime agent. --
 propertyNamesurefireArgLine/propertyName
 /configuration
 /execution
 !-- Ensures that the code coverage report for unit tests is created
 after unit tests have been run. --
 execution
 idpost-unit-test/id
 phasetest/phase
 goals
 goalreport/goal
 /goals
 configuration
 !-- Sets the path to the file which contains the execution data. --
 dataFile${sonar.jacoco.reportPath}/dataFile
 excludes
 excludecom.walmart.services.*/exclude
 /excludes
 !-- Sets the output directory for the code coverage report. --
 outputDirectory${jacoco.reports.unit.dir}/outputDirectory
 /configuration
 /execution
  /executions
 /plugin


 Unit-test case profile:

 !-- For mapping unit tests and covered code --
 profile
 idjacoco-ut/id
 build
 plugins
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-surefire-plugin/artifactId
 configuration combine.self=override
 testFailureIgnoretrue/testFailureIgnore
 threadCount25/threadCount
 argLine${surefireArgLine}/argLine
 suiteXmlFiles
 suiteXmlFilesrc/test/resources/testng.xml/suiteXmlFile
 /suiteXmlFiles
 /configuration
 /plugin
 plugin
 artifactIdmaven-failsafe-plugin/artifactId
 version2.12/version
 dependencies
 dependency
 groupIdorg.apache.maven.surefire/groupId
 artifactIdsurefire-junit47/artifactId
 version2.10/version
 /dependency
 dependency
 groupIdorg.jacoco/groupId
 artifactIdorg.jacoco.agent/artifactId
 version${jacoco-maven-plugin.version}/version
 /dependency
 /dependencies
 /plugin
 /plugins
 /build
 /profile

 --
 You received this message because you are subscribed to the Google Groups
 JaCoCo and EclEmma Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to jacoco+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/jacoco/ebeba784-9a19-4c8a-954f-791176f5cc0d%40googlegroups.com
 https://groups.google.com/d/msgid/jacoco/ebeba784-9a19-4c8a-954f-791176f5cc0d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
JaCoCo and EclEmma Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwFC1k7ENtP6h2KMEx6iONTaUmMX6b3tZ2fomhf56oH2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] code coverage and try-finally

2014-12-22 Thread Mirko Friedenhagen
Silvio, the java compiler is probably creating multiple branches in byte
code for your source. The number of branches depend on the jdk version.

Just search in your favorite  search engine for jacoco try finally.

Regards
Mirko
-- 
Sent from my mobile
On Dec 22, 2014 9:36 AM, silverio...@gmail.com wrote:

 In following code I've got coverage till return but not for finally and
 related code when java actually run it. What is the mistake ?

 public String getNodeID() {
 mResourcesNodesLock.lock();
 try {
 return
 mResourcesNodes.get(LOCAL_RESOURCES_NODE).id;
 } finally {
 mResourcesNodesLock.unlock();
 }
 }

 --
 You received this message because you are subscribed to the Google Groups
 JaCoCo and EclEmma Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to jacoco+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/jacoco/0740fa04-0f90-4f4d-863c-9d0ea5ebb580%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
JaCoCo and EclEmma Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAK8jvqwSBo4Y6NvdfmnNOO_Hf8D04PemVbXYDP0vK7gjhu5DSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [java code coverage] Maven plugin prepare-agent does not generate ${destFile} when Surefire forkMode=never

2014-04-14 Thread Mirko Friedenhagen
Hello Marc,

I could try to detect the surefire setting, though I have no clue whether
this is a trivial task. Documenting the behavior is a simple workaround.

Regards
Mirko
-- 
Sent from my mobile
On Apr 14, 2014 8:30 PM, Marc R. Hoffmann hoffm...@mountainminds.com
wrote:

 Hi,

 thanks for this report! In fact the JaCoCo agent can only be installed to
 a forked jvm. If now JaCoCo agent is installed no execution data is
 recorded and written to the *.exec file.

 Not sure how we can fix this in JaCoCo beside adding documentation to
 the prepare-agent goal? JaCoCo does not control the surefire plugin.

 BTW, in Ant the coverage task wraps the junit task and explicitely
 checks for the correct fork settings.

 Best regards,
 -marc

 On 14.04.14 20:22, acollin...@gmail.com wrote:

 Precautionary note: I found that forkMode parameter is deprecated as of
 maven-surefire-plugin:2.14.  Meaning: I am aware that this property should
 not be used in current versions.  I have still posted this for projects
 that might  be on older versions of the plugin.

 When the maven-surefire-plugin has been configured with forkMode=never,
 the prepare-agent never generates the ${destFile}.  Note that the default
 value for forkMode is once.  I am expecting the agent would be able to
 attach to the running tests, but that is still uncertain to me.

 Should I expect that exec files are generated with forkMode=never?

 Thanks, and keep up the great work!

 Steps to reproduce
 --
 I am uncertain whether this is indeed expected behavior, so I have not
 filed a GitHub issue, or investigated a fix at this time.  What I do have
 are steps to reproduce.

 Steps to reproduce:
 1. Checkout source code referenced at this [blog post] (although any
 project that generates a report could be used to demonstrate).
 svn co https://designbycontract.googlecode.com/svn/trunk/
 examples/testing/test-doubles
 2. Run mvn clean package -DforkMode=never
 3. Verify reporter fails because it finds no *.exec files.
 4. Verify no *.exec files are generated in ${destFile} location.

 Verified configurations:
 * jacoco-maven-plugin: 0.5.5.201112152213, 0.7.0.201403182114
 * Windows 7
 * Maven 2.2.1, 3.1.1
 * maven-Surefire-plugin 2.4.3, 2.13


 References:
 [blog post]: http://www.agile-engineering.net/2012/01/unit-test-code-
 coverage.html


 --
 You received this message because you are subscribed to the Google Groups
 JaCoCo and EclEmma Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to jacoco+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
JaCoCo and EclEmma Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.