Giter Club home page Giter Club logo

Comments (10)

akoller-vs avatar akoller-vs commented on July 28, 2024 18

I was having the same issue upon upgrading our project to Xcode 11.0. I was unable to determine the cause of this error, but was able to figure out a workaround that works for us.

Leveraging xcparse, you can convert the Xcode 11 .xcresult bundles back to the Xcode 10 format. You can then run xccov-to-sonarqube-generic.sh as normal on those output .xccovarchive directories to get the old performance.

$ xcparse codecov Build/Logs/Test/MyApp.xcresult
$ xccov-to-sonarqube-generic.sh Build/Logs/Test/action.xccovarchive/ > sonarqube-generic-coverage.xml

Our project can produce multiple .xcresult outputs in 1 run, so you may have to loop and rename the output action.xccovarchive directory as I don't see any option to change that.

I did also look into merging .xcresult bundles using xcresulttool merge to avoid the loop and rename problem, but I found that the resulting action.xccovarchive produced from the merged .xcresult bundle only reports the coverage from just one of the .xcresult bundle parameters. The merged bundle looks fine when inspected with xcresulttool, so I believe it may be a problem with xcparse working with merged .xcresult bundles

from sonar-scanning-examples.

radutacatalin avatar radutacatalin commented on July 28, 2024 4

If you need to save some time, there's this tool that speeds up the process from 25 to 4 minutes for us. 🚀

from sonar-scanning-examples.

silverhammermba avatar silverhammermba commented on July 28, 2024 1

There's no need for additional tools. It's pretty easy to script the process. First run

xcrun xcresulttool get --format json --path Foobar.xcresult

That gives you all the test information in a big JSON dump. You can parse that and then grab the xccovarchive ID with this keypath:

xcresultObject['actions']['_values'][0]['actionResult']['coverage']['archiveRef']['id']['_value']

That will be a big gibberish string like v79U1TE0pwleCkEioB. Then you pass that to

xcrun xcresulttool export --type directory --path Foobar.xcresult --id v79U1TE0pwleCkEioB --output-path Foobar.xccovarchive

That creates the xccovarchive directory. Run the sonar conversion script on that directory and it will run about 10x faster than running it on the xcresult.

from sonar-scanning-examples.

silverhammermba avatar silverhammermba commented on July 28, 2024 1

That change looks good to me. I'm fine with closing this, though I wasn't involved in the original report

from sonar-scanning-examples.

qw1024 avatar qw1024 commented on July 28, 2024

Having exact the same issue on our CI env, takes ~ 8min to generate the report and tons of error output like this.

from sonar-scanning-examples.

wtimme avatar wtimme commented on July 28, 2024

Thanks a lot, @akoller-vs! For us, in first tests, utilizing xcparse brought down the build time from 20 minutes to 12 minutes. 👍🏼

from sonar-scanning-examples.

inforeqd512 avatar inforeqd512 commented on July 28, 2024

Thanks so much, @akoller-vs. This solution has reduced the build time considerably. As a further step, we're also looking at optimising the script by excluding all file and folder patterns that we provide in the sonar exclusions. We'll inform if this has significant benefits. 👍🏼

from sonar-scanning-examples.

softreigns avatar softreigns commented on July 28, 2024

My solution to this warning and slowness. I developed this xslt to get the generic report from cobertura xml, instead of using the xcov and xccov-to-sonarqube-generic.sh

https://github.com/softreigns/coverage-report-cobertura-to-sonar-generic

from sonar-scanning-examples.

sylvain-combe-sonarsource avatar sylvain-combe-sonarsource commented on July 28, 2024

Hello @silverhammermba
I implemented your suggestion with #121
Your comments are welcome!

from sonar-scanning-examples.

sylvain-combe-sonarsource avatar sylvain-combe-sonarsource commented on July 28, 2024

Going ahead and closing this thread after the merge of #121 yesterday
Thanks to all for your inputs.

from sonar-scanning-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.