Re: tus on Emma code coverage for unit tests in Tycho?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Marc Wirth-2
Hi,

we've made some additions to tycho also for code coverage. If you look
at https://issues.sonatype.org/browse/TYCHO-86 Sascha posted a link to
a github repository where you can find those additions. We'd like to
contribute that to tycho itself, but we may have to wait till tycho
moves to Eclipse (or Apache?) due to some legal constraints.

For the coverage we've basically extended the osgi-test-plugin itself,
so you can centrally configure that you want emma:

      <plugin>
        <groupId>org.sonatype.tycho</groupId>
        <artifactId>maven-osgi-test-plugin</artifactId>
        <version>${tycho-version}</version>
        <dependencies>
          <dependency>
            <groupId>org.sonatype.tycho</groupId>
            <version>${tycho-version}</version>
            <artifactId>maven-osgi-test-emma-plugin</artifactId>
          </dependency>
        </dependencies>
      </plugin>

For eclipse-test-plugins that are fragments this will automatically
instrument the classes of the fragment host, no further configuration
required. You can also explicitly configure the <bundlesToInstrument>.

Tycho-86 has been updated referring to Tycho-353 which I think is a
better solution to the frameworkBundles issue thatn what we did here,
but from our point of view it's still missing the configuration
options which bundles/classes to instrument

Marc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Igor Fedorenko-2
Although not ideal, we use system properties to specify bundles to
instrument. Here is a snippet from one of our internal pom.xml files.

     <profile>
       <id>coverage</id>
       <build>
         <plugins>
           <plugin>
             <groupId>org.sonatype.tycho</groupId>
             <artifactId>maven-osgi-test-plugin</artifactId>
             <configuration>
               <systemProperties combine.children="append">
 
<emma.session.out.file>${project.build.directory}/emma/coverage.es</emma.session.out.file>
 
<emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
 
<eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
               </systemProperties>
               <frameworkExtensions>
                 <frameworkExtension>
                   <groupId>com.sonatype.s2</groupId>
                   <artifactId>org.eclemma.runtime.equinox</artifactId>
                   <version>1.1.0.200908261008</version>
                 </frameworkExtension>
               </frameworkExtensions>
             </configuration>
           </plugin>
         </plugins>
       </build>
     </profile>
   </profiles>

--
Regards,
Igor

Marc Wirth wrote:

> Hi,
>
> we've made some additions to tycho also for code coverage. If you look
> at https://issues.sonatype.org/browse/TYCHO-86 Sascha posted a link to
> a github repository where you can find those additions. We'd like to
> contribute that to tycho itself, but we may have to wait till tycho
> moves to Eclipse (or Apache?) due to some legal constraints.
>
> For the coverage we've basically extended the osgi-test-plugin itself,
> so you can centrally configure that you want emma:
>
>       <plugin>
>         <groupId>org.sonatype.tycho</groupId>
>         <artifactId>maven-osgi-test-plugin</artifactId>
>         <version>${tycho-version}</version>
>         <dependencies>
>           <dependency>
>             <groupId>org.sonatype.tycho</groupId>
>             <version>${tycho-version}</version>
>             <artifactId>maven-osgi-test-emma-plugin</artifactId>
>           </dependency>
>         </dependencies>
>       </plugin>
>
> For eclipse-test-plugins that are fragments this will automatically
> instrument the classes of the fragment host, no further configuration
> required. You can also explicitly configure the <bundlesToInstrument>.
>
> Tycho-86 has been updated referring to Tycho-353 which I think is a
> better solution to the frameworkBundles issue thatn what we did here,
> but from our point of view it's still missing the configuration
> options which bundles/classes to instrument
>
> Marc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Mattias Holmqvist
Thanks for the assistance. I could successfully generate code coverage
with your method as well. However, I built the
org.eclemma.runtime.equinox myself with Tycho since I could not find
it on any public repository. It would be nice to get it from a public
repository instead, do you know if it is available from any public p2
repository?

How did you get that bundle into your build?

Thanks,
Mattias

On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko <[hidden email]> wrote:

> Although not ideal, we use system properties to specify bundles to
> instrument. Here is a snippet from one of our internal pom.xml files.
>
>    <profile>
>      <id>coverage</id>
>      <build>
>        <plugins>
>          <plugin>
>            <groupId>org.sonatype.tycho</groupId>
>            <artifactId>maven-osgi-test-plugin</artifactId>
>            <configuration>
>              <systemProperties combine.children="append">
>
> <emma.session.out.file>${project.build.directory}/emma/coverage.es</emma.session.out.file>
>
> <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>
> <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>              </systemProperties>
>              <frameworkExtensions>
>                <frameworkExtension>
>                  <groupId>com.sonatype.s2</groupId>
>                  <artifactId>org.eclemma.runtime.equinox</artifactId>
>                  <version>1.1.0.200908261008</version>
>                </frameworkExtension>
>              </frameworkExtensions>
>            </configuration>
>          </plugin>
>        </plugins>
>      </build>
>    </profile>
>  </profiles>
>
> --
> Regards,
> Igor
>
> Marc Wirth wrote:
>>
>> Hi,
>>
>> we've made some additions to tycho also for code coverage. If you look
>> at https://issues.sonatype.org/browse/TYCHO-86 Sascha posted a link to
>> a github repository where you can find those additions. We'd like to
>> contribute that to tycho itself, but we may have to wait till tycho
>> moves to Eclipse (or Apache?) due to some legal constraints.
>>
>> For the coverage we've basically extended the osgi-test-plugin itself,
>> so you can centrally configure that you want emma:
>>
>>      <plugin>
>>        <groupId>org.sonatype.tycho</groupId>
>>        <artifactId>maven-osgi-test-plugin</artifactId>
>>        <version>${tycho-version}</version>
>>        <dependencies>
>>          <dependency>
>>            <groupId>org.sonatype.tycho</groupId>
>>            <version>${tycho-version}</version>
>>            <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>          </dependency>
>>        </dependencies>
>>      </plugin>
>>
>> For eclipse-test-plugins that are fragments this will automatically
>> instrument the classes of the fragment host, no further configuration
>> required. You can also explicitly configure the <bundlesToInstrument>.
>>
>> Tycho-86 has been updated referring to Tycho-353 which I think is a
>> better solution to the frameworkBundles issue thatn what we did here,
>> but from our point of view it's still missing the configuration
>> options which bundles/classes to instrument
>>
>> Marc
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Igor Fedorenko-2
We got prebuilt osgihook jar from eclemma SF download page [1] and
deployed it to our internal repository using "mvn deploy:file".

[1]
http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/

--
Regards,
Igor

Mattias Holmqvist wrote:

