Failing to load coverage
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at lib/slather/project.rb, especially pathnames_per_binary and profdata_coverage_files, which the reported stack trace identifies. Check how coverage data is located for the described workspace and test harness, then compare the behavior with the Xcode 14 and 15 reports. Done means Slather handles this setup without the coverage-loading and JSON parsing errors, with a regression test for the reported case.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Ruby
- Stars
- 1.6k
- Forks
- 239
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SlatherOrg/slather
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SlatherOrg/slather#582 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
SlatherOrg/slather#580 · 9 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 56/100
SlatherOrg/slather#578 · 3 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
SlatherOrg/slather#577 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
SlatherOrg/slather#576 · 2 comments ·
All issues in SlatherOrg/slather
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
:bank: debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cucumber/cucumber-ruby-core#346 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
TheOdinProject/curriculum#31467 · 2 comments ·
Maintainers usually reply within 1 day
-
message-patterns
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
sisimai/rb-sisimai#468 ·