有人在新版本 xcode12 - SonarQube 中获得了转换覆盖率
Someone got convert coverage in new version xcode12 - SonarQube
我正在尝试为 SonarQube 执行转换以解释覆盖范围,但出现此错误:
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load result bundle" UserInfo={NSLocalizedDescription=Failed to load result bundle, NSUnderlyingError=0x7fdaa840a8d0 {Error Domain=IDEFoundation.ResultBundleError Code=0 "This version of Xcode does not support opening result bundles created with versions of Xcode and xcodebuild using the v1 API."}}
The operation couldn’t be completed. (cococoLibrary.Bash.Error error 0.)
解决方案是将 slather 更新到 2.5 版,并在 sonarqube 通用模式下生成覆盖。按照成功复制的步骤:
Build
xcodebuild -workspace 'YourProject.xcworkspace' -scheme DEV -derivedDataPath Build/ -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
Slather generate sonarqube generic xml
slather coverage --jenkins --sonarqube-xml --build-directory ./Build --output-directory ./sonar-reports --scheme DEV --workspace YourProject.xcworkspace
Run analise Sonarqube
sonar-scanner -Dsonar.sources=. -Dsonar.coverageReportPaths=./sonar-reports/sonarqube-generic-coverage.xml -Dproject.settings=sonar-project.properties -Dsonar.qualitygate.wait=true
此页面提供了为各种 Xcode 版本生成代码覆盖率的步骤。如描述中所示,主要有 3 个步骤。
- 构建项目
- 创建代码覆盖率报告
- 导入代码覆盖率报告
https://github.com/SonarSource/sonar-scanning-examples/tree/master/swift-coverage
这是一个将 CI 与 Sonar 集成的热门页面,来自 SonarSource。
我正在尝试为 SonarQube 执行转换以解释覆盖范围,但出现此错误:
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load result bundle" UserInfo={NSLocalizedDescription=Failed to load result bundle, NSUnderlyingError=0x7fdaa840a8d0 {Error Domain=IDEFoundation.ResultBundleError Code=0 "This version of Xcode does not support opening result bundles created with versions of Xcode and xcodebuild using the v1 API."}}
The operation couldn’t be completed. (cococoLibrary.Bash.Error error 0.)
解决方案是将 slather 更新到 2.5 版,并在 sonarqube 通用模式下生成覆盖。按照成功复制的步骤:
Build
xcodebuild -workspace 'YourProject.xcworkspace' -scheme DEV -derivedDataPath Build/ -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
Slather generate sonarqube generic xml
slather coverage --jenkins --sonarqube-xml --build-directory ./Build --output-directory ./sonar-reports --scheme DEV --workspace YourProject.xcworkspace
Run analise Sonarqube
sonar-scanner -Dsonar.sources=. -Dsonar.coverageReportPaths=./sonar-reports/sonarqube-generic-coverage.xml -Dproject.settings=sonar-project.properties -Dsonar.qualitygate.wait=true
此页面提供了为各种 Xcode 版本生成代码覆盖率的步骤。如描述中所示,主要有 3 个步骤。
- 构建项目
- 创建代码覆盖率报告
- 导入代码覆盖率报告
https://github.com/SonarSource/sonar-scanning-examples/tree/master/swift-coverage
这是一个将 CI 与 Sonar 集成的热门页面,来自 SonarSource。