Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1011

Coverage data not showing up in Intellij

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Highest Highest
    • won't fix
    • 3.1.0, 3.1.1
    • CIJ Plugin
    • None
    • Intellij IDEA 10.5.1, OSX.

      I've got the dev build from CLOV-1004, which worked for Intellij 10.3 but since I upgraded to 10.5.1, neither the latest public rev (3.1.0.v20110608114626-dev) nor the dev version of the plugin from CLOV-1004 works.

      In the projects view, it looks like the code is instrumented. But after I run a test, no coverage information is displayed. When I explicitly update the clover database, nothing is updated. The "Test Runs" view behaves as if I never ran a test.

            [CLOV-1011] Coverage data not showing up in Intellij

            Hi Marek,
            I do tend to use the maven compile goal, but given your feedback, I have since stopped doing this and life is great with intellij and clover. Thanks so much...this has really helped my development every day!

            Andrew Zimmer added a comment - Hi Marek, I do tend to use the maven compile goal, but given your feedback, I have since stopped doing this and life is great with intellij and clover. Thanks so much...this has really helped my development every day!

            Hi Andrew, does this problem still occurs on your environment? I was not able to reproduce it. Do you have some sample project showing the problem (source files + pom.xml + .iml/.ipr/*.iws files)? Is there any change that you were using IBM JRE? There is one bug related with coverage which was fixed recently - CLOV-1151.

            Marek Parfianowicz added a comment - Hi Andrew, does this problem still occurs on your environment? I was not able to reproduce it. Do you have some sample project showing the problem (source files + pom.xml + .iml/.ipr/*.iws files)? Is there any change that you were using IBM JRE? There is one bug related with coverage which was fixed recently - CLOV-1151 .

            I'm rescheduling this issue to 3.1.8 as 3.1.7 version is going to be released this week.

            Marek Parfianowicz added a comment - I'm rescheduling this issue to 3.1.8 as 3.1.7 version is going to be released this week.

            Hi Andrew,

            I mentioned on 1st of August that I reproduced a problem. However my further tests showed that it was due to some class clashing in IDEA debug mode. So it seems that on IDEA11 it still works - i.e. as long as you compile using IDEA Javac/Javac-in-process compiler (instead of running Maven 'compile' goal) and as long as you use JUnit Runner / TestNG Runner from IDEA (instead of running Maven 'test' goal) - coverage is being refreshed correctly in both "Cloverage" view and source code editors.

            Would you be able to prepare and attach some sample project showing the problem (source files + pom.xml + .iml/.ipr/*.iws files)? It would be great to get a screen recording showing your actions in IDEA IDE too.

            Regards
            Marek

            Marek Parfianowicz added a comment - Hi Andrew, I mentioned on 1st of August that I reproduced a problem. However my further tests showed that it was due to some class clashing in IDEA debug mode. So it seems that on IDEA11 it still works - i.e. as long as you compile using IDEA Javac/Javac-in-process compiler (instead of running Maven 'compile' goal) and as long as you use JUnit Runner / TestNG Runner from IDEA (instead of running Maven 'test' goal) - coverage is being refreshed correctly in both "Cloverage" view and source code editors. Would you be able to prepare and attach some sample project showing the problem (source files + pom.xml + .iml/ .ipr/*.iws files)? It would be great to get a screen recording showing your actions in IDEA IDE too. Regards Marek

            Two more things:

            1) in the Run/Debug Configuration window, "Configuration" tab, "Before Launch" section - do you have "Make" or "Run Maven Goal" checkboxes enabled? If the "Run Maven Goal" is enabled then what goal do you run before tests?

            2) "maven-clover2-plugin is defined in the POM" - how is it configured?

            Marek Parfianowicz added a comment - Two more things: 1) in the Run/Debug Configuration window, "Configuration" tab, "Before Launch" section - do you have "Make" or "Run Maven Goal" checkboxes enabled? If the "Run Maven Goal" is enabled then what goal do you run before tests? 2) "maven-clover2-plugin is defined in the POM" - how is it configured?

            Hi Andrew,

            > via testng runner in intellij.

            I'd like to ensure: are you using TestNG or JUnit?

            Regards
            Marek

            Marek Parfianowicz added a comment - Hi Andrew, > via testng runner in intellij. I'd like to ensure: are you using TestNG or JUnit? Regards Marek

            Hi Marek,
            Sorry for the delay...I've been on vacation.

            Thanks for looking into this!

            The scenario you describe is exactly how I work: import the maven project with intellij, then run tests via testng runner in intellij.

            • maven-clover2-plugin is defined in the POM
            • com.cenqua.clover:clover is not defined in the pom.
            • "toggle build with clover" is enabled
            • clover intellij settings are not synchronized with clover maven settings

            Andrew Zimmer added a comment - Hi Marek, Sorry for the delay...I've been on vacation. Thanks for looking into this! The scenario you describe is exactly how I work: import the maven project with intellij, then run tests via testng runner in intellij. maven-clover2-plugin is defined in the POM com.cenqua.clover:clover is not defined in the pom. "toggle build with clover" is enabled clover intellij settings are not synchronized with clover maven settings

            Marek Parfianowicz added a comment - - edited

            Hello Andrew,

            At the moment, the maven plugin's clean and install work, but when I go to run a test ...

            Could you describe more precisely how do you perform your build?

            • do you import the Maven-based project (pom.xml) into IntelliJ, next open the "Maven Projects" view, right click on "clean, install" targets and choose "Run my_project [clean, install]" from context menu?
            • do you have com.atlassian.maven.plugins:maven-clover2-plugin defined in your POM?
            • do you have com.cenqua.clover:clover defined in POM?
            • do you have "Toggle build with Clover" button enabled in IntelliJ toolbar?
            • do you have Clover IntelliJ settings (File > Settings > Project Settings > Clover; initstring) synchronized somehow with Clover Maven settings (pom.xml / <plugins> / maven-clover2-plugin / <configuration> / <cloverDatabase>)?

            I have reproduced lack of code coverage in a slightly different scenario:

            • import maven-based (pom.xml) project into IntelliJ
            • set "javac-in-process" compiler in File > Settings > Compiler
            • enable "Toggle build with Clover" on toolbar
            • run unit tests using IntelliJ JUnit test runner, for example
              • right click on test class, chose "Run <MyClassTest>" option or
              • main menu > Run > Edit configurations > JUnit > ... choose test classes; next run it

            After this code coverage does not refresh and shows 0% for all classes.
            In case when "javac" compiler is used, coverage refreshes, but only for test classes (app classes still show 0%).

            Is my scenario somehow similar to yours?

            Regards
            Marek

            Marek Parfianowicz added a comment - - edited Hello Andrew, At the moment, the maven plugin's clean and install work, but when I go to run a test ... Could you describe more precisely how do you perform your build? do you import the Maven-based project (pom.xml) into IntelliJ, next open the "Maven Projects" view, right click on "clean, install" targets and choose "Run my_project [clean, install] " from context menu? do you have com.atlassian.maven.plugins:maven-clover2-plugin defined in your POM? do you have com.cenqua.clover:clover defined in POM? do you have "Toggle build with Clover" button enabled in IntelliJ toolbar? do you have Clover IntelliJ settings (File > Settings > Project Settings > Clover; initstring) synchronized somehow with Clover Maven settings (pom.xml / <plugins> / maven-clover2-plugin / <configuration> / <cloverDatabase>)? I have reproduced lack of code coverage in a slightly different scenario: import maven-based (pom.xml) project into IntelliJ set "javac-in-process" compiler in File > Settings > Compiler enable "Toggle build with Clover" on toolbar run unit tests using IntelliJ JUnit test runner, for example right click on test class, chose "Run <MyClassTest>" option or main menu > Run > Edit configurations > JUnit > ... choose test classes; next run it After this code coverage does not refresh and shows 0% for all classes. In case when "javac" compiler is used, coverage refreshes, but only for test classes (app classes still show 0%). Is my scenario somehow similar to yours? Regards Marek

            Hi Marek,
            Ah, thanks! "Jump to actual source" does indeed work!

            Andrew Zimmer added a comment - Hi Marek, Ah, thanks! "Jump to actual source" does indeed work!

            Thanks a lot, Andrew! Now I know where to look for.

            Somewhat related appears to be the fact that when I click on a compiler error in the messages tab, instead of being taken to the source code in intellij, intellij pops up with windows file system explorer, and shows me the path to the file instead of opening the source.

            Yep. It's a known bug. But when you right click, you should get a pop-up menu with an option "Jump to actual source" - this would work.

            Marek Parfianowicz added a comment - Thanks a lot, Andrew! Now I know where to look for. Somewhat related appears to be the fact that when I click on a compiler error in the messages tab, instead of being taken to the source code in intellij, intellij pops up with windows file system explorer, and shows me the path to the file instead of opening the source. Yep. It's a known bug. But when you right click, you should get a pop-up menu with an option "Jump to actual source" - this would work.

              mparfianowicz Marek Parfianowicz
              1561992a889b Andrew Zimmer
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: