Comments (10)
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.
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.
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.
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.
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.
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.
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.
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.
Hello @silverhammermba
I implemented your suggestion with #121
Your comments are welcome!
from sonar-scanning-examples.
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)
- sonar-scanner -X ERROR: SonarQube server [http://10.12.12.12:9000] can not be reached HOT 1
- Sonarqube running on older gradle version in gitlab HOT 1
- wildcard support for jacocoxmlreports path is not working as expected HOT 1
- jacocoagent HOT 1
- fatal error compiling HOT 1
- log4j vulnerability validation HOT 1
- xccov-to-sonarqube-generic.sh Fails on Xcode 13.2 HOT 6
- sonar-scanner not working for javascript HOT 1
- Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project api: Unable to execute SonarQube: Fail to get bootstrap ind ex from server: Failed to connect to localhost/127.0.0.1:9000: SONAR COMMUNITY) HOT 1
- broken link HOT 1
- Path is NOT relative to repo in xccov-to-sonarqube-generic.sh HOT 3
- The process sonar-scanner failed with exit code null HOT 1
- When I run the command, show the result is : Not authorized. HOT 1
- sonar-scanner-cli image does not support arm
- Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter HOT 13
- ADD sonar.gradle.skipCompile usage to Gradle examples HOT 3
- gradle-basic build broken HOT 2
- sonar swift plugin issue HOT 3
- Not authorized to run analysis Error HOT 1
- I think that is not the complete example for multi-modules. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonar-scanning-examples.