Separate coverage reports for Unit and Integration tests

Must-share information (formatted with Markdown):

  • which versions are you using: Enterprise Edition Version 8.9.4 (build 50575)
  • what are you trying to achieve: Separate reports for Unit & Integration tests
  • what have you tried so far to achieve this: Searched online

I can see from many posts that changes were made years ago to combine Unit & Integration test code coverage. I can also see that this is a popular request on the community.

Are there any plans to make this configurable so that users can decide to display a combined or separate report?

Regards,
Steven

3 Likes

Hi Steven,

Welcome to the community!

Since you start by acknowledging that this feature doesn’t exist (and I’m not aware of any plans for it) :smiley:, I’ve moved your thread to Product Manager for a Day.

Now we just need to get the full-time PMs interested. To do that, can you flesh out the topic template, please?

Try to describe the problem or opportunity you are seeing and why it matters. The closer you stick to this topic template, and the more information you provide, the better chance you have to generate a real discussion.

A few questions to help you:

  • What are you trying to accomplish?
  • Why does this matter to you?
  • How would that look in SonarQube? Alternatives?
  • How would we know it works well?
  • Why should it be a priority now?

 
Ann

Here you go.

  • What are you trying to accomplish?
    To view the code coverage for Unit Tests and Integration Test separately

  • Why does this matter to you?
    For the unit tests we will be mocking things, in the integration tests it is interacting with the other services. So we want to see we are covering the same parts of the code with the integration tests that we do with the unit tests.

  • How would that look in SonarQube? Alternatives?
    At the Overview level it wouldn’t look any different, but in the Measures tab under Coverage it would break things down.

  • How would we know it works well?
    Not sure who to answer this one. If it displayed the coverage for both Unit Test and Integration Tests separately is would be working well.

  • Why should it be a priority now?
    It gives the users a greater choice on how they want to review their code.

3 Likes

Hi Ann ,

Do you know if anything is happening with this request?

1 Like

Hi,

Like the wheels of justice, the wheels of SonarQube turn slowly. So I wouldn’t expect anything on this any time soon. I’ll ping the PMs, though.

 
Ann

Hi Steven

Apologies for the slow response, its a busy period for the SonarQube PMs with the new LTS about to release :slight_smile:

Thanks for sharing this request. It’s an interesting idea and we’d love to do more around test analysis and displaying coverage. It’s not something that’s on our roadmap at the moment but I’ll add your idea into our Product Management system and hopefully it’s something we can start to explore when time allows.

Thanks

Tom

3 Likes

I was looking for such a feature too, Actually it could be very useful to control and support correct testing piramide because the overall coverage metric did not provide visibility of the proportion of the tests. On Java/Gradle side I could generate 2 Jacoco reports, one for Unit tests and one for Integration tests and pass it to sonar, after that I expect to configure some quality gates based on Overal, Unit and Integration metrics.

1 Like

A lot of people need this feature which was already before and later removed. Any updates on this @ganncamp @Tom_Howlett

Or is there any workaround. Like we can create copy of same project - project-UT and project-IT

1 Like

Hi Mehul

Thanks for adding your voice here. It’s not something we are working on or have planned, but we will review this and I will update this thread if it does get prioritized.

I’m sorry, I’m not aware of any good workarounds.

Tom

2 Likes