Advanced Settings
File exclusions, multi-pipeline rollout, and advanced configuration
Configure advanced code coverage options for complex scenarios.
What you will learn from this topic
How to exclude files from coverage calculations at the repo level and in your build tool
How to roll out code coverage across your organization using pipeline templates
Advanced CLI parameters for uploading coverage and enforcing quality gates
Before you begin
Complete the Onboarding Guide to have code coverage working in at least one pipeline
A valid Harness CI license
File exclusions
Exclude files from coverage calculations to focus on relevant source code.
Repo level exclusions
Files can be excluded using the exclusions settings found in the Settings tab.

Specify files to exclude using glob or regex. To use regex, prepend line items with "regex:" with no space afterwards.
Coverage tool exclusions
You can also bake in exclusion rules by providing instructions to your test runner (this happens in your pipeline and is independent of Harness tooling).
Python (pytest with coverage.py):
Create a .coveragerc file:
Java (JaCoCo with Gradle):
Configure in build.gradle:
Go:
Tag files you want to leave out of the coverage profile with a build constraint:
Run tests without -tags integration. Those files are not compiled, so they stay out of the coverage profile:
JavaScript (Jest):
Configure in jest.config.js:
Rolling out code coverage across your organization
Pipeline templates
Create reusable pipeline templates to standardize coverage across teams:
Create a template with a dedicated coverage steps (using the instructions above)
Share the template across projects
Go to Pipeline Templates for more information.
Advanced CLI options
Upload parameters
--file
No
Path to coverage file (can be specified multiple times for multi-file upload)
--base
No
Base branch for diff coverage tracking (e.g., main, origin/main)
--patch
No
Only include coverage for lines changed in the diff (requires --base)
--verbose
No
Enable verbose output for debugging (true or false)
--log-level
No
Set log level: debug, info, warn, error (default: info)
--owner
No
Specify identifier of repo SCM owner (<owner>/<repo>)
--identifier
No
Specify the repository name
Quality gate parameters
--gt
No
Minimum total coverage percentage required
--patch-gt
No
Minimum patch coverage percentage required (for PRs)
--timeout
No
How long to wait for coverage data (e.g., 1m, 30s). Default: 30s
Troubleshooting
Next steps
Go to Understanding Results to learn how to interpret coverage data
Go to Onboarding Guide to review basic setup
Last updated
Was this helpful?