SlatherOrg / slather

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

Reports are empty on Xcode 13 #507

Open edias opened 3 years ago

edias commented 3 years ago

Just updated CLI to Xcode 13 and now the reports are coming empty.

They display normally on XCode13.

image
josher8 commented 3 years ago

I don't know if this solution could be similar, but I was getting back 0% test code coverage after Xcode 13 and took me over a day to figure it out. It wasn't Slather's fault. In the project settings build settings, I turned off and on Enable Code Coverage Support. I made sure Generate Legacy Test Coverage Files and Instrument Program Flow is set to No.

In my xcodebuild script, I removed GCC_INSTRUMENT_PROGRAM_FLOW=YES and GCC_GENERATE_TEST_COVERAGE_FILES=YES, and replaced it with -enableCodeCoverage YES.

After I did those things, it solved the problem!

jmonroe commented 3 years ago

I am seeing the same thing.
I run slather through Fastlane and have verified that code coverage is enabled for that scheme and have set code_coverage(true) in my scanfile. When running tests in Jenkins I do see coverage results. Additionally, the "profdata" file that Slather says it is processing is not empty.

ggilley commented 2 years ago

Anyone find a solution?

jaimeeee commented 2 years ago

To add to this comment, I'm having this exact same issue but opposite as reported, locally or works for me, but on Jenkins (both Xcode 13.3) returns NaN.

svendr commented 2 years ago

Having the same problem with Xcode13.4 on macOS 12.4. Code Coverage is calculated perfectly fine on a local machine, while the CI-Build-Agent returns NaN. The corresponding .profdata-file is identical and contains the expected data (which can be inspected via xcrun llvm-cov report -instr-profile). I'm running slather 2.7.2 on both machines.

tengfoung commented 2 years ago

Managed to solve this issue by moving the node's root directory out from /private/var/jenkins to /Users/<username>/jenkins.

To change the root directory:

  1. Go to the Node > Configure > Remote root directory and change the path.
  2. Restart Jenkins.
vamsig7 commented 2 years ago

Any one got a working solution for this? we are using bamboo instead of Jenkins and facing a similar issue.I tried downloading the profile data from the build agent and ran slather locally its working fine, but empty reports in bamboo. @edias have you got any work around?

Morkrom commented 1 year ago

I don't know if it is related: I see the project files, though the files I have test coverage for display 0%. And overall less than 1% coverage though the project is more like 10%.