From b3e3a68736e8636f4548641005ad9e6c4b96f4fb Mon Sep 17 00:00:00 2001 From: bQUARKz Date: Wed, 19 Feb 2025 14:38:25 +0000 Subject: [PATCH] add withChecks into pipeline --- Jenkinsfile | 6 +++--- app/build.gradle.kts | 46 ++++++++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e26b6da..41bdb6d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,9 +16,9 @@ pipeline { recordCoverage(tools: [[parser: 'JACOCO']], id: 'jacoco', name: 'JaCoCo Coverage', sourceCodeRetention: 'EVERY_BUILD' -// , qualityGates: [ -// [threshold: 60.0, metric: 'LINE', baseline: 'PROJECT', unstable: true], -// [threshold: 60.0, metric: 'BRANCH', baseline: 'PROJECT', unstable: true]] + , qualityGates: [ + [threshold: 40.0, metric: 'LINE', baseline: 'PROJECT', unstable: true], + [threshold: 40.0, metric: 'BRANCH', baseline: 'PROJECT', unstable: true]] ) } } diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1cb54dd..f287f99 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -37,28 +37,36 @@ jacoco { toolVersion = "0.8.12" } -tasks.jacocoTestCoverageVerification { - violationRules { - rule { - limit { - minimum = "0.4".toBigDecimal() - } - } - - rule { - isEnabled = false - element = "CLASS" - includes = listOf("jenkins.test.*") - - limit { - counter = "LINE" - value = "TOTALCOUNT" - maximum = "0.3".toBigDecimal() - } - } +tasks.jacocoTestReport { + reports { + xml.required = true + csv.required = false + html.required = false } } +//tasks.jacocoTestCoverageVerification { +// violationRules { +// rule { +// limit { +// minimum = "0.4".toBigDecimal() +// } +// } +// +// rule { +// isEnabled = false +// element = "CLASS" +// includes = listOf("jenkins.test.*") +// +// limit { +// counter = "LINE" +// value = "TOTALCOUNT" +// maximum = "0.3".toBigDecimal() +// } +// } +// } +//} + application { // Define the main class for the application. mainClass.set("jenkins.test.App")