Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter #164

Open
MikePendo opened this issue Aug 17, 2023 · 13 comments

Comments

@MikePendo
Copy link

This issue was already reported 69
As suggested I am using the new version of the script
This worked on Xcode 13 but for Xcode 14.3.1 on M1(not sure if that related it doesn't work any more)
I also noticed that archiveRef in the .xcresult is missing on Xcode 14
Please help

@MikePendo
Copy link
Author

running
xcrun xccov view --archive .xcresult
gave
Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter
...

@joe-tingsanchali-sonarsource
Copy link
Contributor

joe-tingsanchali-sonarsource commented Aug 18, 2023

I haven't tried it on Xcode 13 in awhile, but I think I'm getting the same error as you are now with Xcode 14.3.1 on M2:

>>> bash ./xccov-to-sonarqube-generic.sh ./Build/Logs/Test/Run-swift-coverage-example-2023.08.17_20-02-17--0500.xcresult > Coverage.xml
2023-08-17 20:03:47.904 xccov[80341:2026580] Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter
2023-08-17 20:03:47.910 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-08-17 20:03:47.911 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-08-17 20:03:47.911 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-08-17 20:03:47.912 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-08-17 20:03:47.912 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-08-17 20:03:47.912 xccov[80341:2026580] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21780/DVTFoundation/DocumentLocations/DVTDocumentLocation.m:277
Details:  DVTDocumentLocation: Failed to find requested class with name Xcode3ProjectDocumentLocation (or isn't a subclass of DVTDocumentLocation). Falling back to DVTDocumentLocation.
Object:   <DVTDocumentLocation>
Method:   +deserializedDocumentLocationForClassName:stringRepresentation:error:
Thread:   <_NSMainThread: 0x6000031d0380>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.

I'm investigating now...

EDIT: similar error reported in Sonar Community https://community.sonarsource.com/t/files-folder-with-special-characters-in-names-causing-syntactically-incorrect-xml/79498/13

May be useful: https://community.sonarsource.com/t/coverage-test-data-generate-reports-for-swift/9700

@joe-tingsanchali-sonarsource
Copy link
Contributor

@MikePendo : Looks like those DVTAssertions warnings are just warnings reported by Xcode. My Coverage.xml file was generated correctly and reported correctly in SonarQube.

Is the coverage XML file generated correctly?
If yes, is the coverage displayed in SonarQube/SonarCloud consistent with Xcode?

Xcode writes these warnings as standard errors. At least bash/zsh, you can just ignore those warnings like2>/dev/null at the end of the command line to ignore them.

@MikePendo
Copy link
Author

MikePendo commented Aug 18, 2023

@joe-tingsanchali-sonarsource
The coverage xml file wasnt generated correctly unfortunately.
I will try once again
can you please share the command?
this is how we run the tests:
xcodebuild -workspace P.xcworkspace test -scheme PTests -destination 'platform=iOS Simulator,name=iPhone 14' -enableCodeCoverage YES
We r doing it on circleci. I will share the .xcresult in few mins
Also the error in your previous comments is similar to mine and ends with: (that's not a warning)

Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action 'Testing workspace PendoWorkspace with scheme PendoSDKRNFrameworkTests' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action 'Testing workspace PendoWorkspace with scheme PendoSDKRNFrameworkTests' in result bundle, NSUnderlyingError=0x600002db9aa0 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x600002db9890 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}

Any chance I can dm u the .xcresult file?

@MikePendo
Copy link
Author

MikePendo commented Aug 18, 2023

I have some permission issues to get the file from ci.
I have tried it locally no luck:

Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action 'Testing workspace PWorkspace with scheme PTests' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action 'Testing workspace PWorkspace with scheme PTests' in result bundle, NSUnderlyingError=0x600002d383c0 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x600002d38300 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}} 

@joe-tingsanchali-sonarsource
Copy link
Contributor

joe-tingsanchali-sonarsource commented Aug 18, 2023

can you please share the command?

I'm using this example project in this repo swift-coverage-example.

  1. I cd to the project and then build it: xcodebuild -project swift-coverage-example.xcodeproj/ -scheme swift-coverage-example -derivedDataPath Build/ -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
  2. Then use xccov: bash xccov-to-sonarqube-generic.sh ./Build/Logs/Test/Run-swift-coverage-example-2023.08.17_20-02-17--0500.xcresult > Coverage.xml

So your project may need a different command.

I'm not a Swift developer, so you may find better luck with llvm-cov or following the instructions here.

@MikePendo
Copy link
Author

MikePendo commented Aug 18, 2023

@joe-tingsanchali-sonarsource
Thanks
Previously u shared an exact error I have. so in your case the .xml file has the correct format?
and what is the -destion you build for in your (1)?

@joe-tingsanchali-sonarsource
Copy link
Contributor

Previously u shared an exact error I have. so in your case the .xml file has the correct format?

Yes, in my example, the Coverage.xml file was correctly formatted and uploaded to SonarQube. The only minor issue is that the tests file was included in the Coverage.xml file, but that is a harmless error that can be rectified with a slight modification of the script or post-xccov-to-sonarqube-generic.sh conversion.

Please try this sample project first to confirm behavior, then try yours. If you continue to have problems, you may need to modify the xccov-to-sonarqube-generic.sh script or find an alternative way to make it work for you.

If you can provide me the entire project or some kind of small reproducible project, then I can try to help you.

@joe-tingsanchali-sonarsource
Copy link
Contributor

@MikePendo : Did you check #146 (comment) yet? Can you see if this is relevant or solves your issue?

@MikePendo
Copy link
Author

MikePendo commented Aug 21, 2023

@joe-tingsanchali-sonarsource
Unfortunately that didnt help.
I always have the same error in the end

Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action 'Testing workspace PendoWorkspace with scheme PendoSDKRNFrameworkTests' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action 'Testing workspace PendoWorkspace with scheme PendoSDKRNFrameworkTests' in result bundle, NSUnderlyingError=0x600000162e80 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x600000162dc0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}

I have tried your project and a new project and didnt see that error. To catch that kind of error I will need to strip our project from old its dependencies and see what might cause an issue (our project is pure objc). That might take some.
Currently I am going back to Xcode 14.2 which has the warning but not the error.
I have seen other threads with the same issue so I wouldn't consider this issue as resolved.
I feel like apple might change something. I would suggest to contact them directly (TSI) and ask how to handle those kind of issues.
I have also tried the llvm-cov way but a I couldn't merge .profraw for some reason that process also stoped worked for our project on Xcode 14.3

@MaximShnirman
Copy link

any updates on this?
trying to run the conversion script on xcode 14.3.0 wihtout luck, getting:

Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action 'workspace' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action 'workspace' in result bundle, NSUnderlyingError=0x6000011ea6d0 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x6000011ea610 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}

@stonko1994
Copy link

Any update on this? We are seeing the same issue occasionally.

@joe-tingsanchali-sonarsource
Copy link
Contributor

@MikePendo , @MaximShnirman , @stonko1994 : can you link me to an example xcode project with the build commands/coverage steps so that I can try to reproduce your issue? Ideally, on the latest version of Xcode 15.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants