Improve Test Coverage on Low-Coverage Packages

Đang mở
#39 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Go
Star
0
Fork
9
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của unbound-force/replicator

Tất cả issue của unbound-force/replicator

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.