Improve Test Coverage on Low-Coverage Packages

Abierto
#39 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
go
Área
testing

Línea de trabajo

Start with AGENTS.md for the test conventions, then inspect the listed packages under internal/tools, internal/config, internal/db, and cmd/replicator. Run the existing Go tests to see what is already covered and identify gaps against the acceptance criteria. Done means the specified handler, config, database, and CLI tests are added and all coverage targets are met.

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

Descripción

enhancement

Summary

Raise test coverage on packages currently at 0% or below 40% to make the coverage ratchets in #24 meaningful and enforceable.

Context

Coverage ratchets (#24) will fail CI if coverage drops below a threshold. However, five packages currently have coverage so low that a global
ratchet would either need to be set unrealistically low or exempt them.

Current coverage (as of 2026-07-16):

Package Coverage Status
internal/tools/org 0.0% No tests
internal/tools/forge 0.0% No tests
internal/tools/comms 0.0% No tests
internal/tools/memory 0.0% No tests
internal/tools/registry 0.0% No tests
internal/config 0.0% No tests
internal/db 34.6% Under-tested
cmd/replicator 24.4% CLI entrypoint

The tools/* packages are thin MCP handler wrappers — they delegate to domain packages. The config package handles path resolution. These are small surface areas that should be straightforward to cover.

Acceptance Criteria

  • internal/tools/* packages: add handler-level tests exercising the happy path and one error case per tool
  • internal/config: add tests for path resolution and defaults
  • internal/db: raise coverage to ≥ 50% (currently 34.6%)
  • cmd/replicator: add CLI smoke tests for version, doctor, and cells subcommands
  • Global coverage rises to ≥ 65% (from 58.4%)

References

  • Issue: #24 (coverage ratchets — depends on this for enforceable thresholds)
  • Constitution Principle IV: "Coverage regressions MUST be treated as test failures."
  • Test conventions: AGENTS.md — stdlib testing only, t.Errorf /t.Fatalf, db.OpenMemory() for DB tests, t.TempDir() for git tests
Lenguaje dominante
Go
Estrellas
0
Forks
9
Merge medio
1 d 14 h
PR fusionados (30 d)
18

Preparar el entorno

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 unbound-force/replicator

Todos los issues de unbound-force/replicator

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.