> Thanks for the assistance. I could successfully generate code coverage
> with your method as well. However, I built the
> org.eclemma.runtime.equinox myself with Tycho since I could not find
> it on any public repository. It would be nice to get it from a public
> repository instead, do you know if it is available from any public p2
> repository?
>
> How did you get that bundle into your build?
>
> Thanks,
> Mattias
>
> On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko <[hidden email]> wrote:
>> Although not ideal, we use system properties to specify bundles to
>> instrument. Here is a snippet from one of our internal pom.xml files.
>>
>>    <profile>
>>      <id>coverage</id>
>>      <build>
>>        <plugins>
>>          <plugin>
>>            <groupId>org.sonatype.tycho</groupId>
>>            <artifactId>maven-osgi-test-plugin</artifactId>
>>            <configuration>
>>              <systemProperties combine.children="append">
>>
>> <emma.session.out.file>${project.build.directory}/emma/coverage.es</emma.session.out.file>
>>
>> <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>>
>> <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>>              </systemProperties>
>>              <frameworkExtensions>
>>                <frameworkExtension>
>>                  <groupId>com.sonatype.s2</groupId>
>>                  <artifactId>org.eclemma.runtime.equinox</artifactId>
>>                  <version>1.1.0.200908261008</version>
>>                </frameworkExtension>
>>              </frameworkExtensions>
>>            </configuration>
>>          </plugin>
>>        </plugins>
>>      </build>
>>    </profile>
>>  </profiles>
>>
>> --
>> Regards,
>> Igor
>>
>> Marc Wirth wrote:
>>> Hi,
>>>
>>> we've made some additions to tycho also for code coverage. If you look
>>> at https://issues.sonatype.org/browse/TYCHO-86 Sascha posted a link to
>>> a github repository where you can find those additions. We'd like to
>>> contribute that to tycho itself, but we may have to wait till tycho
>>> moves to Eclipse (or Apache?) due to some legal constraints.
>>>
>>> For the coverage we've basically extended the osgi-test-plugin itself,
>>> so you can centrally configure that you want emma:
>>>
>>>      <plugin>
>>>        <groupId>org.sonatype.tycho</groupId>
>>>        <artifactId>maven-osgi-test-plugin</artifactId>
>>>        <version>${tycho-version}</version>
>>>        <dependencies>
>>>          <dependency>
>>>            <groupId>org.sonatype.tycho</groupId>
>>>            <version>${tycho-version}</version>
>>>            <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>>          </dependency>
>>>        </dependencies>
>>>      </plugin>
>>>
>>> For eclipse-test-plugins that are fragments this will automatically
>>> instrument the classes of the fragment host, no further configuration
>>> required. You can also explicitly configure the <bundlesToInstrument>.
>>>
>>> Tycho-86 has been updated referring to Tycho-353 which I think is a
>>> better solution to the frameworkBundles issue thatn what we did here,
>>> but from our point of view it's still missing the configuration
>>> options which bundles/classes to instrument
>>>
>>> Marc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Radoslaw Urbas
I'm having difficulties with running emma instrumented code. Instrumentation phase seems to run fine  - coverage.em files are generated. But how do I configure plug-in bundling process to use instrumented classes?

Having a "hello world" sample project with: single plug-in, test fragment, feature and updatesite + pom.xml and goals to generate coverage report would be really beneficial.

Regards,
Radek

On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko <[hidden email]> wrote:
We got prebuilt osgihook jar from eclemma SF download page [1] and
deployed it to our internal repository using "mvn deploy:file".

[1] http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/

--
Regards,
Igor


Mattias Holmqvist wrote:
Thanks for the assistance. I could successfully generate code coverage
with your method as well. However, I built the
org.eclemma.runtime.equinox myself with Tycho since I could not find
it on any public repository. It would be nice to get it from a public
repository instead, do you know if it is available from any public p2
repository?

How did you get that bundle into your build?

Thanks,
Mattias

On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko <[hidden email]> wrote:
Although not ideal, we use system properties to specify bundles to
instrument. Here is a snippet from one of our internal pom.xml files.

  <profile>
    <id>coverage</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.sonatype.tycho</groupId>
          <artifactId>maven-osgi-test-plugin</artifactId>
          <configuration>
            <systemProperties combine.children="append">

<emma.session.out.file>${project.build.directory}/emma/coverage.es</emma.session.out.file>

<emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>

<eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
            </systemProperties>
            <frameworkExtensions>
              <frameworkExtension>
                <groupId>com.sonatype.s2</groupId>
                <artifactId>org.eclemma.runtime.equinox</artifactId>
                <version>1.1.0.200908261008</version>
              </frameworkExtension>
            </frameworkExtensions>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>
 </profiles>

--
Regards,
Igor

Marc Wirth wrote:
Hi,

we've made some additions to tycho also for code coverage. If you look
at https://issues.sonatype.org/browse/TYCHO-86 Sascha posted a link to
a github repository where you can find those additions. We'd like to
contribute that to tycho itself, but we may have to wait till tycho
moves to Eclipse (or Apache?) due to some legal constraints.

For the coverage we've basically extended the osgi-test-plugin itself,
so you can centrally configure that you want emma:

    <plugin>
      <groupId>org.sonatype.tycho</groupId>
      <artifactId>maven-osgi-test-plugin</artifactId>
      <version>${tycho-version}</version>
      <dependencies>
        <dependency>
          <groupId>org.sonatype.tycho</groupId>
          <version>${tycho-version}</version>
          <artifactId>maven-osgi-test-emma-plugin</artifactId>
        </dependency>
      </dependencies>
    </plugin>

For eclipse-test-plugins that are fragments this will automatically
instrument the classes of the fragment host, no further configuration
required. You can also explicitly configure the <bundlesToInstrument>.

Tycho-86 has been updated referring to Tycho-353 which I think is a
better solution to the frameworkBundles issue thatn what we did here,
but from our point of view it's still missing the configuration
options which bundles/classes to instrument

Marc



--
Radoslaw Urbas
____________________________
mail             [hidden email]
homepage    http://urbas.tk/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Igor Fedorenko-2
eclemma equinox runtime is supposed to instrument at runtime, you do not
need to instrument code statically during the build.

--
Regards,
Igor

Radoslaw Urbas wrote:

