Emma Plugin

Plugin Information

Plugin ID emma
Latest Release 1.29-h-1
Latest Release Date Aug 15, 2012
Sources Github
Support Eclipse Hudson Forum
Issue Tracking Eclipse Bugzilla

This plugin allows you to capture code coverage report from Emma. Hudson will generate the trend report of coverage.

Usage with Maven2

1. With maven 2.2.x you don't need to add anything to your POM file.

2. Add the "emma:emma" goal to your build to generate Emma reports.

Hudson Configuration

1.- Add "emma:emma" goal to your maven Build
2.- Enable recording Emma coverage report, and configure it.

3.- Optional: if you want to store html coverage files generated by Emma, configure a post-build action to do that.

Usage with ANT

1.- Create the taskdef and other necessary information for ANT:

 <property name="coverage.dir" value="${basedir}/coverage" />
 <property name="emma.dir" value="/usr/bin/emma" />
 <property name="src.dir" value="${basedir}/src/"/>
 <property name="class.dir" value="${basedir}/class/"/>
 <property name="instrumented.dir" value="${basedir}/inst/"/>
 <path id="emma.lib">
     <fileset dir="${emma.dir}">
         <include name="*.jar"/>
     </fileset>
 </path>
   
 <taskdef resource="emma_ant.properties" classpathref="emma.lib" />

coverage.dir is the location emma will generate the report data to, and emma.dir should be the location of the emma binaries on your system. src.dir is the location of your source files, class.dir is the location of your binary files to be instrumented, and instrumented.dir is the location to store the instrumented binaries.

2.- Tell emma where to find the code to instrument, and the new location to place that code. Note that you must instrument the code before running tests on it.

 <emma enabled="true">
     <instr instrpath="${class.dir}" destdir="${instrumented.dir}" metadatafile="${coverage.dir}/metadata.emma" merge="true">
         <filter excludes="au.com.jenisys.view.*"/>
     </instr>
 </emma>

Use instrpathref instead of instrpath in conjunction with a previously-defined path for more complex setups. Use the filter nested element to include or exclude certain code from being instrumented. For more information on the instr element, see http://emma.sourceforge.net/reference/ch02s03.html

3.- After the instrumented code has been run, tell emma how to prepare the reports:

 <emma enabled="true" >
     <report sourcepath="${src.dir}" >
         <fileset dir="${coverage.dir}" >
             <include name="*.emma" />
         </fileset>

         <xml outfile="${coverage.dir}/coverage.xml" depth="method"/>
     </report>
 </emma>

This will generate an xml report, to the method depth of detail. For more information on the report element, see http://emma.sourceforge.net/reference/ch02s04.html

Change Log

Compatibility Info
The plug-in is being maintained by its owner/maintainers from a new home. Check the Tier info for details of compatibility

Version 1.24 (Feb 8, 2011)

  • Dashboard portlets. Emma portlets for the Dashboard view plugin, a grid and a trend chart.

Version 1.23 (unreleased)

Version 1.22 (Jan 27, 2011)

  • Control release after moving to github

