How to include integration tests when running code coverage ?

How to include integration tests when running code coverage from clover , currently test-app includes tests only from unit tests directory, we have tests in unit tests and integration tests under tests package. Test report is not showing tests from integration directory. Any help is appreciated.

 

Thanks

1 answer

0 votes

Hi Santhosh,

Your description of the problem is insufficient, could you provide more details, please?

  • what Clover integration do you use (Ant / Maven / Grails / Eclipse / IDEA ...)?
  • what Clover version do you use?
  • how do you launch your tests?
  • what test report do you refer to?
    • are you talking about Clover's HTML Report and the "Tests results" tab? 
    • or about some JUnit test report(s)?
    • or something else?

Cheers
Marek 

Hello Marek,

Thanks for the reply and please see my responses inline.

  • what Clover integration do you use (Ant / Maven / Grails / Eclipse / IDEA ...)?
    Response:Dev stack Grails framework, report run from IDEA
  • what Clover version do you use?
    Response: clover:4.1.1
  • how do you launch your tests?
    Response: Tests launched from IDEA 'test-app 'and picked up during build time(gradle)
  • what test report do you refer to?
    • are you talking about Clover's HTML Report and the "Tests results" tab? 
      Response: I am referring to clover's html report and Test results Tab - These have report from unit tests only.
    • or about some JUnit test report(s)?
    • or something else?

    Thanks

> Dev stack Grails framework, report run from IDEA

Please note that currently Clover does not support instrumentation of Groovy code in Eclipse and IDEA - the only way to get coverage for Groovy is to run a build from a command line (Ant / Maven / Grails).

What Grails version do you use? Please note that Clover is not compatible with Grails 3 (which changed their build system from Gant to Gradle).


> clover:4.1.1

By the way: there is a newer version available - 4.1.2 - it brings a critical bug fix for Groovy instrumentation, so you may find valuable to update.


> Tests launched from IDEA 'test-app 'and picked up during build time(gradle)

I recall that there are some problems with Grails application and launching tests from IntelliJ IDEA - the reason is that IDEA launches tests a little bit differently than the 'grails test-app' command - see https://jira.atlassian.com/browse/CLOV-1443.

Could you please clarify how do you run tests - are you calling 'grails test-app' goal from the Grails view or do you run tests via 'Edit Configurations...' + 'Run' button?

> build time(gradle)

What do you mean by this? Please note that Clover does not officially support Gradle yet. What plugin do you use?


I am referring to clover's html report and Test results Tab - These have report from unit tests only.

In which language do you have your application code / unit tests / integration tests written? Are they in Java or Groovy?


One more question: what happens when you launch a build from a command line - is Clover able to correctly measure code coverage for both unit and integration tests? I'm asking because I'd like to clarify whether it's a problem in IntelliJ IDEA only or whether it does not work in a command line too.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

179 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you