> I'm having difficulties with running emma instrumented code.
> Instrumentation phase seems to run fine  - coverage.em files are
> generated. But how do I configure plug-in bundling process to use
> instrumented classes?
>
> Having a "hello world" sample project with: single plug-in, test
> fragment, feature and updatesite + pom.xml and goals to generate
> coverage report would be really beneficial.
>
> Regards,
> Radek
>
> On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     We got prebuilt osgihook jar from eclemma SF download page [1] and
>     deployed it to our internal repository using "mvn deploy:file".
>
>     [1]
>     http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/
>
>     --
>     Regards,
>     Igor
>
>
>     Mattias Holmqvist wrote:
>
>         Thanks for the assistance. I could successfully generate code
>         coverage
>         with your method as well. However, I built the
>         org.eclemma.runtime.equinox myself with Tycho since I could not find
>         it on any public repository. It would be nice to get it from a
>         public
>         repository instead, do you know if it is available from any
>         public p2
>         repository?
>
>         How did you get that bundle into your build?
>
>         Thanks,
>         Mattias
>
>         On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
>         <[hidden email] <mailto:[hidden email]>> wrote:
>
>             Although not ideal, we use system properties to specify
>             bundles to
>             instrument. Here is a snippet from one of our internal
>             pom.xml files.
>
>               <profile>
>                 <id>coverage</id>
>                 <build>
>                   <plugins>
>                     <plugin>
>                       <groupId>org.sonatype.tycho</groupId>
>                       <artifactId>maven-osgi-test-plugin</artifactId>
>                       <configuration>
>                         <systemProperties combine.children="append">
>
>             <emma.session.out.file>${project.build.directory}/emma/coverage.es
>             <http://coverage.es></emma.session.out.file>
>
>             <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>
>             <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>                         </systemProperties>
>                         <frameworkExtensions>
>                           <frameworkExtension>
>                             <groupId>com.sonatype.s2</groupId>
>                            
>             <artifactId>org.eclemma.runtime.equinox</artifactId>
>                             <version>1.1.0.200908261008</version>
>                           </frameworkExtension>
>                         </frameworkExtensions>
>                       </configuration>
>                     </plugin>
>                   </plugins>
>                 </build>
>               </profile>
>              </profiles>
>
>             --
>             Regards,
>             Igor
>
>             Marc Wirth wrote:
>
>                 Hi,
>
>                 we've made some additions to tycho also for code
>                 coverage. If you look
>                 at https://issues.sonatype.org/browse/TYCHO-86 Sascha
>                 posted a link to
>                 a github repository where you can find those additions.
>                 We'd like to
>                 contribute that to tycho itself, but we may have to wait
>                 till tycho
>                 moves to Eclipse (or Apache?) due to some legal constraints.
>
>                 For the coverage we've basically extended the
>                 osgi-test-plugin itself,
>                 so you can centrally configure that you want emma:
>
>                     <plugin>
>                       <groupId>org.sonatype.tycho</groupId>
>                       <artifactId>maven-osgi-test-plugin</artifactId>
>                       <version>${tycho-version}</version>
>                       <dependencies>
>                         <dependency>
>                           <groupId>org.sonatype.tycho</groupId>
>                           <version>${tycho-version}</version>
>                          
>                 <artifactId>maven-osgi-test-emma-plugin</artifactId>
>                         </dependency>
>                       </dependencies>
>                     </plugin>
>
>                 For eclipse-test-plugins that are fragments this will
>                 automatically
>                 instrument the classes of the fragment host, no further
>                 configuration
>                 required. You can also explicitly configure the
>                 <bundlesToInstrument>.
>
>                 Tycho-86 has been updated referring to Tycho-353 which I
>                 think is a
>                 better solution to the frameworkBundles issue thatn what
>                 we did here,
>                 but from our point of view it's still missing the
>                 configuration
>                 options which bundles/classes to instrument
>
>                 Marc
>
>
>
>
> --
> Radoslaw Urbas
> ____________________________
> mail             [hidden email] <mailto:[hidden email]>
> homepage    http://urbas.tk/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Radoslaw Urbas
This happening. The classes are present in generated-class/emma directory.
How do I configure test runner to use these instrumented classes?

On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]> wrote:
eclemma equinox runtime is supposed to instrument at runtime, you do not
need to instrument code statically during the build.

--
Regards,
Igor

Radoslaw Urbas wrote:
I'm having difficulties with running emma instrumented code. Instrumentation phase seems to run fine  - coverage.em files are generated. But how do I configure plug-in bundling process to use instrumented classes?

Having a "hello world" sample project with: single plug-in, test fragment, feature and updatesite + pom.xml and goals to generate coverage report would be really beneficial.

Regards,
Radek

On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko <[hidden email] <mailto:[hidden email]>> wrote:

   We got prebuilt osgihook jar from eclemma SF download page [1] and
   deployed it to our internal repository using "mvn deploy:file".

   [1]
   http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/

   --
   Regards,
   Igor


   Mattias Holmqvist wrote:

       Thanks for the assistance. I could successfully generate code
       coverage
       with your method as well. However, I built the
       org.eclemma.runtime.equinox myself with Tycho since I could not find
       it on any public repository. It would be nice to get it from a
       public
       repository instead, do you know if it is available from any
       public p2
       repository?

       How did you get that bundle into your build?

       Thanks,
       Mattias

       On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
       <[hidden email] <mailto:[hidden email]>> wrote:

           Although not ideal, we use system properties to specify
           bundles to
           instrument. Here is a snippet from one of our internal
           pom.xml files.

             <profile>
               <id>coverage</id>
               <build>
                 <plugins>
                   <plugin>
                     <groupId>org.sonatype.tycho</groupId>
                     <artifactId>maven-osgi-test-plugin</artifactId>
                     <configuration>
                       <systemProperties combine.children="append">

           <emma.session.out.file>${project.build.directory}/emma/coverage.es
           <http://coverage.es></emma.session.out.file>


           <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>

           <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
                       </systemProperties>
                       <frameworkExtensions>
                         <frameworkExtension>
                           <groupId>com.sonatype.s2</groupId>
                                      <artifactId>org.eclemma.runtime.equinox</artifactId>
                           <version>1.1.0.200908261008</version>
                         </frameworkExtension>
                       </frameworkExtensions>
                     </configuration>
                   </plugin>
                 </plugins>
               </build>
             </profile>
            </profiles>

           --
           Regards,
           Igor

           Marc Wirth wrote:

               Hi,

               we've made some additions to tycho also for code
               coverage. If you look
               at https://issues.sonatype.org/browse/TYCHO-86 Sascha
               posted a link to
               a github repository where you can find those additions.
               We'd like to
               contribute that to tycho itself, but we may have to wait
               till tycho
               moves to Eclipse (or Apache?) due to some legal constraints.

               For the coverage we've basically extended the
               osgi-test-plugin itself,
               so you can centrally configure that you want emma:

                   <plugin>
                     <groupId>org.sonatype.tycho</groupId>
                     <artifactId>maven-osgi-test-plugin</artifactId>
                     <version>${tycho-version}</version>
                     <dependencies>
                       <dependency>
                         <groupId>org.sonatype.tycho</groupId>
                         <version>${tycho-version}</version>
                                        <artifactId>maven-osgi-test-emma-plugin</artifactId>
                       </dependency>
                     </dependencies>
                   </plugin>

               For eclipse-test-plugins that are fragments this will
               automatically
               instrument the classes of the fragment host, no further
               configuration
               required. You can also explicitly configure the
               <bundlesToInstrument>.

               Tycho-86 has been updated referring to Tycho-353 which I
               think is a
               better solution to the frameworkBundles issue thatn what
               we did here,
               but from our point of view it's still missing the
               configuration
               options which bundles/classes to instrument

               Marc




