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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Clover aggregate - Few classes are showing 0% coverage with multi module project

I am having multi module project and trying to generate aggregate coverage. when i check the report few classes are showing 0% coverage when i run that module separately it shows the right coverage. is there any problem with DB merge. Is there any other way to maintain order of DB merge? because i see sub modules are down in the list which has no coverage (Main module has code coverage) 

i am using clover 3.1.0 and the command 

mvn clean deploy clover2:instrument clover2:aggregate clover2:clover

 

2 answers

0 votes

In order to have code coverage Clover instrumented code needs to be executed (e.g via tests).

I don't have your build configuration but it seems like the code isn't invoked before generating coverage ?

When i run the modules separately i could see the coverage for those classes. would there be any problem with order db merge?

I am covering few tests from other modules

Ex: lets say i have 3 modules mod1, mod2 & mod3

mod 2 has 70% coverage from same module (Tests are written in the same module under /test directory) and 20% covered from mod 3 (invokes mod 2 classes).

when i run mod3 alone it shows 20% coverage of mod2 but when i build through jenkins i see clover merge order as

mod1

mod3

mod2

and coverage of that 20% is not shown. it shows as 0% covered.

is there a way to control the order of clover db merge?

If your classes are covered by tests coming from different modules db merge isn't the operation you want.
Merge will pick coverage for a class from a coverage file it first encounters (from first module it processes). So if you have more coverage for that class in another module it won't be picked up. 

If you have test coverage across different modules I think you should use singleCloverDatabase option. 

singleCloverDatabase flag resolved the issue. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

439 views 5 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you