У меня есть проект AngularJs, в котором я написал свои тесты. Обратите внимание, что я выполняю свою команду локально через командную строку. Я успешно выполнил свои тестовые случаи и сгенерировал отчет, используя junitReporter. Также я успешно сгенерировал покрытие кода с помощью файла lcov.info. Подскажите, пожалуйста, как загрузить мои тестовые примеры на версию sonar server 7.5. У меня всего 24 юнит-теста, и я хочу загрузить в введите описание изображения здесь sonarqube server
I have tried with below code and it it successfully executed but no unit test cases uploaded.
Step1:
C:\sonar-scanner-msbuild-4.5.0\SonarQube.Scanner.MSBuild.exe begin /k:"DevopsReporting" /n:"DevopsReporting" /v:"1.0" /d:sonar.test.inclusions=**/test/**/* /d:sonar.exclusions=**/app/lib/**/*,**/test/**/*, /d:sonar.javascript.karmajstestdriver.reportsPath=C:\Projects\Dev\Products\DevOps\DevOpsReporting\Main\DevOpsReporting\reports\coverage\TESTS-xunit.xml
Step2:
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /t:Rebuild
Step3:
C:\sonar-scanner-msbuild-4.5.0\SonarQube.Scanner.MSBuild.exe end
File1: testunit.xml --> Unit test cases executed and generated reports.
<?xml version="1.0"?>
<testsuite name="Chrome 71.0.3578 (Windows 10.0.0)" package="" timestamp="2019-01-22T05:00:04" id="0" hostname="CRWMXL44218Y5" tests="24" errors="0" failures="0" time="0.518">
<properties>
<property name="browser.fullName" value="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"/>
</properties>
<testcase name="js:developerSummaryController controller should not be null" time="0.355" classname="js:DevOpsReporting/app/partials/developerSummaryController"/>
<testcase name="js:developerSummaryController should call the service method and check the correct routeparam is passed or not" time="0.025" classname="js:DevOpsReporting/app/partials/developerSummaryController"/>
<testcase name="js:ExecutiveController sanity test" time="0.003" classname="js:DevOpsReporting/app/partials/ExecutiveController"/>
<testcase name="js:ExecutiveController should call the service method" time="0.004" classname="js:DevOpsReporting/app/partials/ExecutiveController"/>
<testcase name="js:ExecutiveController should scroll to group" time="0.004" classname="js:DevOpsReporting/app/partials/ExecutiveController"/>
<testcase name="js:config should have string properties" time="0.001" classname="js:DevOpsReporting/app/js/config"/>
<testcase name="service:developerSummaryService should have required functions" time="0.004" classname="service:DevOpsReporting/app/js/services/developerSummaryService"/>
<testcase name="service:developerSummaryService should be able to get summary data" time="0.007" classname="service:DevOpsReporting/app/js/services/developerSummaryService"/>
<testcase name="service:deploymentDetailsService shoould have required methods" time="0.003" classname="service:DevOpsReporting/app/js/services/deploymentDetailsService"/>
<testcase name="service:componentDetailsService should have required functions" time="0.003" classname="service:DevOpsReporting/app/js/services/componentDetailsService"/>
<testcase name="service:componentDetailsService should be able to get component details data" time="0.006" classname="service:DevOpsReporting/app/js/services/componentDetailsService"/>
<testcase name="service:executiveService should have required functions" time="0.005" classname="service:DevOpsReporting/app/js/services/executiveService"/>
<testcase name="service:executiveService should be able to get dashboard data" time="0.004" classname="service:DevOpsReporting/app/js/services/executiveService"/>
<testcase name="service:groupService should have required functions" time="0.024" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to get list of groups" time="0.011" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to get components and projects" time="0.008" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to map components and projects" time="0.005" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to unmap components and projects" time="0.005" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to add new group" time="0.007" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to rename group" time="0.005" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:groupService should be able to delete group" time="0.005" classname="service:DevOpsReporting/app/js/services/groupService"/>
<testcase name="service:devopsReportingService should have required functions" time="0.013" classname="service:DevOpsReporting/app/js/services/devopsReportingService"/>
<testcase name="service:devopsReportingService should return correct response for getBuildStatus" time="0.007" classname="service:DevOpsReporting/app/js/services/devopsReportingService"/>
<testcase name="service:devopsReportingService should return correct response for getBuildStatusById" time="0.004" classname="service:DevOpsReporting/app/js/services/devopsReportingService"/>
<system-out>
<!\[CDATA\[
\]\]>
</system-out>
<system-err/>
</testsuite>
I want my 24 unit test cases uploaded on sonarqube server.
В свойствах сонара я также добавил строку ниже.
sonar.javascript.lcov.reportPaths = C: /Projects/Dev/Products/DevOps/DevOpsReporting/Main/DevOpsReporting/reports/coverage/lcov.info
sonar.javascript.karmajstestdriver.reportsPath = C: /Projects/Dev/Products/DevOps/DevOpsReporting/Main/DevOpsReporting/reports/coverage/TESTS-xunit.xml
\[enter image description here\]\[1\]
\[1\]: https://i.stack.imgur.com/ZEr0l.png][1]