简体   繁体   中英

SonarQube Unit Tests from Jenkins not showing

I am running SonarQube 4.2 and am initiating a multiproject (mostly JavaScript) analysis from Jenkins. I am not getting any data on my unit tests though - these are generated with Intern/Istanbul and output to a Junit format. There are no errors in the logs. I know the report format is good because it displays fine in Jenkins

My configuration is:

sonar.projectKey=${JOB_ID}:${JOB_ID}
sonar.projectName=${JOB_ID}
sonar.projectVersion=${BUILD_NUMBER}

sonar.verbose=true

sonar.dynamicAnalysis=reuseReports
sonar.junit.reportsPath=reports/unit
sonar.js.coveragePlugin=cobertura
sonar.cobertura.reportsPath=reports/coverage

sonar.sources=src
sonar.tests=tests

You are missing some properties, this are the property sonar uses to find the tests, the results and the jacoco plugin.

sonar.tests=test
sonar.junit.reportsPath=build/test-results
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPath=build/jacoco/test.exec

where test-results is where the results of your tests go, you need to execute your tests with gradle or ant or maven first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM