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

How to include integration tests when running code coverage ?

Santhosh Singirikonda January 17, 2017

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
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2017

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 

Santhosh Singirikonda January 19, 2017

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
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2017

> 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
TAGS
AUG Leaders

Atlassian Community Events