jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-135

Manage test exclusions from code coverage

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.7
  • Component/s: None
  • Labels:
    None

Description

Some tests can be excluded from surefire execution. Example on commons-email :

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<excludes>
<exclude>org/apache/commons/mail/BaseEmailTestCase.java</exclude>
<exclude>org/apache/commons/mail/mocks/*</exclude>
<exclude>org/apache/commons/mail/settings/*</exclude>
</excludes>
</configuration>
</plugin>

This configuration should be propagated to code coverage plugins (cobertura/clover) :

--> for cobertura (http://mojo.codehaus.org/cobertura-maven-plugin/usage.html#Instrumentation)

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<instrumentation>
<ignores>
<ignore>com.example.boringcode.*</ignore>
</ignores>
<excludes>
<exclude>com/example/dullcode/*/.class</exclude>
<exclude>com/example/**/*Test.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>

--> for clover (http://maven.apache.org/plugins/maven-clover-plugin/usage.html)

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clover-plugin</artifactId>
<configuration>
<includes>
<include>*/api//.java</include>
<include>some/path/MyFile.java</include>
[...]
</includes>
<excludes>
<exclude>**/*Test/java</exclude>
[...]
</excludes>
[...]

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Wojciech Durczynski added a comment - 08/Jul/08 3:02 AM

Also with configuration:
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

all tests in the module should be skipped. It doesn't work in 1.4RC1

Show
Wojciech Durczynski added a comment - 08/Jul/08 3:02 AM Also with configuration: <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> all tests in the module should be skipped. It doesn't work in 1.4RC1
Hide
Permalink
Simon Brandhof added a comment - 09/Jul/08 1:26 AM

Hi Wojciech,
If you don't want to execute tests, you can add the parameter -Dsonar.light=true. It also works from pom.xml :

<properties>
  	<sonar.light>true</sonar.light>
  </properties>
Show
Simon Brandhof added a comment - 09/Jul/08 1:26 AM Hi Wojciech, If you don't want to execute tests, you can add the parameter -Dsonar.light=true. It also works from pom.xml :
<properties>
  	<sonar.light>true</sonar.light>
  </properties>
Hide
Permalink
Simon Brandhof added a comment - 28/Oct/08 11:41 AM

Wojciech, for your information, skipped tests are managed in sonar 1.5. See SONAR-401.

Show
Simon Brandhof added a comment - 28/Oct/08 11:41 AM Wojciech, for your information, skipped tests are managed in sonar 1.5. See SONAR-401.

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Simon Brandhof
Vote (3)
Watch (1)

Dates

  • Created:
    08/Jan/08 10:51 AM
    Updated:
    22/Mar/09 2:16 PM
    Resolved:
    04/Mar/09 9:42 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.