spatwari
(Srinidhi Patwari)
August 3, 2022, 4:38pm
1
Must-share information (formatted with Markdown ):
SonarQube : 9.5.0.56709,
Scanner version from build.gradle file : id “org.sonarqube” version “3.1.1”
Things about jacoco we have in build.gradle file :
i. Enabled jacoco plugin
ii. jacoco toolVersion = “0.8.7”
iii. jacocoTestReport also enabled
Attaching screenshot :
spatwari
(Srinidhi Patwari)
August 4, 2022, 12:09pm
4
Hi Colin thanks for ur reply
i changed version of the SonarScanner for Gradle to 3.4.0.2513
Though jenkins job is success, at the sonar side still code coverage is 0. But strange is qualitygate has PASSED though code coverage is 0.
Attaching screenshots :
Colin
(Colin)
August 8, 2022, 1:42pm
7
Hey there.
Please do not bump threads.
I would again ask this:
Colin:
Have you followed the instructions in this guide ?
And suggest you share your build.gradle file.
spatwari
(Srinidhi Patwari)
August 10, 2022, 11:29am
8
i gone through that page.
content of sonar and jacoco in my build.gradle are as below :
plugins { id “org.sonarqube” version “3.4.0.2513” }
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
jacoco {
toolVersion = “0.8.7”
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
}
project.tasks[“sonarqube”].dependsOn “jacocoTestReport”
sonarqube {
properties {
property ‘sonar.projectKey’, ‘KEY-NAME’
property ‘sonar.projectName’, 'NAME OF THE PROJECT
property “sonar.coverage.exclusions”, “/model/ ,/config/ ,/test/ ,/generated / ,/exception/ ”
property “sonar.coverage.jacoco.xmlReportPaths”, “${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml”
}
}
build.finalizedBy([“jacocoTestReport”])
spatwari
(Srinidhi Patwari)
November 4, 2022, 2:01pm
9
i need help on this colin