cobertura-plugin | Jenkins cobertura plugin | Plugin library
kandi X-RAY | cobertura-plugin Summary
kandi X-RAY | cobertura-plugin Summary
This plugin allows you to capture code coverage report from Cobertura. Jenkins will generate the trend report of coverage.The Cobertura plugin can be downloaded here.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sets the coverage report
- Recover auto update targets
- Sets all the coverage targets
- Updates the new percentage percent fields in the CoverageResult
- Processes the start tag
- Recursively descend through the coverage
- Parse a method argument
- Builds a method name from a method signature
- Gets the coverage metric with null values
- Get all coverage data in the dashboard
- Get the parents
- Checks if the chartable graph should be zoomed or not
- Receive notification of the coverage
- Determines the maximum number of builds that should be logged in
- Get the coverage tree elements
- Gets the source file content
- Returns the relative url of this coverage result
- Get the children
- End an element
- Get the total coverage data
- Parses the list of targets from the form data
- Gets the collection of targets
- Get the coverage of a project
- Get the health report
- Sets the targets
- Run the coverage map
cobertura-plugin Key Features
cobertura-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on cobertura-plugin
QUESTION
when I run my tests in Intellij idea choosing code coverage tool as JaCoCo and include my packages I see I get 80% above coverage in the report but when I run it using maven command line I get 0% in JaCoCo report below are two questions.
can I see what command Intellij Idea Ultimate version is using to run my unit tests with code coverage ?
Why my maven command mvn clean test jacoco:report is showing my coverage percentage as 0%.
This is a Scala maven project.
My POM.xml file:-
...ANSWER
Answered 2021-Feb-03 at 22:16Assuming that you are using JaCoCo with cobertura coverage you need to declare the dependencies and the plugin to run the command mvn cobertura:cobertura
.
QUESTION
I have large c++ application with complex directory structure. Structure is so deep that code repository can't be stored in Jenkins workspace, but is some root directory, otherwise build fails since path length limit is busted.
Now since application is tested in different environments, test application is run in diffrent machine. Application and all resources are compressed and copied to test machine where tests are run using OpenCppCoverage
and as a result Cobertura xml is produced.
Now since source code is needed to show covarage result xml is copied back to build machine and then feed to Jenkins Cobertura plugin.
ProblemCoverage reports shows only percent results for module or source code. Code content is not show, but this error message is show:
SourceSource code is unavailable. Some possible reasons are:
- This is not the most recent build (to save on disk space, this plugin only keeps the most recent build’s source code).
- Cobertura found the source code but did not provide enough information to locate the source code.
- Cobertura could not find the source code, so this plugin has no hope of finding it.
- You do not have sufficient permissions to view this file.
Now I've found this SO answear which is promising:
The output xml file has to be in the same folder as where
...coverage
is run, so:
ANSWER
Answered 2020-Jan-31 at 13:28Ok I've found reasons why I had a problems with this plugin.
xml from
openCppCoverage
is just correct. No changes are needed here to make it work (as far as sources are there where pdb file points to). Sources outside Jenkins workspace are not the problem here. When I copied executable from build machine to test machine, then run tests withopenCppCoverage
and copied result back to build machine it is just fine.In job configuration any user which supposed to view code coverage has to have access to
Job/workspace
in security section. In my case I've enabled this for all logged in users. This covers last bullet point of error message.Most important thing: build must be successful. I mean form beginning to the end. Doesn't meter if step containing call to cobertura plugin was successful. If any step (even in the future step) fails then cobertura will not show code for this coverage run. In my case build job was failing since one of tests was timing out. This was caused by
openCppCoverage
overhead which slows down tests by factor3
. My script was detecting timeout and killing one of tests.
I discovered that not successful build was a problem by accident. During experiments I noticed two cases when cobertura has shown source code:
- I've rerun job and removed all steps but one responsible for publishing coloratura results
- I run whole job such way it run a single test case which passed
Not sowing coverage if build is not successful is reasonable (if test failed then most probably wrong branch of code has been taken), but UI should indicate that in different way.
ConclusionThis is great example how it is important to report errors to user with precise details what went wrong and why. I wasted at least whole weak to figure out what is actually wrong which bullet point of error message is actually my case. In fact error message from plugin doesn't cover all reasons of not showing the code.
I will file report that plugin should give better explanation what went wrong.
QUESTION
I'm having currently a problem with grails 3.3.9. Here is my code:
...ANSWER
Answered 2019-Feb-18 at 11:01I was able to find why I couldn't upload any files: In my file Resources.groovy, I had :
QUESTION
Testing with a basic hello world class and cannot get past this error. The only class it is analyzing is a simple HelloWorld class. Currently using my company's sonar instance, last resort will install a local instance to test with.
Other instances of this issue online discuss a version issue but I think I am up to date. I'm not sure where all the plugin versions come from but no one else in the company has this issue so I figure it must be local somehow. Happy to provide any extra details.
Error
...ANSWER
Answered 2018-Jul-20 at 13:31My JAVA_HOME was set to use Java10, forcing maven to use Java8 resolved the issue.
QUESTION
I am trying to use the Gradle Cobertura Plugin as a code coverage tool on my Springboot application. The application is mostly Java backend but does consist of some groovy code.
I am using Java 1.8.0_152, Gradle 4.4, the gradle cobertura 2.5.4 Plugin, and springboot version 2.0.0.RC1.
Although I am running into the issue of that when instrumentation trys to occur it throws a
...ANSWER
Answered 2018-Mar-09 at 22:55Cobertura does not currently support Java 1.8.
cobertura-maven-plugin does not support Java 1.8 properly #21
ParseException JavaNCSS got an error while parsing the java file #176
The latter has been an issue since 2014, so I don't expect it to ever be fixed.
JaCoCo might suit your needs.
QUESTION
The project is based on PetClinic . The data connects from the HANA DB and it works fine(creating tables,insert data).When I do Maven Install I am getting the following error where I am not using MongoDB. How to exclude/resolve this this.
Trace:
...ANSWER
Answered 2018-Feb-10 at 17:29Your test is causing the issue. You are trying to scan the Spring packages which contains a lot of Autoconfiguration
and other Configuration
classes which the context is trying to load. You should never do this.
All you should need to do for your test is this add
QUESTION
I am trying to use apache-aven to produce a code-coverage report for my Java/Groovy project. Attached is the pom file:
...ANSWER
Answered 2017-Feb-12 at 19:55The Cobertura Maven Plugin doesn't provide a way to customize the location of the sources. By default, it then looks into the Maven standard folder, which is src/main/java
. Since your Groovy classes are located inside src/main/groovy
, they are not found.
There are 2 solutions depending on your project:
Add those sources to the project with the help of the
build-helper-maven-plugin:add-source
Mojo:
QUESTION
I'm working on a multiple projects gradle project and the main build.gradle
is like this:
ANSWER
Answered 2017-Jan-23 at 12:29Just like the error message tells you.
You have declared a dependency on net.sourceforge.cobertura:cobertura:2.0.3
in your root project (as it is not added explicitly, I'd guess the Gradle cobertura plugin adds it implicitly, its documentation should probably tell so) but you do not have any repository defined for your root project. You only declared repositories for the buildscript (to resolve Gradle plugins and stuff) and for all sub-projects in the subprojects
closure. Define the repository also for the root project, either separately, or by using allprojects
closure and your build should work fine, at least in this regard.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cobertura-plugin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page