--
Radoslaw Urbas
____________________________
mail             [hidden email] <mailto:[hidden email]>
homepage    http://urbas.tk/



--
Radoslaw Urbas
____________________________
mail             [hidden email]
homepage    http://urbas.tk/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Igor Fedorenko-2
You do not need to instrument classes at built time, this won't work in OSGi, since instrumented classes depend on emma runtime. You need to use dynamic instrumentation implemented by eclemma equinox runtime.

--
Regards,
Igor

On Sat, Mar 20, 2010 at 4:47 AM, Radoslaw Urbas <[hidden email]> wrote:
This happening. The classes are present in generated-class/emma directory.
How do I configure test runner to use these instrumented classes?


On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]> wrote:
eclemma equinox runtime is supposed to instrument at runtime, you do not
need to instrument code statically during the build.

--
Regards,
Igor

Radoslaw Urbas wrote:
I'm having difficulties with running emma instrumented code. Instrumentation phase seems to run fine  - coverage.em files are generated. But how do I configure plug-in bundling process to use instrumented classes?

Having a "hello world" sample project with: single plug-in, test fragment, feature and updatesite + pom.xml and goals to generate coverage report would be really beneficial.

Regards,
Radek

On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko <[hidden email] <mailto:[hidden email]>> wrote:

   We got prebuilt osgihook jar from eclemma SF download page [1] and
   deployed it to our internal repository using "mvn deploy:file".

   [1]
   http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/

   --
   Regards,
   Igor


   Mattias Holmqvist wrote:

       Thanks for the assistance. I could successfully generate code
       coverage
       with your method as well. However, I built the
       org.eclemma.runtime.equinox myself with Tycho since I could not find
       it on any public repository. It would be nice to get it from a
       public
       repository instead, do you know if it is available from any
       public p2
       repository?

       How did you get that bundle into your build?

       Thanks,
       Mattias

       On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
       <[hidden email] <mailto:[hidden email]>> wrote:

           Although not ideal, we use system properties to specify
           bundles to
           instrument. Here is a snippet from one of our internal
           pom.xml files.

             <profile>
               <id>coverage</id>
               <build>
                 <plugins>
                   <plugin>
                     <groupId>org.sonatype.tycho</groupId>
                     <artifactId>maven-osgi-test-plugin</artifactId>
                     <configuration>
                       <systemProperties combine.children="append">

           <emma.session.out.file>${project.build.directory}/emma/coverage.es
           <http://coverage.es></emma.session.out.file>


           <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>

           <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
                       </systemProperties>
                       <frameworkExtensions>
                         <frameworkExtension>
                           <groupId>com.sonatype.s2</groupId>
                                      <artifactId>org.eclemma.runtime.equinox</artifactId>
                           <version>1.1.0.200908261008</version>
                         </frameworkExtension>
                       </frameworkExtensions>
                     </configuration>
                   </plugin>
                 </plugins>
               </build>
             </profile>
            </profiles>

           --
           Regards,
           Igor

           Marc Wirth wrote:

               Hi,

               we've made some additions to tycho also for code
               coverage. If you look
               at https://issues.sonatype.org/browse/TYCHO-86 Sascha
               posted a link to
               a github repository where you can find those additions.
               We'd like to
               contribute that to tycho itself, but we may have to wait
               till tycho
               moves to Eclipse (or Apache?) due to some legal constraints.

               For the coverage we've basically extended the
               osgi-test-plugin itself,
               so you can centrally configure that you want emma:

                   <plugin>
                     <groupId>org.sonatype.tycho</groupId>
                     <artifactId>maven-osgi-test-plugin</artifactId>
                     <version>${tycho-version}</version>
                     <dependencies>
                       <dependency>
                         <groupId>org.sonatype.tycho</groupId>
                         <version>${tycho-version}</version>
                                        <artifactId>maven-osgi-test-emma-plugin</artifactId>
                       </dependency>
                     </dependencies>
                   </plugin>

               For eclipse-test-plugins that are fragments this will
               automatically
               instrument the classes of the fragment host, no further
               configuration
               required. You can also explicitly configure the
               <bundlesToInstrument>.

               Tycho-86 has been updated referring to Tycho-353 which I
               think is a
               better solution to the frameworkBundles issue thatn what
               we did here,
               but from our point of view it's still missing the
               configuration
               options which bundles/classes to instrument

               Marc




--
Radoslaw Urbas
____________________________
mail             [hidden email] <mailto:[hidden email]>
homepage    http://urbas.tk/



--
Radoslaw Urbas
____________________________
mail             [hidden email]
homepage    http://urbas.tk/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Mattias Holmqvist
I have a small follow-up question on this. How do you generate reports
from the coverage results? Do you use regular emma-plugin for Maven to
do this?

I could import the results into eclemma inside eclipse and see that
the coverage was recorded. But of course I want to generate reports
automatically from the headless build.

Could you show a small example for reporting the coverage results?

Regards,
/Mattias

On Wed, Mar 24, 2010 at 7:47 AM, Igor Fedorenko <[hidden email]> wrote:

