Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

"error: Could not load coverage information" on targets with 0% code coverage

Abierto
#495 9 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
testing, tooling

Línea de trabajo

Start with lib/slather/project.rb, especially pathnames_per_binary and profdata_coverage_files, named in the stack trace; trace how an empty coverage result is parsed when a binary has no coverage data. Reproduce with the provided multi module Slather command and inspect the SonarQube XML coverage path. Done when targets without coverage no longer trigger the reported parse error and targets with coverage still produce their report.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I am getting this error on targets that have no coverage because they have no tests and don't know if this is expected behavior or not.

error: .../DerivedData/Build/Products/Debug-iphonesimulator/SomeModule.framework/SomeModule: Failed to load coverage: No coverage data found
error: Could not load coverage information
/Users/someUser/.gems/gems/json-2.5.1/lib/json/common.rb:216:in `parse': 809: unexpected token at '' (JSON::ParserError)
	from /Users/someUser/.gems/gems/json-2.5.1/lib/json/common.rb:216:in `parse'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/project.rb:135:in `pathnames_per_binary'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/project.rb:124:in `block in profdata_coverage_files'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/project.rb:123:in `each'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/project.rb:123:in `profdata_coverage_files'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/project.rb:98:in `coverage_files'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/coverage_service/sonarqube_xml_output.rb:18:in `post'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/command/coverage_command.rb:101:in `post'
	from /Users/someUser/.gems/gems/slather-2.7.0/lib/slather/command/coverage_command.rb:61:in `execute'
	from /Users/someUser/.gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/someUser/.gems/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
	from /Users/someUser/.gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	from /Users/someUser/.gems/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
	from /Users/someUser/.gems/gems/slather-2.7.0/bin/slather:17:in `<top (required)>'
	from /Users/someUser/.gems/bin/slather:23:in `load'
	from /Users/someUser/.gems/bin/slather:23:in `<main>'

I am trying to run slather on a multi module project, all living under one workspace. The command I am running (by using the fastlane plugin) is a more complex version of the following, where I pass all targets I want coverage on as --binary-basename parameters.

slather coverage --sonarqube-xml --build-directory DerivedData --output-directory DerivedData/slatherOutput --ignore Pods/\* --ignore Frameworks/\* --scheme MyApp-ALL-TESTS --workspace ./MyApp.xcworkspace --binary-basename MyApp --binary-basename SomeModule ./MyApp.xcodeproj

Is there a way to tell slather to ignore targets with no coverage, to avoid the error?

Lenguaje dominante
Ruby
Estrellas
1.6k
Forks
239
Merge medio
10 h 19 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de SlatherOrg/slather

Todos los issues de SlatherOrg/slather

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.