cobertura

Configure cobertura to ignore certain blocks of code

五迷三道 提交于 2019-12-23 11:39:08
问题 Is it possible using Cobertura to tell it to ignore certain bits of code that are identified by start and end comments? For example, public class Foo { public void static doSomething() { ... // Cobertura-Ignore-Start ... // Cobertura-Ignore-End } would result in Cobertura not including the code in between the start and end comments when calculating coverage statistics. Edit : I am using the cobertura Ant task. 回答1: No, it's not possible. Cobertura does not have a feature that lets it skip

How do I configure when cobertura tests run in maven-cobertura-plugin?

大城市里の小女人 提交于 2019-12-23 07:59:07
问题 In order to fine-tune which tests are run at which times and in which environments, we have several executions set up for the maven-surefire-plugin. We set the default configuration to skip all tests, then enable them for the executions we want. This by itself works well for us. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> <executions> <execution> <id>unit-tests</id> <phase>test</phase>

Increasing permgen space for Cobertura ant task running from Gradle

别等时光非礼了梦想. 提交于 2019-12-23 03:56:05
问题 I'm getting the following trying to run Cobertura as part of my Gradle build. :cobertura Instrumenting classes for Cobertura Exception in thread "Test worker" java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space I've tried bumping up DEFAULT_JVM_OPTS / -XX:MaxPermSize in my gradle wrapper script, to no effect. Is there a more direct (and effective) way to do this? 回答1: The only thing that worked for me was changing the .bashrc on my Linux box to have export

Why does Cobertura report 0% coverage when run through the Eclipse plugin?

狂风中的少年 提交于 2019-12-22 08:43:57
问题 (There are a tonne of these questions, but all the ones I can find relate to Maven. Before you suggest this one is a duplicate, please understand that this doesn't relate to Maven in any way.) I am using Cobertura within Eclipse to determine my percentage of code covered by my JUnit tests. All 99 of my unit tests run successfully, both within and outside of Cobertura, but Cobertura reports back that they have covered 0% of my code. I : am running Cobertura through the Eclipse plugin am using

SonarQube Analysis not showing code coverage

房东的猫 提交于 2019-12-20 05:02:03
问题 I have a Jenkins project to do SonarQube analysis of my NodeJS project. I added istanbul as a dependency to my project's package.json . In the Jenkins build configuration, first I run a shell script: cd ./project-name npm install node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha path-to-unit-tests node_modules/.bin/istanbul report cobertura cd .. This installs the dependencies, runs the tests and generates a code coverage report and generates a cobertura-coverage.xml file. After the

Maven cobertura plugin - one report for multimodule project

橙三吉。 提交于 2019-12-19 01:05:51
问题 I'm using maven cobertura plugin to report code coverage in my multimodule project. The problem is that I don't know how to generate one report for all modules in project. So far I have generated separate reports for every module, but it would be nice to have one report for whole project. My parent pom configuration: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.4</version> <inherited>true</inherited> <executions> <execution> <phase

running junits and cobertura with maven

人盡茶涼 提交于 2019-12-17 16:16:37
问题 In our project, we run both junits and cobertura using maven. The problem I am facing is that, junit test cases are running twice, once before the jar creation process and then once again for generating cobertura coverage reports. When running cobertura and junits with ant, we run junits only once since, cobertura runs along with junits. Is there a way to configure the above case with maven. I know we can use "maven.test.skip" property to skip junits. But when I do this, I am not able to see

Is the surefire's forkMode 'never' working with cobertura under Maven 3?

◇◆丶佛笑我妖孽 提交于 2019-12-14 02:44:04
问题 After switching from maven 2 to maven 3 I have found out having 0% test coverage reported by cobertura. I've stated question about which versions of cobertura and surefire to use: What versions of cobertura and surefire plugins work together under maven3? I have, however, investigated problem deeper and found out what of configuration fragment was not working: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire.plugin.version

Maven Cobertura OutOfMemoryError

送分小仙女□ 提交于 2019-12-14 00:44:49
问题 I am using Maven site:run to generate a cobertura code coverage... The following is my pom.xml configuration for cobertura: <reporting> ... <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.3</version> </plugin> </plugins> </reporting> However I am getting OutOfMemoryError at the end of the site:run. Please suggest how to get rid of this error. (I have tried all those -Xmx, -XX options...) Exception in thread "Thread-0" java

How to run cobertura code coverage for few test classes not all of my test classes?

烂漫一生 提交于 2019-12-13 21:15:38
问题 I am using Cobertura in eclipse to generate the code coverage for my java maven project and it works fine. I have around 15 tests classes. Whenever I am running maven build, it generates code coverage for all those 15 classes. Is there any way, I can run cobertura code coverage report for few of my test classess instead of all the test classes? I also have AllTests in which I have mentioned only few of my test classes but I guess cobertura doesn't use AllTests . 回答1: If you are using the