Technology : Angularjs, sonarqube, Lcov reporter, karma runner,
We have migrated the sonarqube. With earlier sonarqube, the coverage percentage and total number of test cases was displayed in sonarqube using same configuration. But after migrating to new sonar the total number of test cases are not displayed although coverage percentage is shown.
I understand the coverage percentage and total number of test cases should be taken from same lcov file. If coverage percentage is taken from lcov then not sure what is missing to take total number of cases. Please suggest.
karma.conf.js (coverage related configuration)
plugins: [
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher'
],
preprocessors: {
'project/ui/app/**/*.js': ['coverage'],
},
reporters: ['progress', 'coverage'],
coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
{type: 'lcov', subdir: 'report-lcov'}
]
},
sonar related properties in build.gradle
sonarqube {
def sonar_host = System.getenv("SONAR_HOST")
def sonar_login = System.getenv("SONAR_LOGIN")
def sonar_project_key = System.getenv("SONAR_PROJECT_KEY")
properties {
println "SONAR_HOST $sonar_host"
println "SONAR_LOGIN $sonar_login"
property 'sonar.host.url', "${sonar_host}"
property 'sonar.login', "${sonar_login}"
property 'sonar.projectKey', "${sonar_project_key}"
property 'sonar.projectName', "${sonar_project_key}"
property 'sonar.projectVersion', "${pVersion}"
property 'sonar.language', 'js'
property 'sonar.sources', 'project/ui/app'
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.exclusions', 'excluded js files'
property 'sonar.test.inclusions', '**/*.spec.js'
property 'sonar.javascript.lcov.reportPaths', 'build/reports/coverage/report-lcov/lcov.info'
property 'sonar.verbose', 'true'
property 'sonar.log.level', 'DEBUG'
}
}