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

xccov-to-sonarqube-generic.sh does not support XCode 11 #63

Closed
emanuelschmoczer opened this issue Sep 12, 2019 · 14 comments
Closed

xccov-to-sonarqube-generic.sh does not support XCode 11 #63

emanuelschmoczer opened this issue Sep 12, 2019 · 14 comments

Comments

@emanuelschmoczer
Copy link
Contributor

With XCode 11 the format of result bundles changed. Instead of *.xccovarchive now xcodebuild produces .xcresult (see release notes. and Testing in Xcode).
Using the current version of xccov-to-sonarqube-generic.sh on an xcresult-bundle results in following error:

Error: unrecognized file format

@Abeansits
Copy link

@agigleux any news on this?
We're getting ready to switch to Xcode 11 but currently the coverage reporting is blocking us from doing so.

@alexkater
Copy link

Same for me :(

@Abeansits
Copy link

Just wanted to surface this here, that we are disabling sonar and looking at alternative solutions. 😞

@agigleux
Copy link
Member

Sorry for the radio silence, you should definitely post your feedback on https://community.sonarsource.com/ where SonarSourcers are there every day.

The xccov-to-sonarqube-generic.sh is just an example of script to transform a *.xccovarchive into the Generic Coverage format supported by SonarQube. I mean this .sh script is not supported by SonarSource itself.

Can you post a Change Request on https://community.sonarsource.com/c/suggestions/features to officially request a solution to support Xcode 11 coverage format?

In the meantime, keep in mind that if the .xcresult file format is a JSON/XML format, it should not be complicated for one of you to transform it into the format expected by SonarQube: https://docs.sonarqube.org/latest/analysis/generic-test/

@umurcos
Copy link

umurcos commented Sep 25, 2019

In the meantime, keep in mind that if the .xcresult file format is a JSON/XML format, it should not be complicated for one of you to transform it into the format expected by SonarQube: https://docs.sonarqube.org/latest/analysis/generic-test/

@agigleux there is already a possible solution in #64

@diegommlima
Copy link

I made this fix, but now I got another error, do you have any idea about this? Thanks!

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

@emanuelschmoczer
Copy link
Contributor Author

@diegommlima I did not encounter this error yet. Do you have a github repo with the project somewhere or any other way I could reproduce this error?

@booiiing
Copy link

booiiing commented Oct 16, 2019

I get a similar error like @diegommlima:
Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter
For me, it does not complain about being unable to load the coverage report. However, conversion now takes several hours and seems to be incomplete (percentage is significantly lower in SQ).

Edit: I did some adjustments on our build machines. Coverage is back to normal, but conversion still takes >1hour (~10 minutes before). Alas, I cannot supply a sample project at the moment.

@mohammed-shakeer
Copy link

I made this fix, but now I got another error, do you have any idea about this? Thanks!

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

@diegommlima Even I am getting same error! were you able to resolve the error ?

@DiegoLimaMaxmilhas
Copy link

I made this fix, but now I got another error, do you have any idea about this? Thanks!

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

@diegommlima Even I am getting same error! were you able to resolve the error ?

Unfortunately not yet.. :( and I can't supply a sample project at the moment too.
Obs.: I don't know if it's important, but my project use multi-modules..

@leovido
Copy link

leovido commented Nov 7, 2019

I ran all my tests and got the latest .xcresult directory from DerivedData to generate the .xml file

Works on Xcode 11.1
Updating to Xcode 11.2 will require to change the command line tools to Xcode 11.1 (11A1027) for this command to work

bash xccov-to-sonarqube-generic.sh /DerivedData/yourApp/Logs/Test/Test-yourApp.xcresult > sonarqube-generic-coverage.xml

@booiiing
Copy link

@kuriishu27: what performance did you experience? (size of .xcresult bundle and time needed for the conversion would be great, amount of tests and source files even better)

@steven851007
Copy link

Yes, @kuriishu27 is correct after switching using the new Test Plans in Xcode 11 only the the test executed with the Xcode 11.1 command line tools version, not with newer ones.

If I don't use the new Test Plans then I can still use the lates command line tools (11.3.1 at the moment) I'll create a ticket for this.

@onurpolaatt
Copy link

Hi,
If you are using cocoapods in your projects, code coverage support will be provided with the '1.9.0' update.
Check release notes 1.9.0 > https://github.com/CocoaPods/CocoaPods/releases

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