如何将XML报告集成到SonarQube数据库中?

时间:2018-04-03 08:20:22

标签: xml jenkins sonarqube maven-surefire-plugin

我需要从Surefire和Cobertura的许多工具中导入测试结果,covearage和linters。目前,我尝试使用手工制作的xml文件。

从Jenkins和XML报告中我已经配置了post action"分析sonarqube与Maven"。

我正在使用多种语言(C,Java,JS),而且每个语言都要将指标导入Sonar。目前,转换不是自动化的,因此我提供了一个类似于模拟的XML文件。

我想要的是什么:
- 在C语言中,运行单元测试和技术集成测试,
- 在JS语言中,运行单元测试,
- 在Java测试中,运行functionnal测试项目没有源代码,这只包含测试脚本。

对于这个问题,只进行C单元测试。稍后我将整合其他级别和覆盖范围,这样就可以了。我需要制定指标(针对每种类型的测试)

在使用Maven分析sonarqube时,我指定:-Dsonar.junit.reportPaths=ut/

当我建立工作时,我得到了:

[INFO] parsing [/test/tools/pic/workspace/sb_maven/ut]
[INFO] Sensor SurefireSensor [java] (done) | time=206ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=1ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=951ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=336ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=32ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=1ms
[INFO] Calculating CPD for 0 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 343ms, dir size=584 KB
[INFO] Analysis reports compressed in 194ms, zip size=262 KB
[INFO] Analysis report uploaded in 88ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://10.1.4.126:9000/sonar/dashboard/index/fr.xxxxx:xxxxx
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://10.1.4.126:9000/sonar/api/ce/task?id=AWKVT9Sz_3FNXuJjExYZ
[INFO] Task total time: 16.972 s

但声纳中没有任何内容

0 个答案:

没有答案