开发者

Hudson/Jenkins: Buckminster emma: How to exclude packages

I use Jenkins and Buckminster for rcp app for CI and this works like a charme. The only problem I have is that the buckminster emma task does the code coverage for ALL packages in the checked-out workspace. I would like to specify an exclude filter as this is described for the ant task but did not get it working. The buckminster emma help command didn't helped me neither. I have several plugins in my workspace, the unit tests are specified for my own packages. But there is one plugin including source files which I do not want emma to take into account for code coverage as this is an external package. My JUnittests also do not cover this package.

How do I achieve this to exclude this package/classes in the one plugin?

Example:

  • plugin A (external)
  • plugin B (own)
  • plugin C (containing unit tests)

The commands I use is the following:

importtargetdefinition -A '${WORKSPACE}/de.plugin.site/plugin.target'
import '${WORKSPACE}/de.plugin.site/site.cquery'
build
perform -D target.os=* -D target.ws=* -D target.arch=* de.plugin.site#site.p2
perform -D target.os=win32 -D target.ws=win32 -D target.arch=x86 de.plugin.site#create.product.zip

emma -l '/de.plugin.test/AllBuckminsterTests.launch' -o '${WORKSPACE}output/junit_result.xml' --xml '${WORKSPACE}/output/coverage_report.xml' --flatXML

`

I tried the parameter --define 'filter=-de.开发者_运维百科external.*' given in the buckminster emma help but without success.

Any help would be great!


Did you ask this in the Buckminster forum at Eclipse?


Here's another thing which also doesn't work, unfortunately (for me). Using the EclEmma plugin or manually, add the following to the launch config:

<listAttribute key="com.mountainminds.eclemma.core.SCOPE_IDS">
<listEntry value="=project1/src"/>
<listEntry value="=project2/gen"/>
<listEntry value="=project2/src"/>
</listAttribute>

This works for the interactive Emma (in Eclipse), but Bucky seems to ignore it.


The launch file can be a standard launch file, but you may want to create an emma specific launch configuration using the EclEmma IDE tools as this enables you to control which classes and packages to include in the coverage instrumentation.

Put your Test classes in a separate test-source-folder.


You must set exclusion/inclusion filter using the Jenkins/Hudson Jacoco plugin; if I remember correctly, the entries in the launch configuration inserted using EclEmma UI are honored by Buckminster (you should see that if you generate html output), but if you want Jacoco report in the CI you need to configure exclusion/inclusion in the corresponding post build action. By the way, Jacoco plugin now works only with .exec files, so you need to run the 'emma' command using -exec.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