Compare commits

..

10 Commits

Author SHA1 Message Date
b6a73fb3e2
add withChecks into pipeline
All checks were successful
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test / Build passed: 1
2025-02-20 08:07:00 +00:00
4f783e4719
add withChecks into pipeline
All checks were successful
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test / Build passed: 1
2025-02-20 07:52:42 +00:00
1be54f4ca0 add withChecks into pipeline
All checks were successful
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test / Build passed: 1
2025-02-20 07:28:15 +00:00
5ee039ba1b add withChecks into pipeline
All checks were successful
Jacoco Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test / Build passed: 1
2025-02-20 07:26:16 +00:00
5c649f3481 add withChecks into pipeline
All checks were successful
Jacoco Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test passed: 1
2025-02-20 07:07:26 +00:00
0f83b57066 add withChecks into pipeline
Some checks are pending
build
test-coverage
Tests / Post passed: 1
Jacoco Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Test passed: 1
2025-02-20 06:40:07 +00:00
137ab417ec add withChecks into pipeline
Some checks are pending
jacoco-coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary No active quality gates.
build
test-coverage
Jacoco Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary Overall result: Success Output truncated.
Tests / Post passed: 1
2025-02-19 15:56:55 +00:00
260354a009 add withChecks into pipeline
Some checks failed
test-coverage / build occurred while executing withChecks step.
2025-02-19 15:53:23 +00:00
407bc6311c add withChecks into pipeline
Some checks are pending
test-coverage / build
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 50.00% (2/4) * Lines of Code: 4 * Cyclomatic Complexity: 3 #### Quality Gates Summary No active quality gates.
2025-02-19 15:43:41 +00:00
39a361ec41 add withChecks into pipeline 2025-02-19 15:39:04 +00:00
3 changed files with 60 additions and 36 deletions

53
Jenkinsfile vendored
View File

@ -2,22 +2,45 @@ pipeline {
agent any
stages {
stage('build') {
stage('Build') {
steps {
withChecks(name: 'test-coverage', includeStage: true) {
sh './gradlew clean test 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]]
)
}
}
}
withChecks(name: 'Test', includeStage: true) {
withGradle {
sh """
./gradlew clean test jacocoTestReport jacocoTestCoverageVerification --no-daemon
"""
}
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', 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

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

View File

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