Open eimantas opened 8 years ago
@eimantas Were you able to find any workaround for the problem? I have a similar issue in my project using Xcode 8 and Slather 2.3.0
Same issue here, it keeps printing the same :(
Same issue for me, With XCode 8 and slather 2.3.0 - I'm getting the exact issue. I do find the Coverage.profdata files in the derived data folder.
@ramki982 @oarrabi please try to set binary_basename
key in slather action
@szymont - Thanks for the suggestion. Let me try that
@ramki982 Did you get it to work? I'm having the exact same problem
@MaikoHermans - yes it worked
slather coverage --input-format profdata --binary-basename '<Name of my app>' --verbose --scheme <Name of test target> --workspace <relative path to workspace> <relative path to .xcodeproj>
One point to note is that input format, binary basename, scheme, workspace, verbose are all options to coverage and last argument is the path to project file. when @szymont suggested using binary basename, i appended it to the end of command & kept getting "Too many arguments" error.
The issue has changed. I had same issue even adding binary-basename
as @szymont suggested.
In my case, the issue happens whenever Xcode test
and slather
are executed by a build agent in a remote build machine through VSTS.
After performing Test
(not Run
) in Xcode manually on the build machine, the issue has gone.
However, the code coverage reports always 0%. It doesn't collect the information properly.
I am still experiencing this issue with Xcode 8.1, Slather 2.3, ruby 2.1.5,
The tests are run before running slater and I see MyProjectForIos/Build/Intermediates/CodeCoverage/Coverage.profdata
`
$ slather coverage --html --input-format profdata --binary-basename MyProjectDebug --verbose --workspace MyProject.xcworkspace --scheme MyProjectDebug MyProject.xcodeproj
Slathering... No product binary found in /Users/user1/MyProjectForIos/Build/Intermediates/CodeCoverage.
Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme.
Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml)
If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml)
/Users/user1/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/slather-2.3.0/lib/slather/project.rb:459:in find_binary_files': No product binary found in /Users/user1/MyProjectForIos/Build/Intermediates/CodeCoverage. (StandardError)
I was also having this issue using the sonar swift plugin, but I fixed it by adding a binary_basename value to my .slather.yml file. Just be sure you're using the correct name. It looks for the product binary in .app, .xctest, .framework, and .dylib files under the /Users/
@jehyounglee I'm also facing the same issue. I go to the build machine directly and run tests and then run slather everything works. However, when I run it on Jenkins server it fails. Could you please mention if there is any working solution for the same, because going and running in the machine is a solution. Adding binary_basename in .slather.yml has not fixed the issue for me.
In my case, I ran tests with Release
configuration. Just back to Debug
or run slather coverage
with --configuration Release
.
In my case root case was here - https://github.com/SlatherOrg/slather/blob/8f6c4518244c415c6a00793341f5ae9aa9638f35/lib/slather/project.rb#L437
path.end_with?(".dSYM") || path.end_with?(".swiftmodule")
Mb someone will create patch? :)
not in a release yet, but current head https://github.com/SlatherOrg/slather/commit/69b74115aa3e0166230332e548d81aaeb669c973 (2.4.5 + 8 commit) fixes this issue for one of my projects
I'm using sonar-swift plugin. It utilises slather to run tests, however I keep getting the error when running following command:
The error:
There are previous issues that I browsed through, but none of them apply to this situation:
The slather is run from jenkins.