Version 1.21 (Sep 11, 2010)

  • Fixed deprecated API.
  • Added Japanese localization.
  • Restored the floatingBox.jelly which was deleted in previous version.(issue #7383)
  • Help file is missing, so deleted the link.(issue #7381)
  • Added enlarge link.
  • Removed refresh from coverage pages.(issue #7428)

Version 1.20 (Mar 18, 2010)

  • Improve Styling

Version 1.16 (Mar 09, 2010)

  • Fixed sort in tables

Version 1.12 (Feb 21, 2010)

  • Support for multimodule projects
  • Able to automatically look for coverage.xml files in the workspace
  • Internationalization
  • Spanish translation

Version 1.10 (Jun 9, 2009)

  • Remote API improvement (patch)

Version 1.9 (Apr 6, 2009)

  • Emma plugin now works with the Maven2 project type (issue #3424)

Labels:

plugin-report plugin-report Delete
tier3-installtest-plugin tier3-installtest-plugin Delete
tier2-plugin tier2-plugin Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Apr 03, 2009

    Sarthak says:

    Hi, Can we make the Emma plugin compatible with maven projects? Currently, I ca...

    Hi,

    Can we make the Emma plugin compatible with maven projects? Currently, I cant add the emma plugin to my m2 projects. I dont want to use freestyle projects, since I lose all the maven features of dependency management.

    Thanks 

  2. Apr 12, 2009

    Frank says:

    The coverage trend is useful, but I would really like to get Hudson to display t...

    The coverage trend is useful, but I would really like to get Hudson to display the detailed coverage report (available using the <html> element to the <report> element shown above). Could I achieve this by configuring the Sidebar-Link Plugin to point to a location in the build project's workspace?

    1. Mar 07, 2010

      Manuel Carrasco says:

      Updated this wiki page with a explanation about how to archive html files genera...

      Updated this wiki page with a explanation about how to archive html files generated by Emma using the 'archive artifacts' plugin.

  3. May 06, 2009

    Gary says:

    I am trying to install this plugin on Hudson version 1.276. It looks to be insta...

    I am trying to install this plugin on Hudson version 1.276. It looks to be installed correctly but it does not appear in the list of installed plugins.   I then tried to install to install the Sidebae-Link Plugin above and it does appear in the list of installed plugins.

  4. Jun 10, 2009

    Carolyn Teo says:

    Hi I had 2 concerns about Emma :   Emma was install in Hudson but the hel...

    Hi

    I had 2 concerns about Emma :  

    Emma was install in Hudson but the help test does not seem to display properly.

     It seems that Emma does not allow wildcard. Is this a possible addition to Emma?? Because there are individual modules that are build under emma and these generate different statistics. So we wanted to be able to capture them

    Thanks! 

    1. Mar 07, 2010

      Manuel Carrasco says:

      Done in version 1.12

      Done in version 1.12

  5. Jul 14, 2009

    Thomas Jonsson says:

    Hi! How about this plugin and multi-module maven projects? I can't come up ...

    Hi!

    How about this plugin and multi-module maven projects? I can't come up with any ideas how to get it to work. Does anyone know if it is possible to invoke post-build actions on a sub module in Hudson?

    Best regards,

    Thomas

    1. Mar 07, 2010

      Manuel Carrasco says:

      Fixed in version 1.12

      Fixed in version 1.12

  6. Dec 02, 2009

    Bruno Bonacci says:

    I do agree with above Thomas  and Carolyne comments. The plugin currently d...

    I do agree with above Thomas  and Carolyne comments. The plugin currently doesn't support multi-module maven 2 projects (as you can specify only one coverage.xml).

    The only way is building goal that merge all metadata files together and is pretty ugly and laborious. It would be nice if we can specify an ant fileset (**/*/coverage.e*).

    thanks

    Bruno

    1. Mar 07, 2010

      Manuel Carrasco says:

      Fixed in version 1.12, you can specify multiple files or leave the plugin look f...

      Fixed in version 1.12, you can specify multiple files or leave the plugin look for all coverage.xml files in the workspace

  7. Jan 29, 2010

    Bitard Michaël says:

    Hi, Since the last update, we get an error : FATAL: java.lang.String.isEmpty()...

    Hi,

    Since the last update, we get an error :

    FATAL: java.lang.String.isEmpty()Z
    java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
    at hudson.plugins.emma.EmmaPublisher.perform(EmmaPublisher.java:105)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
    at hudson.model.Build$RunnerImpl.post2(Build.java:152)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
    at hudson.model.Run.run(Run.java:1221)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:122)

    It seems that emma plugin is using java 6.
    Can we have a java 5 version of this plugin?

    Thanks

    Michaël

    1. Feb 21, 2010

      Himanshu Varsheny says:

      Just wondering if there has been any resolution or workaround for this problem? ...

      Just wondering if there has been any resolution or workaround for this problem?

      Thanks,

      Himanshu

      1. Feb 21, 2010

        Himanshu Varsheny says:

        oops.. I see http://issues.hudson-ci.org/browse/HUDSON-5440 already filed for th...

        oops.. I see http://issues.hudson-ci.org/browse/HUDSON-5440 already filed for this. Will wait for this to be fixed now :)

  8. Feb 22, 2010

    Mike Machado says:

    When I enabled this plugin in my maven2 project and then added "emma:emma" to my...

    When I enabled this plugin in my maven2 project and then added "emma:emma" to my goals, the coverage report works, but now my unit tests are counted twice on the "Test Result Trend" graph. Is there a way to fix that?

    1. Mar 07, 2010

      Manuel Carrasco says:

      do you do a mvn clean?

      do you do a mvn clean?

    2. Mar 10, 2010

      Mirko Friedenhagen says:

      Hello, maybe they are run twice: once without coverage and once with coverage ....

      Hello,

      maybe they are run twice: once without coverage and once with coverage . You may have the case that tests break if coverage is switched on. AFAIK clover wraps the source code for coverage while cobertura does the same with byte code, I do not know about EMMA.

      Regards
      Mirko

  9. Apr 07, 2010

    Christian Gruenberg says:

    Hi, I like to setup a multimodule-maven2 job with emma. But only to use the goa...

    Hi,

    I like to setup a multimodule-maven2 job with emma. But only to use the goal emma:emma doesn't produce any emma reports. I only see in the target directory of my modules the files coverage.ec and coverage.em. Can somebody help?

    Regards,

    Christian

  10. Apr 07, 2010

    Manuel Carrasco says:

    Hello, Try to execute `mvn clean emma:emma` in your project out of Hudson. Nor...

    Hello,

    Try to execute `mvn clean emma:emma` in your project out of Hudson.

    Normally executing it you will get the files `module/target/coverage*.*`, `module/target/site/emma/coverage.xml` and `module/target/site/emma/index.html`. You will have as many coverage.xml files as modules in your project (note that if the module has not any test, the file is not generated).

    If you don't get this bunch of files, it is an issue with the maven emma plugin.

    Once you have everything working, put your project in Hudson as a maven one, add the emma:emma goal, and enable `record emma reports`, leaving the input box of xml files empty should work, or you can write `**/emma/coverage.xml`

    Cheers
    -Manolo

  11. Apr 15, 2010

    Klobetime says:

    How can I get the emma trend graph to appear on the main project page with the o...

    How can I get the emma trend graph to appear on the main project page with the other trend graphs?  If I click on "Coverage Report" on the left I can see the trend graph, but I'd like it to appear on the main page on the right along with the Static Analysis and Test Result trend graphs.

    Thanks!

    -mck

    1. Apr 15, 2010

      Manuel Carrasco says:

      It's not possible right now. I think it is a nice feature, so I'll put it in th...

      It's not possible right now.

      I think it is a nice feature, so I'll put it in the next release.

      -Manolo

  12. Apr 29, 2010

    Subhashish says:

    Hi, I use the Emma plugin and find it's health reporting feature really useful. ...

    Hi,
    I use the Emma plugin and find it's health reporting feature really useful. It would be good to also be able to set such benchmarks which if violated would cause the builds to be marked as unstable or to be failed. Just like the FindBugs and PMD plugins. Is there any way I can do that now? Else, can you put this as a feature request please?

    Thanks,
    Subhashish

  13. Jul 27, 2010

    Adam Szecowka says:

    How coverage report is generated ? I have problem, because on X axis I can see o...

    How coverage report is generated ? I have problem, because on X axis I can see only last build (for example #50) and one previous (#30), and it is always straight line. I want see how coverage was changed during all builds. Where is input data stored ?

  14. Aug 05, 2010

    Franck POUPELIN says:

    In order to improve Internet Explorer render simply remove in the emma style she...

    In order to improve Internet Explorer render simply remove in the emma style sheet (style.css) this line:

      position: absolute; in the span.text section

    1. Oct 17, 2010

      May says:

      Is there a plan to fix this in a future relase, instead of having to manually ch...

      Is there a plan to fix this in a future relase, instead of having to manually change the css?

  15. Jan 19, 2011

    nithin nambiar says:

    Im using hudson to generate emma coverage report for my multi module project. I ...

    Im using hudson to generate emma coverage report for my multi module project. I noticed that if im having similar package names(com.xyz.util) in multiple modules hudson tend to show only classes from one of the modules in the report. is this a known issue ?

  16. May 26, 2011

    Paul Borgen says:

    Is there any way get get the 1.24 version of the hudson emma plugin? We have hu...

    Is there any way get get the 1.24 version of the hudson emma plugin?

    We have hudson version 1.3.98

    1. May 30, 2011

      Manuel Carrasco says:

      Yeah, take it from jenkins it should be compatible

      Yeah, take it from jenkins it should be compatible

  17. Feb 09, 2012

    bruce_sha says:

    hi , i'm using maven 3.0.4 hudson 2.2.0 and emma plugin i config everying...

    hi ,

    i'm using maven 3.0.4 hudson 2.2.0 and emma plugin

    i config everying as the "Usage with Maven2" section of this page , but when i build the job, i  can not find any coverage*.xml or coverage*.ec file under workspace\target\  (there is a file named coverage.em ), this is the console  log

    ---------------------------------------------------------------------------------------------------------------------

    .....

    -------------------------------------------------------
    T E S T S
    -------------------------------------------------------
    Running foo.AppTest
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec
    Results :
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
    [HUDSON] Recording test results
    [INFO] *[emma:emma execution: default-cli ]*
    processing input files ...
    1 file(s) read and merged in 0 ms
    nothing to do: no runtime coverage data found in any of the data files
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4 seconds
    [INFO] Finished at: Thu Feb 09 23:39:28 CST 2012
    [INFO] Final Memory: 15M/37M
    [INFO] ------------------------------------------------------------------------
    channel stopped
    Emma: looking for coverage reports in the entire workspace: C:\Users\lenovo\.hudson\jobs\simple\workspace
    Emma: no coverage files found in workspace. Was any report generated?
    [DEBUG] Skipping watched dependency update for build: simple #19 due to result: FAILURE
    Finished: FAILURE

    ---------------------------------------------------------------------------------------------------------------------

    anybody can help me,thanks