IntelliJ 12 code coverage does not work in the editor for GWT projects

I am trying IntelliJ 12 and I cannot get the line color (red, green, yellow) in the editors after running the tests with coverage. Has anyone noticed a problem, or just I could not get it to work?

+7
source share
3 answers

Finally, I found out that led to IntelliJ IDEA 12.0.0 (as well as 12.0.1) breaking code coverage.

My project is a GWT project, so there is an additional configuration for running gwt client tests: the source directories are added to the class path, so gwt devmode can be run headless for testing:

<build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.5</version> <configuration> <additionalClasspathElements> <!-- the following two lines, causes intellij coverage to stop working --> <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement> <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement> </additionalClasspathElements> </configuration> </plugin> </plugins> </build> 

Adding source folders to the surefire class path causes IntelliJ IDEA 12.x to configure the project ( .iml file) .iml and the coverage stops working.

Note that this maven configuration has no effect on IntelliJ IDEA 11.x, which works fine.

To reproduce the error, simply add <additionalClasspathElement> to your confident configuration, then right-click on your project and execute "Maven β†’ Reimport", then run the tests with coverage; and you will see that the editor skips all the information about the coverage of the lines.

I was able to reproduce the problem and I will send an error report.

A workaround would be to comment out the two lines of <additionalClasspathElement> and make "Maven - <additionalClasspathElement> Reimport" and then uncomment them if you need to.

Reported error IDEA-97920 , it will be fixed in 12.0.2

+3
source

By default, code coverage results are displayed only in the left gutter and can be difficult to notice:

coverage displayed in gutter

You can change the colors of the gutter or configure IntelliJ IDEA to change the background of all the lines (instead of the foreground) depending on their coverage status:

coverage background settings

Now it’s much easier to see the status of coverage:

coverage displayed as background

+7
source

I am using IntelliJ 13 on a Mac with a Darcula theme.

At first I did not notice the green / red colors, as they are very boring and do not stand out against a black background.

However, if you look closely in the left field to the left of line numbers (if you configured them), you will see them weakly.

You can easily adjust the colors to make them more visible.

The default value should be changed by IntelliJ in a future version.

+1
source

All Articles