> You do not need to instrument classes at built time, this won't work in
> OSGi, since instrumented classes depend on emma runtime. You need to use
> dynamic instrumentation implemented by eclemma equinox runtime.
> --
> Regards,
> Igor
>
> On Sat, Mar 20, 2010 at 4:47 AM, Radoslaw Urbas <[hidden email]>
> wrote:
>>
>> This happening. The classes are present in generated-class/emma directory.
>> How do I configure test runner to use these instrumented classes?
>>
>> On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]>
>> wrote:
>>>
>>> eclemma equinox runtime is supposed to instrument at runtime, you do not
>>> need to instrument code statically during the build.
>>>
>>> --
>>> Regards,
>>> Igor
>>>
>>> Radoslaw Urbas wrote:
>>>>
>>>> I'm having difficulties with running emma instrumented code.
>>>> Instrumentation phase seems to run fine  - coverage.em files are generated.
>>>> But how do I configure plug-in bundling process to use instrumented classes?
>>>>
>>>> Having a "hello world" sample project with: single plug-in, test
>>>> fragment, feature and updatesite + pom.xml and goals to generate coverage
>>>> report would be really beneficial.
>>>>
>>>> Regards,
>>>> Radek
>>>>
>>>> On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko
>>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>>    We got prebuilt osgihook jar from eclemma SF download page [1] and
>>>>    deployed it to our internal repository using "mvn deploy:file".
>>>>
>>>>    [1]
>>>>
>>>>  http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/
>>>>
>>>>    --
>>>>    Regards,
>>>>    Igor
>>>>
>>>>
>>>>    Mattias Holmqvist wrote:
>>>>
>>>>        Thanks for the assistance. I could successfully generate code
>>>>        coverage
>>>>        with your method as well. However, I built the
>>>>        org.eclemma.runtime.equinox myself with Tycho since I could not
>>>> find
>>>>        it on any public repository. It would be nice to get it from a
>>>>        public
>>>>        repository instead, do you know if it is available from any
>>>>        public p2
>>>>        repository?
>>>>
>>>>        How did you get that bundle into your build?
>>>>
>>>>        Thanks,
>>>>        Mattias
>>>>
>>>>        On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
>>>>        <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>>            Although not ideal, we use system properties to specify
>>>>            bundles to
>>>>            instrument. Here is a snippet from one of our internal
>>>>            pom.xml files.
>>>>
>>>>              <profile>
>>>>                <id>coverage</id>
>>>>                <build>
>>>>                  <plugins>
>>>>                    <plugin>
>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>                      <configuration>
>>>>                        <systemProperties combine.children="append">
>>>>
>>>>
>>>>  <emma.session.out.file>${project.build.directory}/emma/coverage.es
>>>>            <http://coverage.es></emma.session.out.file>
>>>>
>>>>
>>>>  <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>>>>
>>>>
>>>>  <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>>>>                        </systemProperties>
>>>>                        <frameworkExtensions>
>>>>                          <frameworkExtension>
>>>>                            <groupId>com.sonatype.s2</groupId>
>>>>
>>>> <artifactId>org.eclemma.runtime.equinox</artifactId>
>>>>                            <version>1.1.0.200908261008</version>
>>>>                          </frameworkExtension>
>>>>                        </frameworkExtensions>
>>>>                      </configuration>
>>>>                    </plugin>
>>>>                  </plugins>
>>>>                </build>
>>>>              </profile>
>>>>             </profiles>
>>>>
>>>>            --
>>>>            Regards,
>>>>            Igor
>>>>
>>>>            Marc Wirth wrote:
>>>>
>>>>                Hi,
>>>>
>>>>                we've made some additions to tycho also for code
>>>>                coverage. If you look
>>>>                at https://issues.sonatype.org/browse/TYCHO-86 Sascha
>>>>                posted a link to
>>>>                a github repository where you can find those additions.
>>>>                We'd like to
>>>>                contribute that to tycho itself, but we may have to wait
>>>>                till tycho
>>>>                moves to Eclipse (or Apache?) due to some legal
>>>> constraints.
>>>>
>>>>                For the coverage we've basically extended the
>>>>                osgi-test-plugin itself,
>>>>                so you can centrally configure that you want emma:
>>>>
>>>>                    <plugin>
>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>                      <version>${tycho-version}</version>
>>>>                      <dependencies>
>>>>                        <dependency>
>>>>                          <groupId>org.sonatype.tycho</groupId>
>>>>                          <version>${tycho-version}</version>
>>>>
>>>> <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>>>                        </dependency>
>>>>                      </dependencies>
>>>>                    </plugin>
>>>>
>>>>                For eclipse-test-plugins that are fragments this will
>>>>                automatically
>>>>                instrument the classes of the fragment host, no further
>>>>                configuration
>>>>                required. You can also explicitly configure the
>>>>                <bundlesToInstrument>.
>>>>
>>>>                Tycho-86 has been updated referring to Tycho-353 which I
>>>>                think is a
>>>>                better solution to the frameworkBundles issue thatn what
>>>>                we did here,
>>>>                but from our point of view it's still missing the
>>>>                configuration
>>>>                options which bundles/classes to instrument
>>>>
>>>>                Marc
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Radoslaw Urbas
>>>> ____________________________
>>>> mail             [hidden email]
>>>> <mailto:[hidden email]>
>>>> homepage    http://urbas.tk/
>>
>>
>>
>> --
>> Radoslaw Urbas
>> ____________________________
>> mail             [hidden email]
>> homepage    http://urbas.tk/
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Igor Fedorenko-2
I don't know all the details, but I am quite sure that it generates
standard emma output, so both maven emma plugin and emma hudson
integration are expected to work. At least this is what I was told ;-).

--
Regards,
Igor

Mattias Holmqvist wrote:

