Skip to main content
Skip to content

Viewing code coverage for your repository

Track whether code coverage on your default branch is improving or regressing over time.

누가 이 기능을 사용할 수 있나요?

쓰기 권한이 있는 사용자

GitHub Team 또는 GitHub Enterprise Cloud

참고

The repository coverage overview is in 공개 미리 보기 and subject to change.

Prerequisites

Viewing code coverage

The Code coverage overview shows a snapshot of your repository's coverage at a glance, highlighting the current line coverage and trends over time.

  1. 리포지토리의 Security and quality 탭으로 이동합니다.
  2. 코드 품질 을(를) 확장하려면 클릭하고, 그런 다음 표준 결과 을(를) 클릭합니다.
  3. In the top right corner of the "Code coverage" score card, click View insights.
  4. To understand current coverage on your default branch, review the "Total line coverage" percentage:
    • The line coverage percentage represents the number of lines covered by tests divided by the total number of executable lines, expressed as a percentage. If you upload multiple reports, each line is counted once. See How total line coverage is calculated.
    • If a coverage goal is set, compare this percentage with the goal to see whether your coverage meets it.
  5. To see whether coverage is improving or declining over time, review the "Line coverage over time" line graph. Use the time period dropdown to select the last 14, 30, or 90 days.
  6. Optionally, to filter the results, use both the language and label filters to select the coverage you want to review. You must use both filters.
  7. To set a coverage goal, to the right of "Total line coverage", click and enter the desired percentage.

Next steps

To improve coverage in the files that need it most, use Copilot to write tests. See 코드 테스트.