Compare commits

..

No commits in common. "b6a73fb3e2e26c7405d1117100c3a559916068e6" and "9ec20b53e34bf95ec1405c0f2eaebfc8d58399ec" have entirely different histories.

3 changed files with 36 additions and 60 deletions

53
Jenkinsfile vendored
View File

@ -2,45 +2,22 @@ pipeline {
agent any agent any
stages { stages {
stage('Build') { stage('build') {
steps { steps {
withChecks(name: 'Test', includeStage: true) { withChecks(name: 'test-coverage', includeStage: true) {
withGradle { sh './gradlew clean test jacocoTestReport jacocoTestCoverageVerification'
sh """ junit '**/build/test-results/test/TEST-*.xml'
./gradlew clean test jacocoTestReport jacocoTestCoverageVerification --no-daemon recordCoverage(tools: [[parser: 'JACOCO']],
""" id: 'jacoco', name: 'JaCoCo Coverage',
} sourceCodeRetention: 'EVERY_BUILD'
recordCoverage(tools: [[parser: 'JACOCO', pattern: '**/build/reports/jacoco/test/jacoco*.xml']], // , qualityGates: [
id: 'jacoco', // [threshold: 40.0, metric: 'LINE', baseline: 'PROJECT', unstable: true],
name: 'JaCoCo Coverage', // [threshold: 40.0, metric: 'BRANCH', baseline: 'PROJECT', unstable: true]]
sourceCodeRetention: 'EVERY_BUILD', )
qualityGates: [
[threshold: 40.0, metric: 'CLASS', baseline: 'PROJECT', unstable: true],
[threshold: 40.0, metric: 'METHOD', baseline: 'PROJECT', unstable: true],
[threshold: 40.0, metric: 'LINE', baseline: 'PROJECT', unstable: true],
[threshold: 40.0, metric: 'INSTRUCTION', baseline: 'PROJECT', unstable: true],
[threshold: 40.0, metric: 'BRANCH', baseline: 'PROJECT', unstable: true]])
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

@ -1 +0,0 @@
[SIMPLE TEST FOR JENKINS]

View File

@ -45,27 +45,27 @@ tasks.jacocoTestReport {
} }
} }
//tasks.jacocoTestCoverageVerification { tasks.jacocoTestCoverageVerification {
// violationRules { violationRules {
// rule { rule {
// limit { limit {
// minimum = "0.2".toBigDecimal() minimum = "0.4".toBigDecimal()
// } }
// } }
//
// rule { rule {
// isEnabled = false isEnabled = true
// element = "CLASS" element = "CLASS"
// includes = listOf("jenkins.test.*") includes = listOf("jenkins.test.*")
//
// limit { limit {
// counter = "LINE" counter = "LINE"
// value = "TOTALCOUNT" value = "TOTALCOUNT"
// minimum = "0.3".toBigDecimal() minimum = "0.3".toBigDecimal()
// } }
// } }
// } }
//} }
application { application {
// Define the main class for the application. // Define the main class for the application.