> I have a small follow-up question on this. How do you generate reports
> from the coverage results? Do you use regular emma-plugin for Maven to
> do this?
>
> I could import the results into eclemma inside eclipse and see that
> the coverage was recorded. But of course I want to generate reports
> automatically from the headless build.
>
> Could you show a small example for reporting the coverage results?
>
> Regards,
> /Mattias
>
> On Wed, Mar 24, 2010 at 7:47 AM, Igor Fedorenko <[hidden email]> wrote:
>> You do not need to instrument classes at built time, this won't work in
>> OSGi, since instrumented classes depend on emma runtime. You need to use
>> dynamic instrumentation implemented by eclemma equinox runtime.
>> --
>> Regards,
>> Igor
>>
>> On Sat, Mar 20, 2010 at 4:47 AM, Radoslaw Urbas <[hidden email]>
>> wrote:
>>> This happening. The classes are present in generated-class/emma directory.
>>> How do I configure test runner to use these instrumented classes?
>>>
>>> On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]>
>>> wrote:
>>>> eclemma equinox runtime is supposed to instrument at runtime, you do not
>>>> need to instrument code statically during the build.
>>>>
>>>> --
>>>> Regards,
>>>> Igor
>>>>
>>>> Radoslaw Urbas wrote:
>>>>> I'm having difficulties with running emma instrumented code.
>>>>> Instrumentation phase seems to run fine  - coverage.em files are generated.
>>>>> But how do I configure plug-in bundling process to use instrumented classes?
>>>>>
>>>>> Having a "hello world" sample project with: single plug-in, test
>>>>> fragment, feature and updatesite + pom.xml and goals to generate coverage
>>>>> report would be really beneficial.
>>>>>
>>>>> Regards,
>>>>> Radek
>>>>>
>>>>> On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko
>>>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>>    We got prebuilt osgihook jar from eclemma SF download page [1] and
>>>>>    deployed it to our internal repository using "mvn deploy:file".
>>>>>
>>>>>    [1]
>>>>>
>>>>>  http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/
>>>>>
>>>>>    --
>>>>>    Regards,
>>>>>    Igor
>>>>>
>>>>>
>>>>>    Mattias Holmqvist wrote:
>>>>>
>>>>>        Thanks for the assistance. I could successfully generate code
>>>>>        coverage
>>>>>        with your method as well. However, I built the
>>>>>        org.eclemma.runtime.equinox myself with Tycho since I could not
>>>>> find
>>>>>        it on any public repository. It would be nice to get it from a
>>>>>        public
>>>>>        repository instead, do you know if it is available from any
>>>>>        public p2
>>>>>        repository?
>>>>>
>>>>>        How did you get that bundle into your build?
>>>>>
>>>>>        Thanks,
>>>>>        Mattias
>>>>>
>>>>>        On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
>>>>>        <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>>            Although not ideal, we use system properties to specify
>>>>>            bundles to
>>>>>            instrument. Here is a snippet from one of our internal
>>>>>            pom.xml files.
>>>>>
>>>>>              <profile>
>>>>>                <id>coverage</id>
>>>>>                <build>
>>>>>                  <plugins>
>>>>>                    <plugin>
>>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>>                      <configuration>
>>>>>                        <systemProperties combine.children="append">
>>>>>
>>>>>
>>>>>  <emma.session.out.file>${project.build.directory}/emma/coverage.es
>>>>>            <http://coverage.es></emma.session.out.file>
>>>>>
>>>>>
>>>>>  <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>>>>>
>>>>>
>>>>>  <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>>>>>                        </systemProperties>
>>>>>                        <frameworkExtensions>
>>>>>                          <frameworkExtension>
>>>>>                            <groupId>com.sonatype.s2</groupId>
>>>>>
>>>>> <artifactId>org.eclemma.runtime.equinox</artifactId>
>>>>>                            <version>1.1.0.200908261008</version>
>>>>>                          </frameworkExtension>
>>>>>                        </frameworkExtensions>
>>>>>                      </configuration>
>>>>>                    </plugin>
>>>>>                  </plugins>
>>>>>                </build>
>>>>>              </profile>
>>>>>             </profiles>
>>>>>
>>>>>            --
>>>>>            Regards,
>>>>>            Igor
>>>>>
>>>>>            Marc Wirth wrote:
>>>>>
>>>>>                Hi,
>>>>>
>>>>>                we've made some additions to tycho also for code
>>>>>                coverage. If you look
>>>>>                at https://issues.sonatype.org/browse/TYCHO-86 Sascha
>>>>>                posted a link to
>>>>>                a github repository where you can find those additions.
>>>>>                We'd like to
>>>>>                contribute that to tycho itself, but we may have to wait
>>>>>                till tycho
>>>>>                moves to Eclipse (or Apache?) due to some legal
>>>>> constraints.
>>>>>
>>>>>                For the coverage we've basically extended the
>>>>>                osgi-test-plugin itself,
>>>>>                so you can centrally configure that you want emma:
>>>>>
>>>>>                    <plugin>
>>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>>                      <version>${tycho-version}</version>
>>>>>                      <dependencies>
>>>>>                        <dependency>
>>>>>                          <groupId>org.sonatype.tycho</groupId>
>>>>>                          <version>${tycho-version}</version>
>>>>>
>>>>> <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>>>>                        </dependency>
>>>>>                      </dependencies>
>>>>>                    </plugin>
>>>>>
>>>>>                For eclipse-test-plugins that are fragments this will
>>>>>                automatically
>>>>>                instrument the classes of the fragment host, no further
>>>>>                configuration
>>>>>                required. You can also explicitly configure the
>>>>>                <bundlesToInstrument>.
>>>>>
>>>>>                Tycho-86 has been updated referring to Tycho-353 which I
>>>>>                think is a
>>>>>                better solution to the frameworkBundles issue thatn what
>>>>>                we did here,
>>>>>                but from our point of view it's still missing the
>>>>>                configuration
>>>>>                options which bundles/classes to instrument
>>>>>
>>>>>                Marc
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Radoslaw Urbas
>>>>> ____________________________
>>>>> mail             [hidden email]
>>>>> <mailto:[hidden email]>
>>>>> homepage    http://urbas.tk/
>>>
>>>
>>> --
>>> Radoslaw Urbas
>>> ____________________________
>>> mail             [hidden email]
>>> homepage    http://urbas.tk/
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

David Meibusch
In reply to this post by Mattias Holmqvist
Mattias,
We're using a Hudson plugin in our CI build to do the aggregated build test coverage.

The maven site generation (and report generation) has been in state of flux.
Until recently, the maven 3 site generation has been problematic. Not all report plugins have been supported in the newer 3.x maven-site-plugin.

Regards,
Dave

-----Original Message-----
From: Mattias Holmqvist [mailto:[hidden email]]
Sent: Wednesday, 14 April 2010 5:53 PM
To: [hidden email]
Subject: Re: [Tycho Users] Re: tus on Emma code coverage for unit tests in Tycho?

I have a small follow-up question on this. How do you generate reports
from the coverage results? Do you use regular emma-plugin for Maven to
do this?

I could import the results into eclemma inside eclipse and see that
the coverage was recorded. But of course I want to generate reports
automatically from the headless build.

Could you show a small example for reporting the coverage results?

Regards,
/Mattias

On Wed, Mar 24, 2010 at 7:47 AM, Igor Fedorenko <[hidden email]> wrote:

