buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Tence <vte...@pyxis-tech.com>
Subject Re: Help with code coverage
Date Fri, 28 Mar 2014 13:19:30 GMT
Hi Peter,

Thanks for taking the time to reply.

I think Tammo's version (https://github.com/apache/ode/blob/master/tasks/jacoco.rake) is a
good starting point. It generates and aggregates reports in a multi-project build. Looking
at the code, it defines a top-level jacoco namespace with a report aggregation task that the
official jacoco plugin seems to be missing.

My problem right now is that I am unable to include the integration test run in the report.
Whenever integration tests run, the aggregated report is not generated.

I've tried modifying the code without success. If you have any idea that can help, that would
be great.

Eventually, I'd like to hack a plugin to integrate with coveralls.io, which provides great
online reports and stats for code coverage, is free for open-source projects and integrates
well with GitHub.

Cheers,
-- Vincent


On 2014-03-28, at 3:57 AM, Peter Donald <peter@realityforge.org> wrote:

> Hi,
> 
> Sorry for not replying - I am in netless and in the middle of a house move. :/
> 
> We used to have a mechanism for generating a report I believe ..
> possibly liberated from either the ant task or maven task originally.
> But these days we just stuff all our data at either Jenkins or Sonar
> and allow them to aggregate the data. I will see if I can find our old
> buildr extension that generated a report.
> 
> 
> On Wed, Mar 19, 2014 at 1:30 AM, Vincent Tence <vtence@pyxis-tech.com> wrote:
>> Hi Tammo,
>> 
>> I can now generate a consolidated report for unit tests using your modified plugin
using:
>> 
>> buildr test jacoco:report
>> 
>> How would you do to also instrument code when running integration tests? Ideally,
I'd like to combine coverage from both unit tests and integration tests. But when I run:
>> 
>> buildr install jacoco:report
>> 
>> it loads execution data files but does not generate any report. Any idea why this
is happening?
>> 
>> Thanks a lot,
>> -- Vincent
>> 
>> P.S. How am I supposed to use the official jacoco plugin. I cannot get it to generate
any report.
>> 
>> 
>> On 2014-03-18, at 9:42 AM, Tammo van Lessen <tvanlessen@gmail.com> wrote:
>> 
>>> Hi Vincent,
>>> 
>>> I remember that I modified a local jacoco task file for that purpose,
>>> perhaps you find that helpful:
>>> https://github.com/apache/ode/blob/master/tasks/jacoco.rake. IIRC it should
>>> merge the data of multiple projects into one report. But we've never used
>>> it intensively, so I'm not entirely sure if it works correctly.
>>> 
>>> Best,
>>> Tammo
>>> 
>>> 
>>> On Tue, Mar 18, 2014 at 1:57 PM, Vincent Tence <vtence@pyxis-tech.com>wrote:
>>> 
>>>> Hi Peter,
>>>> 
>>>> It would be even better if I can get Jacoco to work instead of emma and
>>>> cobertura.
>>>> 
>>>> I have looked at the sources last week but could not figure a way to merge
>>>> the reports of multiple projects into one. Since Jacoco is not mentionned
>>>> in the guide, I thought support was still incomplete.
>>>> 
>>>> Can you give me an example of using Jacoco on multiple projects and
>>>> merging reports?
>>>> 
>>>> On a side note, anybody has implemented a plugin for integrating with
>>>> coveralls.io?
>>>> 
>>>> Thanks,
>>>> -- Vincent
>>>> 
>>>> 
>>>> On 2014-03-17, at 8:39 PM, Peter Donald <peter@realityforge.org> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> Sorry I missed this. Did anyone get back to you?
>>>>> 
>>>>> We have moved away from both emma and cobertura to jacoco for various
>>>>> reasons (mostly due to moving to Java 7) and have no problem merging
>>>>> in data from multiple projects. I had a look on the website and there
>>>>> does not seem to be any decent documentation for the addon but you can
>>>>> see the source at [1]. We generate multiple cov files (one for each
>>>>> project) and then have jenkins merge them into one report. I am not
>>>>> sure if that helps?
>>>>> 
>>>>> [1] https://github.com/apache/buildr/blob/master/addon/buildr/jacoco.rb
>>>>> 
>>>>> On Wed, Mar 12, 2014 at 6:37 AM, Vincent Tence <vtence@pyxis-tech.com>
>>>> wrote:
>>>>>> Hey guys,
>>>>>> 
>>>>>> I have a project composed of several sub-projects for which I'd like
to
>>>> measure code coverage. I'm having trouble getting a top-level coverage
>>>> report that aggregates coverage for all sub-projects and at the same time
>>>> let me drill down the results.
>>>>>> 
>>>>>> I'm using Buildr 1.4.12.  My project is composed of 3 sub-projects
with
>>>> unit tests and a 4th one that runs integration tests (see build file
>>>> https://github.com/testinfected/simple-petstore/blob/master/buildfile)
>>>>>> 
>>>>>> I'm not having any success with cobertura. If I run:
>>>>>> 
>>>>>> buildr test cobertura:html
>>>>>> 
>>>>>> it generates an report with only classes from the server sub-project
>>>> (the one with the integration tests), and coverage is 0% (expected, since
>>>> these 3 classes are covered at integration level).
>>>>>> 
>>>>>> If I add to my buildfile:
>>>>>> 
>>>>>> cobertura.include 'org.testinfected.==*=='
>>>>>> 
>>>>>> I finally get coverage for all classes, but still without the coverage
>>>> from integration tests. So it's incomplete.
>>>>>> 
>>>>>> If I try running:
>>>>>> 
>>>>>> buildr test integration cobertura:html
>>>>>> 
>>>>>> report generation fails and cobertura complains that there is no
top
>>>> level reports directory.
>>>>>> 
>>>>>> On top of that, I have to require the cobertura plugin in my buildfile,
>>>> since running:
>>>>>> 
>>>>>> buildr -rbuildr/java/cobertura test cobertura:html
>>>>>> 
>>>>>> fails with:
>>>>>> 
>>>>>> RuntimeError : Internal error: attempting to access local setting
>>>> before buildfile located
>>>>>> 
>>>>>> With Emma, it's a lot better. It works almost flawlessly running:
>>>>>> 
>>>>>> buildr -rbuildr/java/emma package emma:html
>>>>>> 
>>>>>> I get the top level report with aggregates of the sub-projects, but
I
>>>> cannot drill down into the report. The top level report references html
>>>> pages that are not found in the top level report dir.
>>>>>> 
>>>>>> If I want the details, I have to generate individual sub-projects
>>>> reports, e.g.
>>>>>> 
>>>>>> buildr -rbuildr/java/emma package petstore:domain:emma:html
>>>>>> 
>>>>>> and look into the sub-projects individually.
>>>>>> 
>>>>>> Does anybody know how to get a top level report with Emma that support
>>>> drilling down with data from sub-projects?
>>>>>> 
>>>>>> Any idea why I'm having no luck with the cobertura plugin?
>>>>>> 
>>>>>> Thanks a lot,
>>>>>> -- Vincent
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Cheers,
>>>>> 
>>>>> Peter Donald
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> Tammo van Lessen - http://www.taval.de
>> 
> 
> 
> 
> -- 
> Cheers,
> 
> Peter Donald


Mime
View raw message