Code Coverage
Track how much of your code is covered by tests
Code coverage shows what percentage of your code is exercised by tests. Harness provides native code coverage tracking that displays coverage metrics directly in your pipeline execution, helping you identify untested code paths and maintain quality standards.
What you will learn from this topic
What code coverage is and how Harness calculates it
The difference between total coverage and patch coverage
Which coverage report formats Harness supports
What is code coverage
Code coverage measures how much of your source code is executed during testing. It helps you:
Identify untested code paths
Ensure critical functionality is covered by tests
Track coverage trends over time
Enforce quality standards through gates
Types of coverage
Harness tracks two key coverage metrics:
Total Coverage
Percentage of all lines in your repo covered by tests
Understanding overall test coverage health
Patch Coverage
Percentage of changed lines covered by tests (PRs only)
Ensuring new code is properly tested before merging
Supported formats
Harness natively supports the following code coverage formats:
LCOV
.info, .lcov
Python, Node.js, JavaScript, C/C++
JaCoCo XML
.xml
Java, Kotlin, Scala
Go Coverage
.out
Go
Before you begin
Code coverage requires:
A valid Harness CI license
If you want to use Harness Code Coverage on GitHub Actions, CircleCI, or any other CI, go to codecov.io
Troubleshooting
Next steps
Go to Onboarding Guide to integrate code coverage into your pipeline
Go to Understanding Results to learn how metrics are calculated
Last updated
Was this helpful?