Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to disable integration test in Clover

a b February 27, 2015

I am using maven and Clover in my project, but I do not want the integration test classes get executed. These integration test classes were written a long time ago, which will fail the Clover procedure. Is there a way to disable integration test when running Clover? I am using automation Clover integration.

1 answer

1 accepted

0 votes
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2015

1) In case your integration tests are launched using maven-failsafe-plugin (and not the maven-surefire-plugin), then you can disable their execution by adding the following parameter in configuration of a Maven Task:

-DskipITs=true

 

See: http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#skipITs

 

2) Alternatively, you can use manual Clover integration and do not run the 'integration-test' phase. For instance:

mvn clean clover2:setup test clover2:aggregate clover2:clover -Dmaven.clover.licenseLocation=/path/to/clover.license

 

3) Alternatively, you can also define proper exclusion patterns to omit your integration tests. This works for both maven-surefire-plugin and maven-failsafe-plugin.

 

See:

http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#excludes

http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#excludes

a b March 1, 2015

Hi Marek, thanks so much for the reply. I finally adopt 2nd option. 1) I configured Clover in a individual job and followed the instructment create a separate Job in which automatic Clover integration is enabled create a Maven task in this job, which will do nothing (call the "clean" goal, for instance) Bamboo will automatically add Clover-related goals (clover2:setup verify clover2:aggregate clover2:clover) So in my step it is just a clean command. The -DskipITs=true does not help at all in my test. 2) "test" phrase works as expected. Just a bit more complicated than automatically Clover. Finally I figured it out. One thing to mention is the com.atlassian.maven.plugins:: prefix is needed before clover2, otherwise there is an exception related to m2e. I did not add com.atlassian.maven.plugins in my pom.xml. I can not figure the root cause... 3) Need update pom.xml or something else. Aside. HOWEVER, the integrating with Clover, it looks like bamboo can not fetch code from Stash frequently. I have to manully run branch, but it is definitely not the spirit of CI. I opened another card https://answers.atlassian.com/questions/12911103/checkout-default-repository1-failed-with-code-128 Could you please help on this card as well? Thank you!

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2015

> The -DskipITs=true does not help at all in my test. Maybe you're not using maven-cargo-plugin for them? Or test naming convention used is different? > One thing to mention is the com.atlassian.maven.plugins:: prefix is needed before clover2 Maven searches for build plugins in the 'org.apache.maven.plugins' groupId by default. As Clover plugin has "com.atlassian.maven.plugins" gropuId, you have to either use fully qualified name (as you did) or to declare the following snippet in ~/.m2/settings.xml: <pluginGroups> <pluginGroup>com.atlassian.maven.plugins</pluginGroup> </pluginGroups> > otherwise there is an exception related to m2e. [...] I can not figure the root cause... Could you share build logs, please? (you can create a ticket on support.atlassian.com or paste a link here) > HOWEVER, the integrating with Clover, it looks like bamboo can not fetch code from Stash frequently. [...] Could you please help on this card as well? I guess this is a problem with Stash. I'll ask Stash team to have a look at it.

a b March 2, 2015

Hi Marek, Thanks for the explanation. We do not use maven-cargo-plugin. My understanding is in automatic integration, according to https://confluence.atlassian.com/display/BAMBOO/Enabling+the+Clover+add-on this beneath Maven goals is like "clover2:setup verify clover2:aggregate clover2:clover" And IT will be run during verify phrase. The log related to m2e is here: 01-Mar-2015 20:38:49 [WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available 01-Mar-2015 20:38:49 [WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 Although it is a warning, I did not see it in a successful build. And all the build steps failed after this warning. So I consider it is a fatal warning.

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2015

Could you run a build with debug logging (mvn -X), create a ticket at http://support.atlassian.com and attach entire build log, please? I'd love to investigate it.

a b March 4, 2015

Hi @Marek Parfianowicz, I am kind of busy these days. Will update you later.

a b March 9, 2015

hi @Marek Parfianowicz , I created a ticket regarding the m2e exception here https://support.atlassian.com/servicedesk/customer/portal/13/CLV-6218 Please take a look. Another question is Clover report is not generated in multi-module maven project, could you please take a look as well? https://answers.atlassian.com/questions/12918095 or https://support.atlassian.com/servicedesk/customer/portal/13/CLV-6219 I appreciate your great help!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events