The coverage floor cannot see a small package losing its tests

Đang mở
#204 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, go
Lĩnh vực
ci-cd, testing

Hướng nghiên cứu

Read .github/workflows/ci.yml:39-52 and the related test commands in Makefile and make.ps1. Start by checking how the existing coverage step runs and how Go reports per-package coverage and packages with no test files. Update the CI step to enforce the stated per-package floor, allow-list internal/version, and put the package table in the job summary; verify with make test-short or .\make.ps1 test-short and run make lint.

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

Mô tả

ci good first issue severity: low

Summary

The coverage step exists, by its own comment, so a package that loses its tests is visible. It checks one total, which a small package cannot move.

Where

  • .github/workflows/ci.yml:39-52 (coverage step and floor)

Details

The check is the total of go test -short -coverprofile=coverage.out -coverpkg=./internal/... ./... against a floor about 2 points under the measured total. First, -coverpkg=./internal/... counts a statement as covered when any package's tests run it, so a package whose own tests are deleted keeps most of its coverage through its callers. Second, by statement share (from a profile taken without -coverpkg on Windows): envelope 0.23%, lang 0.30%, target 0.39%, textx 0.49%, budget 0.51%, ledger 0.61%, diffx 1.09%, walk 1.80% of internal/; each could drop to zero without moving the total 2 points. tools/ and cmd/ are outside the measured set. The CI total itself was not re-measured for this issue.

Impact

Removing the tests of internal/envelope or internal/budget would pass CI.

Suggested fix

Keep the total, and add a per-package check in the same step: run go test -short -cover ./internal/... without -coverpkg, parse the coverage: N% of statements column, and fail when any package with statements is under a per-package floor (the lowest own-test figure today is gitx at about 81% on Windows; 75 would pass with margin) or prints [no test files] (allow-list internal/version). Print the table in the job summary.

Acceptance criteria

  • CI fails when a package under internal/ has no test files or falls under the per-package floor
  • The per-package table is in the job summary

Related: #53

Getting started

  • Relevant files: .github/workflows/ci.yml, Makefile, make.ps1
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: ci|.github/workflows/ci.yml|COVERAGE_FLOOR

Ngôn ngữ chính
Go
Star
0
Fork
1
Merge trung bình
8 giờ 14 phút
Pull request đã merge (30 ngày)
3

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 TMHSDigital/Spackle

Tất cả issue của TMHSDigital/Spackle

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.