Must-share information (formatted with Markdown):
- which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
- how is SonarQube deployed: zip, Docker, Helm
- what are you trying to achieve
- what have you tried so far to achieve this
Using SonarQube - 8.9
My code is JavaScript
–
in karma.js we are using sonarqubeunit reporter
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('karma-sonarqube-unit-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
browsers: ['ChromeHeadlessNoSandbox'],
coverageReporter: {
dir: require('path').join(__dirname, './coverage'),
type: 'lcov', // or 'lcovonly' to generate only lcov.info
subdir: '.', // save to the root of coverage/ folder
reporters: [
{type: 'lcov', subdir: ''},
{type: 'text-summary'}
]
},
reporters: ['progress', 'kjhtml', 'sonarqubeUnit'],
sonarQubeUnitReporter: {
sonarQubeVersion: "LATEST",
outputDir: "coverage/",
outputFile: "test-report.xml",
useBrowserName: false, // Optionally disable the browser name in the file name
overrideTestDescription: true,
prependTestFileName: "apps/portal"
},
This generates both files -
o
–
Sonar Properties -
I am passing both files -
But Unit test still remains empty -
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!