Compare commits

..

No commits in common. "1be54f4ca03cf176e38e3c1db79fa750b0664058" and "b3e3a68736e8636f4548641005ad9e6c4b96f4fb" have entirely different histories.

2 changed files with 26 additions and 42 deletions

56
Jenkinsfile vendored
View File

@ -2,44 +2,28 @@ pipeline {
agent any agent any
stages { stages {
stage('Build') { stage('build') {
steps { steps {
withChecks(name: 'Test', includeStage: true) { withChecks(name: 'build', includeStage: true) {
withGradle { sh './gradlew clean testClasses'
sh """ }
./gradlew clean test jacocoTestReport jacocoTestCoverageVerification --no-daemon withChecks(name: 'unit-tests', includeStage: true) {
""" sh './gradlew test'
}
withChecks(name: 'test-coverage', includeStage: true) {
sh './gradlew jacocoTestReport jacocoTestCoverageVerification'
junit '**/build/test-results/test/TEST-*.xml'
recordCoverage(tools: [[parser: 'JACOCO']],
id: 'jacoco', name: 'JaCoCo Coverage',
sourceCodeRetention: 'EVERY_BUILD'
, qualityGates: [
[threshold: 40.0, metric: 'LINE', baseline: 'PROJECT', unstable: true],
[threshold: 40.0, metric: 'BRANCH', baseline: 'PROJECT', unstable: true]]
)
}
}
} }
recordCoverage(tools: [[parser: 'JACOCO', pattern: '**/build/reports/jacoco/test/jacoco*.xml']],
id: 'jacoco',
name: 'JaCoCo Coverage',
sourceCodeRetention: 'EVERY_BUILD',
qualityGates: [
[threshold: 40.0, metric: 'CLASS', baseline: 'PROJECT'],
[threshold: 40.0, metric: 'METHOD', baseline: 'PROJECT'],
[threshold: 40.0, metric: 'LINE', baseline: 'PROJECT'],
[threshold: 40.0, metric: 'BRANCH', baseline: 'PROJECT']])
junit testResults: '**/build/test-results/test/TEST-*.xml'
} }
} }
} // Test
stage('Reports') {
steps {
script {
// archiveArtifacts artifacts: '**/coverage-sources.zip', allowEmptyArchive: false, fingerprint: false, onlyIfSuccessful: false
publishHTML (target: [
allowMissing: true,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'app/build/reports/jacoco/test/html',
reportFiles: 'index.html',
reportName: 'Coverage Report'
])
// def pmd = scanForIssues tool: [$class: 'Pmd'], pattern: 'lib/build/reports/pmd/*.xml'
// publishIssues issues: [pmd]
}
}
} // Reports
}
}

View File

@ -39,9 +39,9 @@ jacoco {
tasks.jacocoTestReport { tasks.jacocoTestReport {
reports { reports {
xml.required.set(true) xml.required = true
csv.required.set(false) csv.required = false
html.required.set(true) html.required = false
} }
} }
@ -49,7 +49,7 @@ tasks.jacocoTestReport {
// violationRules { // violationRules {
// rule { // rule {
// limit { // limit {
// minimum = "0.2".toBigDecimal() // minimum = "0.4".toBigDecimal()
// } // }
// } // }
// //
@ -61,7 +61,7 @@ tasks.jacocoTestReport {
// limit { // limit {
// counter = "LINE" // counter = "LINE"
// value = "TOTALCOUNT" // value = "TOTALCOUNT"
// minimum = "0.3".toBigDecimal() // maximum = "0.3".toBigDecimal()
// } // }
// } // }
// } // }