-
Bug
-
Resolution: Cannot Reproduce
-
Highest
-
3.1.0, 3.1.1
-
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 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.
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?
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
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
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.
Also, the locations where source is being looked for isn't correct. I have my files on D:/ on an SSD drive, but for some reason intellij is looking for my sources in this AppData/Local location on my spinning drive when I have clover turned on with in-memory compiler.
Here's one of the > 100 compiler errors I get:
/C:/Users/andrew/AppData/Local/Temp/SequeL305043954020666082SequeL/ProjectPlanFromPassTest.java:31: cannot find symbol
symbol : class AbstractPass
location: class org.broadinstitute.sequel.test.entity.project.ProjectPlanFromPassTest
Will do. At the moment, the maven plugin's clean and install work, but when I go to run a test, the "Make" thing shows up at the bottom of the intellij window. So post-maven, intellij thinks it needs to recompile the project, and then the trouble starts.
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.
Hi Andrew,
Could you give more details what kind of compiler errors you have? And attach some code samples/build logs?
As I wrote before, I don't see any such behaviour...
Regards
Marek
Hi Andrew,
Could you give more details what kind of compiler errors you have? And attach some code
samples/build logs? I was testing Clover with IDEA 11.x on Windows7 box as well and it worked correctly.
By the way:
The only problem I saw was when I was running IDEA on different Java version than SDK used for project build. For example:
- IDEA is running on JRE1.7
- project settings SDK = 1.6
- run configuration for unit tests - default settings
Code compiled successfully, but there was JUnit error of course, like below:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Main : Unsupported major.minor version 51.0
This is correct, because code was compiled using Java7. In order to fix it it's necessary to add "-target 1.6" in Java Compiler settings tab. Or enable "Use alternative JRE" in run configuration. Did you have the same case?
Regards
Marek
I have recently switched back to a windows 7 box for development, and this problem exists for win7. In-memory compiler results in a ton of compiler errors, now, however, when clover is enabled. Disabling clover or switching back to plain old javac works just fine, though.
This bug is located in the IntelliJ IDEA - it does not call custom source code instrumenters correctly when the "Javac in-process" option is used. This bug occurs in IDEA 10.5.x series. It seems that JetBrains team have fixed it in IDEA 11.x. I have tested Clover with IDEA 11.0.2 and 11.1.2 and it works correctly in both "javac" and "javac in-process" modes.
Solution:
- use javac option only or
- upgrade to IDEA 11.x
I can confirm, this happens, when Javac-in-process-compiler is selected. Using Javac works.
I am using Debian, so this bug has nothing to do with osx.
Hi Folks,
Just checking up on this. Is there any progress on using the "Javac in-process" compiler?
I just confirmed this, at least in 10.0.3. Standard Javac works, but Javac in-process compiler doesn't.
This seems to be related to intellij's compiler option. In 10.0.3, if I use standard "Javac" is the compiler in intellij, things work. If I switch to "Javac in-process", code coverage is always empty.
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!