> You do not need to instrument classes at built time, this won't work in
> OSGi, since instrumented classes depend on emma runtime. You need to use
> dynamic instrumentation implemented by eclemma equinox runtime.
> --
> Regards,
> Igor
>
> On Sat, Mar 20, 2010 at 4:47 AM, Radoslaw Urbas <[hidden email]>
> wrote:
>>
>> This happening. The classes are present in generated-class/emma directory.
>> How do I configure test runner to use these instrumented classes?
>>
>> On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]>
>> wrote:
>>>
>>> eclemma equinox runtime is supposed to instrument at runtime, you do not
>>> need to instrument code statically during the build.
>>>
>>> --
>>> Regards,
>>> Igor
>>>
>>> Radoslaw Urbas wrote:
>>>>
>>>> I'm having difficulties with running emma instrumented code.
>>>> Instrumentation phase seems to run fine  - coverage.em files are generated.
>>>> But how do I configure plug-in bundling process to use instrumented classes?
>>>>
>>>> Having a "hello world" sample project with: single plug-in, test
>>>> fragment, feature and updatesite + pom.xml and goals to generate coverage
>>>> report would be really beneficial.
>>>>
>>>> Regards,
>>>> Radek
>>>>
>>>> On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko
>>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>>    We got prebuilt osgihook jar from eclemma SF download page [1] and
>>>>    deployed it to our internal repository using "mvn deploy:file".
>>>>
>>>>    [1]
>>>>
>>>>  http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/
>>>>
>>>>    --
>>>>    Regards,
>>>>    Igor
>>>>
>>>>
>>>>    Mattias Holmqvist wrote:
>>>>
>>>>        Thanks for the assistance. I could successfully generate code
>>>>        coverage
>>>>        with your method as well. However, I built the
>>>>        org.eclemma.runtime.equinox myself with Tycho since I could not
>>>> find
>>>>        it on any public repository. It would be nice to get it from a
>>>>        public
>>>>        repository instead, do you know if it is available from any
>>>>        public p2
>>>>        repository?
>>>>
>>>>        How did you get that bundle into your build?
>>>>
>>>>        Thanks,
>>>>        Mattias
>>>>
>>>>        On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
>>>>        <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>>            Although not ideal, we use system properties to specify
>>>>            bundles to
>>>>            instrument. Here is a snippet from one of our internal
>>>>            pom.xml files.
>>>>
>>>>              <profile>
>>>>                <id>coverage</id>
>>>>                <build>
>>>>                  <plugins>
>>>>                    <plugin>
>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>                      <configuration>
>>>>                        <systemProperties combine.children="append">
>>>>
>>>>
>>>>  <emma.session.out.file>${project.build.directory}/emma/coverage.es
>>>>            <http://coverage.es></emma.session.out.file>
>>>>
>>>>
>>>>  <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>>>>
>>>>
>>>>  <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>>>>                        </systemProperties>
>>>>                        <frameworkExtensions>
>>>>                          <frameworkExtension>
>>>>                            <groupId>com.sonatype.s2</groupId>
>>>>
>>>> <artifactId>org.eclemma.runtime.equinox</artifactId>
>>>>                            <version>1.1.0.200908261008</version>
>>>>                          </frameworkExtension>
>>>>                        </frameworkExtensions>
>>>>                      </configuration>
>>>>                    </plugin>
>>>>                  </plugins>
>>>>                </build>
>>>>              </profile>
>>>>             </profiles>
>>>>
>>>>            --
>>>>            Regards,
>>>>            Igor
>>>>
>>>>            Marc Wirth wrote:
>>>>
>>>>                Hi,
>>>>
>>>>                we've made some additions to tycho also for code
>>>>                coverage. If you look
>>>>                at https://issues.sonatype.org/browse/TYCHO-86 Sascha
>>>>                posted a link to
>>>>                a github repository where you can find those additions.
>>>>                We'd like to
>>>>                contribute that to tycho itself, but we may have to wait
>>>>                till tycho
>>>>                moves to Eclipse (or Apache?) due to some legal
>>>> constraints.
>>>>
>>>>                For the coverage we've basically extended the
>>>>                osgi-test-plugin itself,
>>>>                so you can centrally configure that you want emma:
>>>>
>>>>                    <plugin>
>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>                      <version>${tycho-version}</version>
>>>>                      <dependencies>
>>>>                        <dependency>
>>>>                          <groupId>org.sonatype.tycho</groupId>
>>>>                          <version>${tycho-version}</version>
>>>>
>>>> <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>>>                        </dependency>
>>>>                      </dependencies>
>>>>                    </plugin>
>>>>
>>>>                For eclipse-test-plugins that are fragments this will
>>>>                automatically
>>>>                instrument the classes of the fragment host, no further
>>>>                configuration
>>>>                required. You can also explicitly configure the
>>>>                <bundlesToInstrument>.
>>>>
>>>>                Tycho-86 has been updated referring to Tycho-353 which I
>>>>                think is a
>>>>                better solution to the frameworkBundles issue thatn what
>>>>                we did here,
>>>>                but from our point of view it's still missing the
>>>>                configuration
>>>>                options which bundles/classes to instrument
>>>>
>>>>                Marc
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Radoslaw Urbas
>>>> ____________________________
>>>> mail             [hidden email]
>>>> <mailto:[hidden email]>
>>>> homepage    http://urbas.tk/
>>
>>
>>
>> --
>> Radoslaw Urbas
>> ____________________________
>> mail             [hidden email]
>> homepage    http://urbas.tk/
>
>
 
This e-mail and any attachments are confidential and may also be legally privileged and/or copyright material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an intended or authorised recipient of this e-mail or have received it in error, please delete it immediately and notify the sender by e-mail. In such a case, reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Intec Telecom Systems PLC does not represent or warrant that an attachment hereto is free from computer viruses or other defects. The opinions expressed in this e-mail and any attachments may be those of the author and are not necessarily those of Intec Telecom Systems PLC.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: tus on Emma code coverage for unit tests in Tycho?

Mattias Holmqvist
AFAIK the Hudson emma plugin can only use generated reports (in xml)
and present them. I would be interested to hear what you use to
generate the xml file from the .es (coverage file) generated by
EclEmma.

Do you recommend making an Ant script to do the report generation due
to the problems with reporting plugins?

Thanks,
Mattias

On Thu, Apr 15, 2010 at 4:23 AM, David Meibusch
<[hidden email]> wrote:

> Mattias,
> We're using a Hudson plugin in our CI build to do the aggregated build test coverage.
>
> The maven site generation (and report generation) has been in state of flux.
> Until recently, the maven 3 site generation has been problematic. Not all report plugins have been supported in the newer 3.x maven-site-plugin.
>
> Regards,
> Dave
>
> -----Original Message-----
> From: Mattias Holmqvist [mailto:[hidden email]]
> Sent: Wednesday, 14 April 2010 5:53 PM
> To: [hidden email]
> Subject: Re: [Tycho Users] Re: tus on Emma code coverage for unit tests in Tycho?
>
> I have a small follow-up question on this. How do you generate reports
> from the coverage results? Do you use regular emma-plugin for Maven to
> do this?
>
> I could import the results into eclemma inside eclipse and see that
> the coverage was recorded. But of course I want to generate reports
> automatically from the headless build.
>
> Could you show a small example for reporting the coverage results?
>
> Regards,
> /Mattias
>
> On Wed, Mar 24, 2010 at 7:47 AM, Igor Fedorenko <[hidden email]> wrote:
>> You do not need to instrument classes at built time, this won't work in
>> OSGi, since instrumented classes depend on emma runtime. You need to use
>> dynamic instrumentation implemented by eclemma equinox runtime.
>> --
>> Regards,
>> Igor
>>
>> On Sat, Mar 20, 2010 at 4:47 AM, Radoslaw Urbas <[hidden email]>
>> wrote:
>>>
>>> This happening. The classes are present in generated-class/emma directory.
>>> How do I configure test runner to use these instrumented classes?
>>>
>>> On Sat, Mar 20, 2010 at 5:55 AM, Igor Fedorenko <[hidden email]>
>>> wrote:
>>>>
>>>> eclemma equinox runtime is supposed to instrument at runtime, you do not
>>>> need to instrument code statically during the build.
>>>>
>>>> --
>>>> Regards,
>>>> Igor
>>>>
>>>> Radoslaw Urbas wrote:
>>>>>
>>>>> I'm having difficulties with running emma instrumented code.
>>>>> Instrumentation phase seems to run fine  - coverage.em files are generated.
>>>>> But how do I configure plug-in bundling process to use instrumented classes?
>>>>>
>>>>> Having a "hello world" sample project with: single plug-in, test
>>>>> fragment, feature and updatesite + pom.xml and goals to generate coverage
>>>>> report would be really beneficial.
>>>>>
>>>>> Regards,
>>>>> Radek
>>>>>
>>>>> On Sat, Mar 13, 2010 at 12:21 AM, Igor Fedorenko
>>>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>>    We got prebuilt osgihook jar from eclemma SF download page [1] and
>>>>>    deployed it to our internal repository using "mvn deploy:file".
>>>>>
>>>>>    [1]
>>>>>
>>>>>  http://sourceforge.net/projects/eclemma/files/06_EclEmma_Runtime_for_Equinox/
>>>>>
>>>>>    --
>>>>>    Regards,
>>>>>    Igor
>>>>>
>>>>>
>>>>>    Mattias Holmqvist wrote:
>>>>>
>>>>>        Thanks for the assistance. I could successfully generate code
>>>>>        coverage
>>>>>        with your method as well. However, I built the
>>>>>        org.eclemma.runtime.equinox myself with Tycho since I could not
>>>>> find
>>>>>        it on any public repository. It would be nice to get it from a
>>>>>        public
>>>>>        repository instead, do you know if it is available from any
>>>>>        public p2
>>>>>        repository?
>>>>>
>>>>>        How did you get that bundle into your build?
>>>>>
>>>>>        Thanks,
>>>>>        Mattias
>>>>>
>>>>>        On Sat, Mar 6, 2010 at 7:00 PM, Igor Fedorenko
>>>>>        <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>>            Although not ideal, we use system properties to specify
>>>>>            bundles to
>>>>>            instrument. Here is a snippet from one of our internal
>>>>>            pom.xml files.
>>>>>
>>>>>              <profile>
>>>>>                <id>coverage</id>
>>>>>                <build>
>>>>>                  <plugins>
>>>>>                    <plugin>
>>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>>                      <configuration>
>>>>>                        <systemProperties combine.children="append">
>>>>>
>>>>>
>>>>>  <emma.session.out.file>${project.build.directory}/emma/coverage.es
>>>>>            <http://coverage.es></emma.session.out.file>
>>>>>
>>>>>
>>>>>  <emma.filter>com.sonatype.s2.*,org.maven.ide.*,proguard.*,-*.xpp3.*</emma.filter>
>>>>>
>>>>>
>>>>>  <eclemma.instrument.bundles>com.sonatype.m2e.jgit,com.sonatype.s2.authentication,...</eclemma.instrument.bundles>
>>>>>                        </systemProperties>
>>>>>                        <frameworkExtensions>
>>>>>                          <frameworkExtension>
>>>>>                            <groupId>com.sonatype.s2</groupId>
>>>>>
>>>>> <artifactId>org.eclemma.runtime.equinox</artifactId>
>>>>>                            <version>1.1.0.200908261008</version>
>>>>>                          </frameworkExtension>
>>>>>                        </frameworkExtensions>
>>>>>                      </configuration>
>>>>>                    </plugin>
>>>>>                  </plugins>
>>>>>                </build>
>>>>>              </profile>
>>>>>             </profiles>
>>>>>
>>>>>            --
>>>>>            Regards,
>>>>>            Igor
>>>>>
>>>>>            Marc Wirth wrote:
>>>>>
>>>>>                Hi,
>>>>>
>>>>>                we've made some additions to tycho also for code
>>>>>                coverage. If you look
>>>>>                at https://issues.sonatype.org/browse/TYCHO-86 Sascha
>>>>>                posted a link to
>>>>>                a github repository where you can find those additions.
>>>>>                We'd like to
>>>>>                contribute that to tycho itself, but we may have to wait
>>>>>                till tycho
>>>>>                moves to Eclipse (or Apache?) due to some legal
>>>>> constraints.
>>>>>
>>>>>                For the coverage we've basically extended the
>>>>>                osgi-test-plugin itself,
>>>>>                so you can centrally configure that you want emma:
>>>>>
>>>>>                    <plugin>
>>>>>                      <groupId>org.sonatype.tycho</groupId>
>>>>>                      <artifactId>maven-osgi-test-plugin</artifactId>
>>>>>                      <version>${tycho-version}</version>
>>>>>                      <dependencies>
>>>>>                        <dependency>
>>>>>                          <groupId>org.sonatype.tycho</groupId>
>>>>>                          <version>${tycho-version}</version>
>>>>>
>>>>> <artifactId>maven-osgi-test-emma-plugin</artifactId>
>>>>>                        </dependency>
>>>>>                      </dependencies>
>>>>>                    </plugin>
>>>>>
>>>>>                For eclipse-test-plugins that are fragments this will
>>>>>                automatically
>>>>>                instrument the classes of the fragment host, no further
>>>>>                configuration
>>>>>                required. You can also explicitly configure the
>>>>>                <bundlesToInstrument>.
>>>>>
>>>>>                Tycho-86 has been updated referring to Tycho-353 which I
>>>>>                think is a
>>>>>                better solution to the frameworkBundles issue thatn what
>>>>>                we did here,
>>>>>                but from our point of view it's still missing the
>>>>>                configuration
>>>>>                options which bundles/classes to instrument
>>>>>
>>>>>                Marc
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Radoslaw Urbas
>>>>> ____________________________
>>>>> mail             [hidden email]
>>>>> <mailto:[hidden email]>
>>>>> homepage    http://urbas.tk/
>>>
>>>
>>>
>>> --
>>> Radoslaw Urbas
>>> ____________________________
>>> mail             [hidden email]
>>> homepage    http://urbas.tk/
>>
>>
>
> This e-mail and any attachments are confidential and may also be legally privileged and/or copyright material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an intended or authorised recipient of this e-mail or have received it in error, please delete it immediately and notify the sender by e-mail. In such a case, reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Intec Telecom Systems PLC does not represent or warrant that an attachment hereto is free from computer viruses or other defects. The opinions expressed in this e-mail and any attachments may be those of the author and are not necessarily those of Intec Telecom Systems PLC.
>
Loading...