SlatherOrg / slather

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

Fail test code coverage not found coverage directory in Xcode 10.1 #418

Open amine2233 opened 5 years ago

amine2233 commented 5 years ago

Can't show code coverage in my Mac and in my Jenkins,

bundle exec slather coverage -s --scheme "Reactive iOS" --workspace Reactive.xcworkspace Reactive.xcodeproj/

Result

Slathering...
No coverage directory found.

    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)

bundler: failed to load command: slather (/Users/amine/.rbenv/versions/2.5.3/bin/slather)
StandardError: No coverage directory found.
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:178:in `profdata_coverage_dir'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:403:in `block in find_binary_files'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:402:in `each'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:402:in `find_binary_files'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:348:in `configure_binary_file'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/project.rb:242:in `configure'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/lib/slather/command/coverage_command.rb:51:in `execute'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11:in `execute'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'
  /Users/amine/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/slather-2.4.0/bin/slather:17:in `<top (required)>'
  /Users/amine/.rbenv/versions/2.5.3/bin/slather:23:in `load'
  /Users/amine/.rbenv/versions/2.5.3/bin/slather:23:in `<top (required)>'
IPrototypeI commented 5 years ago

@amine2233

Hi I had the same problem, please use the newest version 2.4.6 , if you try to install the dependencies ruby install by default version 2.4.0

https://rubygems.org/gems/slather

cesar-oyarzun-m commented 5 years ago

Hi @amine2233 I'm having the same issue with Xcode 10.1, now looks like the coverage report is inside a folder with the timestamp, I think that is why slather can't find the report files, Where you able to fix it?. @IPrototypeI I did try the version 2.4.6 still having same issue.

billburgess commented 5 years ago

I'm running 2.4.7 and still having the same issue.

vjmaiky commented 5 years ago

running into to the same issue on 2.4.7...any ideas?

lucasvercelot commented 5 years ago

Hi ! 👋 Any update on this issue ?

badrinathvm commented 5 years ago

I am also facing the same issue on Xcode 10.1

corteggo commented 5 years ago

It happens with Xcode 11 beta 1 & 2 as well, using version 2.4.7.

agronauts commented 5 years ago

Using XCode 10.1 & Slather 2.4.7 I encountered this and got around it by having relative path specified for -derivedDataPath in the xcodebuild command and build_directory in the .slather.yaml file.

I also found specifying the slather --arch flag to something in your project -> Build Settings -> Valid Architectures setting (Eg. arm64) intermittently solved this, but wasn't necessary in the end.

Hope this helps :)

y8k commented 5 years ago

I had same error state on Xcode 10.2..

huipengo commented 5 years ago

I had same error state on Xcode 10.2. slather 2.4.7. ruby-2.5.3

how to fix it ?

MaikCL commented 5 years ago

Same error with Xcode11. Appearly I think is the option to generate code coverage is not present in this version.

Xcode 10

Captura de Pantalla 2019-09-24 a la(s) 13 59 22

Xcode 11

Captura de Pantalla 2019-09-24 a la(s) 14 01 01
popmedic commented 5 years ago

@MZapatae it is under options.

image

That said, I am getting this same error with Xcode 11

leandroromn commented 4 years ago

I had same error here running with Fastlane.

Xcode 11.2.1 Slather 2.4.7 Ruby 2.6.3p62

Any update?

Speakus commented 4 years ago

could anyone suggest alternative for slather since it does not work with Xcode 11?

dileep017 commented 4 years ago

Can anyone suggest is there any solution for this? It is still happening with,Xcode Version 11.3.1 (11C505) gems used is 3.0.3 and slather (2.4.8, 2.4.7)

mayoralito commented 4 years ago

Same happening to me, any clue? The same configuration was working fine in other versions of Xcode 10.x.x:

macOS: 10.15.5 (19F101)
Xcode: Version 11.5 (11E608c)
❯ slather version: 2.4.9
DonnieLi commented 3 years ago

I can genergate report when i use Xcode run UITest. But use command line run,it does not work. any ideas? Thx

1ucas commented 3 years ago

Same here on XCode 12. By the way, when I run my tests on XCode, my coverage reports are being generated at the default XCode derived data. But slather doesn't know this path. Maybe that's the problem? Or does Slather rebuild the selected scheme by itself?

jambudi commented 3 years ago

I have a same error for xcode 12.2

rick711003 commented 1 year ago

I have a same error for Xcode 14.2

salvatoreboemia commented 1 year ago

Same issue starting from Xcode 14.3.x and Xcode 15

No news on this?