向SonarQube发布Slather报告

向SonarQube发布Slather报告,sonarqube,fastlane,slather,Sonarqube,Fastlane,Slather,我正在使用Fastlane构建和测试我的ObjC项目。我使用scan操作运行单元测试用例,使用slather操作生成代码覆盖率报告。 我能够使用slather操作生成cobertura.xml报告,但无法将报告发布到SonarQube 我使用的是SonarQube 6.4和fastlane 2.64.0 FastFile scan( workspace: "Sample.xcworkspace", scheme: "SampleTests", code_coverage: true, outpu

我正在使用Fastlane构建和测试我的ObjC项目。我使用scan操作运行单元测试用例,使用slather操作生成代码覆盖率报告。 我能够使用slather操作生成cobertura.xml报告,但无法将报告发布到SonarQube

我使用的是SonarQube 6.4和fastlane 2.64.0

FastFile

scan(
workspace: "Sample.xcworkspace",
scheme: "SampleTests",
code_coverage: true,
output_types: "html"
)
slather(
cobertura_xml: true,
output_directory: "./reports",
proj: "Sample.xcodeproj",
workspace: "Sample.xcworkspace",
scheme: "SampleTests",
)
sonar

分析已发布到Sonar,但代码覆盖率报告未更新。请告诉我我在哪里找不到关键点。

从您对问题的评论来看,您似乎还没有尝试配置报告的路径,因此自然不会导入覆盖率数据。分析无法凭直觉判断报告的位置,也无法判断报告是否应该读取


话虽如此,您还指出您正在生成一个
cobertura.xml
文件,但这不是其中一种格式。因此,您需要将覆盖率数据输入,然后使用
sonar.coverageReportPaths
分析属性包含该报告的路径。

SonarQube日志中是否有任何错误消息?否。SonarQube中没有生成任何日志。sonar-project.properties中是否有要添加的字段,用于将代码覆盖率报告发布到SonarQubeThanks以获得有价值的输入。由于SonarQube不支持cobertura,我在fastlane中将其替换为gcovr。但使用gcovr生成的报告的代码覆盖率为0%。fastlane gcovr中的代码(html:true,html\u details:true,输出:“./Code coverage/report.html”)跟随站点:运行bash-xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcsresult/*\u Test/*.xccovarchive/>sonarqube-generic-coverage.xml error Domain=dvtcommandlineparserrodomain Code=3时出现错误“无效选项”-archive''UserInfo={NSLocalizedDescription=无效选项”-archive'}