Languages of the repository - iOS apps using Swift
SonarQube used to work before Xcode 11, now Xcode 13 is being used and Sonar reports are not getting generated.
I am looking for a well guided article for best practices in iOS code coverage setup.
Xcode Test is passed with below args and is generating xcresult file.
-derivedDataPath Build/ -enableCodeCoverage YES -resultBundlePath Build/Logs/Test/Test/
Previous setup utilized a bash to process the xcresult and generate sonar coverage file. This is failing.
Internet search and solutions dont seem to be working.
2022-04-26T14:57:03.4247960Z Error: Error Domain=XCCovErrorDomain Code=0 "Failed to create unarchiver" UserInfo={NSLocalizedDescription=Failed to create unarchiver, NSUnderlyingError=0x7fdc73c47370 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/runner/work/1/s/tmp.xccovarchive/Metadata.plist, NSUnderlyingError=0x7fdc73c472b0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
2022-04-26T14:57:03.4455370Z ##[error]Bash exited with code '1'.
2022-04-26T14:57:03.4479240Z ##[section]Finishing: Bash Script
Since it is running on a hosted build agent, files cant be retained for debug it seems.
Has anyone found a workable solution for iOS apps with a similar approach.
Hi Elena, thanks for responding.
This is the output of the file you have mentioned.
The output is from an Azure DevOps hosted MacOS agent that already has JQ installed as per their documentation(also no similar line for jq not being present).
I do see there is a metadata.db in a different folder, not sure if that is relevant to this script.
This seems to be due to some fishy package R.Swift used in the project that coverage data is not getting generated. Will post once we have the problem fixed. Nothing related to Sonar as of now.