Hi, I have swift project and I am running azure pipeline to analyse project. After analysis when I see the reports on SonarCloud for swift project, It shows 0.0% coverage.I have attached the screenshot for reference.
sonar-properties configuration is
sonar.projectName=ProjectName
sonar.projectKey=Key
sonar.organization= org
sonar.projectVersion=1.0
# =====================================================
# Properties that will be shared amongst all modules
# =====================================================
# SQ standard properties
sonar.sources=Name
# Properties to cover test-cases
sonar.test.inclusions=**/*Test*/**
sonar.test.inclusions=*.swift
sonar.exclusions=**/*.xml,Pods/**/*,Reports/**/*
sonar.tests= NameTests
# Properties remove c,c++, obj-c files path
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
# Properties specific to the C and C++ analyzer:
sonar.cfamily.build-wrapper-output=build_wrapper_output_directory```
Hi,
I write command for coverage path, but got this below error.
ERROR: Error during SonarScanner execution ERROR: Error during parsing of the generic coverage report ‘/Users/runner/work/1/s/sonarqube-generic-coverage.xml’. Look at SonarQube documentation to know the expected XML format. ERROR: Caused by: /Users/runner/work/1/s/sonarqube-generic-coverage.xml (No such file or directory) ERROR: ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Hi Ann,
I followed the above steps and still getting this below error.
##[error]ERROR: Error during parsing of the generic coverage report ‘/Users/runner/work/1/s/sonarqube-generic-coverage.xml’. Look at SonarQube documentation to know the expected XML format.
xccov-to-sonarqube-generic.sh: line 67: jq: command not found
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to create unarchiver" UserInfo={NSLocalizedDescription=Failed to create unarchiver, NSUnderlyingError=0x600000ab93e0 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/maxhina/Documents/Tapcheck/tmp.xccovarchive/Metadata.plist, NSUnderlyingError=0x600000ab85a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
sonar.coverageReportPaths=sonarqube-generic-coverage.xml for sonar-properties file
Hi,
Still facing below error on this command using Xcode 13
bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to create unarchiver" UserInfo={NSLocalizedDescription=Failed to create unarchiver, NSUnderlyingError=0x600002361110 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/maxhina/Documents/Tapcheck/tmp.xccovarchive/Metadata.plist, NSUnderlyingError=0x600002361050 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}