Name: jenkins-coverage-poster
Owner: Spotify
Description: a jenkins pipeline library for posting code coverage results
Created: 2017-04-22 23:55:02.0
Updated: 2018-05-18 10:58:41.0
Pushed: 2017-11-13 20:07:39.0
Size: 153
Language: Groovy
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Jenkins 2.0 Pipeline library for automatically posting code coverage results to GitHub pull requests.
Currently supports:
In your Jenkinsfile:
rary('github.com/spotify/jenkins-coverage-poster@1.0') _
e("Run tests") {
"mvn test"
e("Post coverage") {
stJacocoCoverage(threshold: 75)
threshold
: your code coverage must be at or above this level to get a passing scoredeltaThreshold
(optional): your code coverage must have changed by at least this much to get a passing scoredeltaThreshold: -1.0
will cause the pull request to be marked red if your changes result in a drop of more than 1% coverage (as compared to the coverage in the master branch)xmlPath
(optional): the location of the jacoco coverage xml filetarget/site/jacoco/jacoco.xml
This library uses total instruction coverage for all code coverage calculations. Note that this is different from line coverage and branch coverage.
In addition, in Jenkins there must be a defined Credential called github-user-token
, containing as password a valid GitHub api token. The Credential username can be anything, as it is not used. The token's permissions must allow read access to repositories and posting comments to pull requests at minimum.
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.