Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Failing to load coverage

未关闭
#545 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
ios, ruby
领域
testing, tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Ruby
星标
1.6k
派生
239
平均合并
1 天 9 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SlatherOrg/slather 的其他 Issue

查看 SlatherOrg/slather 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。