我有以下問題與SonarRunner。JavaScript的單元測試不適用於SonarQube
SonarQube隨着聲納亞軍無法拉的JUnit格式的XML報告
單元測試或測試覆蓋率小部件不顯示。它說沒有數據。 我按照說明的說明here
我手動創建了XML格式的報告文件,但仍然沒有運氣。
下面是XML文件 - TEST-Firefox_210_Mac_OS.com.company.BarTest.xml,
<testsuite name="Firefox_210_Mac_OS.com.company.BarTest" errors="0" failures="0" tests="3" time="0.0">
<testcase classname="Firefox_210_Mac_OS.com.company.BarTest" name="testfullName" time="0.0"/>
</testsuite>
拉單元測試執行報告顯示聲納儀表板。我從here
用樣品Git項目和下面是我的sonar-project.properties,
# project metadata (required)
sonar.projectKey=org.codehaus.sonar:javascript-sonar-runner-jstestdriver
sonar.projectName=JavaScript project with Sonar Runner reusing reports generated by JsTestDriver
sonar.projectVersion=1.0
# path to source directories (required)
sonar.sources=C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/sources
# path to tests source directories (required)
sonar.tests=C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/tests
sonar.javascript.jstestdriver.reportsPath=C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/target/TEST-Firefox_210_Mac_OS.com.company.BarTest.xml
sonar.sourceEncoding=UTF-8
下面
是我jsTestDriver.conf
server: http://localhost:9876
load:
- C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/sources/*.js
- C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/sources/com/company/*.js
test:
- C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/tests/*.js
- C:/Sonar/sonar-runner-dist-2.4/sonar-runner-2.4/projects/tests/com/company/*.js
plugin:
- name: "coverage"
jar: "coverage-1.3.5.jar"
module: "com.google.jstestdriver.coverage.CoverageModule"
我sonarqube運行在端口上:9000及以下是屏幕截圖。正如你看到的SonarRunner和jsTestDriver 只是做一個代碼分析,並沒有顯示任何單元測試。
的SonarQube文檔網站說,沒有那種關於JS的 - 測試驅動器。它只是說它會導入js-test-driver的報告。 –
謝謝。編輯我的帖子。 – rajcool111
我是否缺少任何插件?什麼插件需要閱讀這份報告? – rajcool111