Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to load coverage #545

Open
roballie opened this issue Sep 26, 2023 · 4 comments
Open

Failing to load coverage #545

roballie opened this issue Sep 26, 2023 · 4 comments

Comments

@roballie
Copy link

roballie commented Sep 26, 2023

This might be because of how my workspace is setup, but whenever I run slather I get error: Failed to load coverage .... no coverage data found. I know there is coverage, because if I open the xcresults, I see all the coverage data.

My project has a testing harness workspace that contains all the frameworks to be tested which are pulled in a submodules. The framework projects themselves have the tests in them, but the testing harness contains a project that has all the test plans.

Here is the full error message, any thoughts?

<user>@<machine> Debug % slather coverage -s --scheme <project name>NoHardwareTests --workspace /Users/<user>/Projects/<project name>-Harness/<project name>Harness.xcworkspace /Users/<user>/Projects/<project name>-Harness/<project name>TestHarness/<project name>TestHarness.xcodeproj
Slathering...
error: Failed to load coverage: '/Users/<user>/Library/Developer/Xcode/DerivedData/<project name>Harness-czjbpsoximqkdwftaumjsowuxllm/Build/Products/Debug/<project name>TestHarnessUnitTests.xctest/Contents/MacOS/<project name>TestHarnessUnitTests': No coverage data found
error: Could not load coverage information
/Users/<user>/.rubies/ruby-3.1.4/lib/ruby/3.1.0/json/common.rb:216:in `parse': 859: unexpected token at '' (JSON::ParserError)
	from /Users/<user>/.rubies/ruby-3.1.4/lib/ruby/3.1.0/json/common.rb:216:in `parse'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:135:in `pathnames_per_binary'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:124:in `block in profdata_coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:123:in `each'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:123:in `profdata_coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:98:in `coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/coverage_service/simple_output.rb:17:in `post'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/command/coverage_command.rb:101:in `post'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/command/coverage_command.rb:61:in `execute'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/bin/slather:17:in `<top (required)>'
	from /Users/<user>/.gem/ruby/3.1.4/bin/slather:25:in `load'
	from /Users/<user>/.gem/ruby/3.1.4/bin/slather:25:in `<main>'

edit: this is on Xcode 15 if it matters. It also doesn't seem to work on Xcode 14.

@salvatoreboemia
Copy link

This might be because of how my workspace is setup, but whenever I run slather I get error: Failed to load coverage .... no coverage data found. I know there is coverage, because if I open the xcresults, I see all the coverage data.

My project has a testing harness workspace that contains all the frameworks to be tested which are pulled in a submodules. The framework projects themselves have the tests in them, but the testing harness contains a project that has all the test plans.

Here is the full error message, any thoughts?

<user>@<machine> Debug % slather coverage -s --scheme <project name>NoHardwareTests --workspace /Users/<user>/Projects/<project name>-Harness/<project name>Harness.xcworkspace /Users/<user>/Projects/<project name>-Harness/<project name>TestHarness/<project name>TestHarness.xcodeproj
Slathering...
error: Failed to load coverage: '/Users/<user>/Library/Developer/Xcode/DerivedData/<project name>Harness-czjbpsoximqkdwftaumjsowuxllm/Build/Products/Debug/<project name>TestHarnessUnitTests.xctest/Contents/MacOS/<project name>TestHarnessUnitTests': No coverage data found
error: Could not load coverage information
/Users/<user>/.rubies/ruby-3.1.4/lib/ruby/3.1.0/json/common.rb:216:in `parse': 859: unexpected token at '' (JSON::ParserError)
	from /Users/<user>/.rubies/ruby-3.1.4/lib/ruby/3.1.0/json/common.rb:216:in `parse'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:135:in `pathnames_per_binary'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:124:in `block in profdata_coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:123:in `each'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:123:in `profdata_coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/project.rb:98:in `coverage_files'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/coverage_service/simple_output.rb:17:in `post'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/command/coverage_command.rb:101:in `post'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/lib/slather/command/coverage_command.rb:61:in `execute'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
	from /Users/<user>/.gem/ruby/3.1.4/gems/slather-2.7.4/bin/slather:17:in `<top (required)>'
	from /Users/<user>/.gem/ruby/3.1.4/bin/slather:25:in `load'
	from /Users/<user>/.gem/ruby/3.1.4/bin/slather:25:in `<main>'

edit: this is on Xcode 15 if it matters. It also doesn't seem to work on Xcode 14.

Same issue for me, starting from Xcode 14.3.x

I'm using a fastlane file with slather configuration

Do you have some idea?

@FrankSolleveld
Copy link

I am also experiencing this issue. Would love to hear how I can be of help with debugging this issue.

@kieoo
Copy link

kieoo commented Jan 30, 2024

Have found a solution now?

@jarrodlombardo-EventBase
Copy link
Contributor

Not sure what @roballie is seeing, but I think everyone else posting here is seeing #541

That is a change in xcode 14.3+ upstream of slather that can't be fixed in slather; you'll need to rebuild all of your apps and upstream dependencies with xcode 14.3+. #541 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants