Open edias opened 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!
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.
Anyone find a solution?
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.
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.
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:
Node > Configure > Remote root directory
and change the path.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?
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%.
Just updated CLI to Xcode 13 and now the reports are coming empty.
They display normally on XCode13.