Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Binary does nothing #1

Open
kamialie opened this issue Mar 5, 2020 · 15 comments
Open

Binary does nothing #1

kamialie opened this issue Mar 5, 2020 · 15 comments

Comments

@kamialie
Copy link

kamialie commented Mar 5, 2020

Tried both downloading the binary and building it on my machine. I run cococo exactly as it says in the example and it stays idle. Possible reasons?

Xcode 11.3.1

@heinzl
Copy link
Collaborator

heinzl commented Mar 5, 2020

@wise-Kaas Hi, can you provide me with more information on how you use cococo. Command, input file?

@kamialie
Copy link
Author

kamialie commented Mar 5, 2020

while in derived directory cococo Logs/Test/*.xcresult

@heinzl
Copy link
Collaborator

heinzl commented Mar 5, 2020

@wise-Kaas Can you send me the xcresult file?

@kamialie
Copy link
Author

kamialie commented Mar 5, 2020

xcresult is a directory that further contains Data directory and Info.plist (at least that is what I get)

@heinzl
Copy link
Collaborator

heinzl commented Mar 5, 2020

Please zip the xcresult directory and send it to me, so I can debug the issue.

@kamialie
Copy link
Author

kamialie commented Mar 5, 2020

Sorry, was making sure we are talking about same thing, as previous Xcode versions would output in different formats.
xcresult.zip

@heinzl
Copy link
Collaborator

heinzl commented Mar 5, 2020

I downloaded the latest release from cococo from Github, ran ./cococo Run-SmartOffice-2020.03.05_14-59-28-+0300.xcresult/ > output.xml and it worked fine for me. The only thing that I noticed was that Github added a weird file extension to the executable, I just removed the file extension.
output.xml.zip

$ xcodebuild -version
Xcode 11.3.1
Build version 11C504

@kamialie
Copy link
Author

kamialie commented Mar 5, 2020

Still got no luck. Also did not get any extension issue, just had to add executable right (those are probably to do with browser, rather than github)

@heinzl
Copy link
Collaborator

heinzl commented Mar 9, 2020

Do you get any output or error message while running/debugging?

@adrianogalindo
Copy link

Don't know you guys, buy my process is taking more time than with the original xccov file from sonarqube. Even after 20 minutes building, I'm still getting the error below on all the lines analyzed:

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

After passing all this, when I ran the sonar-scanner with these properties:

`sonar.host.url=http:https://localhost:9000/
sonar.login=secrettoken
sonar.projectKey=AppName
sonar.projectName=AppName
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=swift
sonar.tests=AppNameTests,AppNameUITests
sonar.coverageReportPaths=sonarqube-generic-coverage.xml
sonar.sourceEncoding=UTF-8
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

sonar.cfamily.build-wrapper-output.bypass=true`

I'm getting an error saying that:

Error during parsing of the generic coverage report /path/to/the/sonarqube-generic-coverage.xml'. Look at SonarQube documentation to know the expected XML format. Caused by: Line 41757 of report refers to a file with an unknown language: workspace/project/build/path/file.m

Do you have any thoughts? How are you guys are running your coverage analysis?

@heinzl
Copy link
Collaborator

heinzl commented Mar 10, 2020

@adrianogalindo Have you used the official script provided by SonarSource? https://github.com/SonarSource/sonar-scanning-examples/blob/master/swift-coverage/swift-coverage-example/xccov-to-sonarqube-generic.sh
cococo does basically the same thing but faster (using multiple threads) as far as we experienced. If you try the original script, please let me know how long it took for you project.

We also get Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter. That output comes from xcrun xccov and as I far as I know it can be ignored.

To prevent your error you should exclude other files than swift files. For cococo you can use the --excluded parameter:
cococo myproject.xcresult --excluded .h .m > sonarqube-generic-coverage.xml

For sonar-scanner you can just include Swift files: sonar.inclusions=**/*.swift

@adrianogalindo
Copy link

Hi @heinzl , running the default sonarqube script: xccov-to-sonarqube-generic.sh it takes 4 minutes

Running cococo it takes 18 minutes.

I'm running now the solution from akoller-vs: SonarSource/sonar-scanning-examples#68 (comment)

It converts the xcresult in the xcode 10 version and runs the default xccov-to-sonarqube-generic.sh. It's really fast, less than 1 minute.

I added the sonar.inclusions=**/*.swift parameter in the properties file and worked like a charm. I was using sonar.exclusions for the languages that I didn't wanted, but I think I misunderstood the concept Lol. Thank you very much.

@varol
Copy link

varol commented Jun 9, 2020

zsh: command not found: cococo

whats wrong? how to install it correctly? @heinzl

@heinzl
Copy link
Collaborator

heinzl commented Jun 15, 2020

@varol Just download the binary from the latest release.

@varol
Copy link

varol commented Jun 15, 2020

thank you @heinzl but i have an error.

./cococo /Users/varolaksoy/Library/Developer/Xcode/DerivedData/MYPROJECT-guxafevwhulytkcnqpkniwdepijm/Logs/Test/Test-MYPROJECT-2020.06.15_09-51-20-+0300.xcresult/ > output.xml

2020-06-15 09:59:26.418 cococo[8816:147119] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff3351abe7 _exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6c2f25bf objc_exception_throw + 48
2 Foundation 0x00007fff35bdafdd -[NSConcreteTask launchWithDictionary:error:] + 5213
3 cococo 0x000000010a442630 $s13cococoLibrary4BashC13launchProcess33_801E9186FDF37CA22C8EC9F586A30778LL7command9argumentsS2S_SaySSGtKF + 576
4 cococo 0x000000010a4422ba $s13cococoLibrary4BashC7execute11commandName9argumentsS2S_SaySSGtKF + 1034
5 cococo 0x000000010a4445b5 $s13cococoLibrary9ConverterC7convert_22excludedFileExtensionsSaySSSgGSS_SaySSGSgtKF + 645
6 cococo 0x000000010a443981 $s13cococoLibrary9ConverterC7convert_22excludedFileExtensionsSSSaySSG_AFSgtKFySSKXEfU
+ 97
7 cococo 0x000000010a443a08 $s13cococoLibrary9ConverterC7convert_22excludedFileExtensionsSSSaySSG_AFSgtKFySSKXEfU_TA + 24
8 cococo 0x000000010a443a34 $sSSs5Error_pIggzo_SSsAA_pIegnzo_TR + 36
9 cococo 0x000000010a443a84 $sSSs5Error_pIggzo_SSsAA_pIegnzo_TRTA + 20
10 libswiftCore.dylib 0x00007fff6cbe364d $sSTsE7forEachyyy7ElementQzKXEKF + 381
11 cococo 0x000000010a443575 $s13cococoLibrary9ConverterC7convert_22excludedFileExtensionsSSSaySSG_AFSgtKF + 309
12 cococo 0x000000010a329452 $s6cococo3CliC4mainyyF + 1650
13 cococo 0x000000010a32a64b main + 75
14 libdyld.dylib 0x00007fff6d499cc9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1] 8816 abort ./cococo > output.xml

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

No branches or pull requests

4 participants