SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.
MIT License
1.55k stars 233 forks source link

2.8.0 - sonarqube_xml through fastlane is failing to slather and there is no report generated and empty #562

Closed cah-iswaria-sasi closed 4 days ago

cah-iswaria-sasi commented 1 week ago

This is what i am getting for sonarqube_xml format:

sonarqube-generic-coverage.xml: report is empty. i have verified .profdata nd binary files are generating properly under each packages. earlier was using 2.7.5 slather, was working fine.. suddenly it stopped working.

means, .xml file is empty . i am using slather 2.8.0 fastlane 2.221.1 ruby 3.3.3 bundler 2.5.13 xcode version 15.0.1 macos - sonoma 14.5

sometimes its working fine in my local, can see .xml fine.. i have upgraded versions on Build Machine (Mac) same to my local , but in BM its not working as expected. .xml file is empty

sonarqube_xml, its failing to generate .xml file for coverage

jarrodlombardo-EventBase commented 1 week ago

Please add the Slather part of your fastlane console output. I know other people have sonarqube working with slather 2.8.0 so we need to figure out what's different/going wrong for you.

cah-iswaria-sasi commented 1 week ago

@jarrodlombardo-EventBase @ksuther

log is clean, no errors reported.

i can see slather is doing its work but observed sonarqube.xml file is empty with no data and printing 1st 2 lines. shared you the lines in below comment xml version 1.0 \n coverage version 1.0 ?

eg:

o/p in fastlane log

19:56:30: --- Step: slather ---

19:56:30: $ slather coverage --jenkins --sonarqube-xml --build-directory ./Packages/Account/DerivedData --source-directory ./Packages/Account/Sources --output-directory ./sonar-reports/Account --verbose --scheme XXXX --binary-basename Account.o ./XXX.xcodeproj [19:56:31]: ▸ Slathering... [19:56:33]: ▸ Processing coverage file: /Users/iswaria.sasi/Documents/sourcecode/projectXXXX/Packages/Account/DerivedData/Account/Build/ProfileData/7C717D9C-73E8-453A-9028-13E27FCDC35B/Coverage.profdata [19:56:33]: ▸ Against binary files: [19:56:33]: ▸ /Users/iswaria.sasi/Documents/sourcecode/projectXXXX/Packages/Account/DerivedData/Account/Build/Products/Debug-iphonesimulator/Account.o [19:56:33]: ▸ Slathered

We dont use any .slather.yml instead passing the commands directly in fastlane

cah-iswaria-sasi commented 1 week ago

My xcode version in local is 15.2, BM has 15.0.1 in my local, i m getting .xml report generated properly but

build machine , generating only 2 lines inside report

=> <?xml version="1.0"?> =>

i now have switched the versions 2.8.2, 2.8.1, 2.8.0, 2.75 ..... nothing works to generate the sonarqube-generic-coverage.xml. can you someone tell the root cause why its not generating from slather?

we have a release by next week. if this not solved, we are doomed 😢 . if anything related to coverage_serive: sonarqube_xml have been changed, kindly check and fix it pls.

@ksuther @jarrodlombardo-EventBase

cah-bhavesh-lathigara commented 1 week ago

Hello I am getting the same issue. I have tried with updating all the latest the versions of Slather. I have tried installing XCode 15.4 since 15.2 was not available. But still slather is generating report with empty sonarqube_xml data. Kindly look into this on urgent basis?

cah-iswaria-sasi commented 1 week ago

i Just verified the .xcresult file generated after test and i can able to see the coverage % in it.

not sure why slather is generating empty sonarqube-generic-coverage.xml file (46 bytes)

cah-iswaria-sasi commented 5 days ago

can we have any update here

cah-iswaria-sasi commented 4 days ago

This issue is resolved, i upgraded the MacOS from sonoma 14.1.1 to 14.5 and downgraded some versions to fix the issue.. slather started generating coverage xml files for sonarqube-generic-coverage.xml format. Hope this information helps for anyone who is going through this issue.

issue : slather 2.8.0 fastlane 2.221.1 downgraded to 2.217.0 ruby 3.3.3 rubygems 3.5.13 bundler 2.5.13 downgraded to 2.4.6 (locked) xcode version 15.0.1 macos - sonoma 14.5

cah-iswaria-sasi commented 4 days ago

closing this issue @ksuther @jarrodlombardo-EventBase

jarrodlombardo-EventBase commented 4 days ago

I'm glad this resolved, but what changed with your upgrade? My guess is your DerivedData folder moved or something else controlled by MacOS or XCode changed, but do you have any idea what it was?

cah-iswaria-sasi commented 4 days ago

@jarrodlombardo-EventBase i am actually not sure what was the exact issue. i switched back to the old versions when it was working fine with latest macos 14.5. it worked.. but issue still persists with newer versions... somewhere ther is discrepency.

in my Local, which had newer versions for everything is working perfectly fine... but same thing on Old version Macos/Ruby/bundler it wasnt working. please try to fix the discrepency in old and same versions.. we shall need to update newer versions anytime soon.

jarrodlombardo-EventBase commented 4 days ago

That's just it though; the issue is something in your system (OS, Env, something), not Slather. Without knowing what is going wrong with the system, we can't modify Slather to try to work around whatever is changing in your system.