Skip to content

Commit

Permalink
Add a better coverage Jenkinsfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Sep 23, 2021
1 parent be603bc commit 62bbc7e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
31 changes: 26 additions & 5 deletions etc/Jenkinsfile.coverage
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
node {
node('java11-agent') {
stage ('Checkout') {
checkout scm
}

stage ('Coverage') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh "mvn -V -U -e jacoco:prepare-agent test jacoco:report -Djenkins.test.timeout=240 -Dmaven.test.failure.ignore"
stage ('Git mining') {
discoverGitReferenceBuild()
mineRepository()
}

stage ('Build, Test, and Static Analysis') {
withMaven(mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh 'mvn -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip'
}
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]

recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
recordIssues tool: errorProne(), healthy: 1, unhealthy: 20

junit testResults: '**/target/*-reports/TEST-*.xml'
publishCoverage adapters: [jacocoAdapter('**/*/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_ALL_BUILD')

recordIssues tools: [checkStyle(pattern: 'target/checkstyle-result.xml'),
spotBugs(pattern: 'target/spotbugsXml.xml'),
pmdParser(pattern: 'target/pmd.xml'),
cpd(pattern: 'target/cpd.xml'),
taskScanner(highTags:'FIXME', normalTags:'TODO', includePattern: '**/*.java', excludePattern: 'target/**/*')],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
}

stage ('Collect Maven Warnings') {
recordIssues tool: mavenConsole()
}
}
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 62bbc7e

Please sign in to comment.