Troubleshooting
This guide helps you troubleshoot common issues with code coverage in Qlty.
Upload Issues
Coverage Report Not Being Detected
Symptoms:
- “Unsupported format” errors
- “Unable to parse coverage report” messages
- No coverage data appears in Qlty after upload
Potential Causes:
- Unsupported coverage format
- Corrupt or incomplete coverage report
- Incorrect file path in upload command
Solutions:
- Verify your coverage format is supported
- Check that the coverage report file exists and is complete
- Try using the
--format
flag to explicitly specify the format: - Examine the report file for valid content
- Generate a fresh coverage report and try again
Authentication Failures
Symptoms:
- “Authentication failed” errors
- “Invalid token” messages
- “Permission denied” errors
Potential Causes:
- Incorrect coverage token
- Expired or rotated token
- Missing environment variable
- Using a token with incorrect scope
Solutions:
- Verify your token is correct in your CI settings
- Check environment variable names (should be
QLTY_COVERAGE_TOKEN
) - Regenerate your token in Qlty and update your CI configuration
- Ensure you’re using the token for the correct workspace or project
- If using OIDC, verify the permissions configuration in your GitHub workflow
Path Mapping Issues
Symptoms:
- Coverage appears but doesn’t match files in your repository
- “File not found” errors when viewing coverage
- Coverage shown for files that don’t exist in your repo
Potential Causes:
- Coverage report contains absolute paths
- Path structure differs between build environment and repository
- Generated files with different paths
Solutions:
- Use path fixing options:
- Check that your coverage tool is configured to use relative paths
- Inspect the coverage report to see what paths are being reported
- Use
qlty coverage transform
to convert paths before uploading
Missing Metadata
Symptoms:
- Coverage is uploaded but not associated with the correct branch
- Coverage doesn’t appear in pull requests
- Coverage data shows with incorrect commit information
Potential Causes:
- CI system metadata not detected
- Shallow git clone in CI
- Custom CI setup not recognized by Qlty
Solutions:
- Manually specify metadata with override flags:
- Ensure your CI environment provides standard environment variables
- Use a deeper git clone in CI (or fetch git metadata)
- Check that the git repository is available in the CI environment
Viewing Issues
Coverage Not Showing in GitHub
Symptoms:
- No coverage status checks on pull requests
- Missing coverage comments on pull requests
- Coverage data visible in Qlty but not in GitHub
Potential Causes:
- GitHub app permissions issues
- Coverage gates not enabled
- PR comments not configured
- Timing issues with CI and status reporting
Solutions:
- Verify GitHub integration settings in project settings
- Check that coverage gates are enabled in quality gates settings
- Ensure PR comments are enabled
- Check GitHub app permissions in your organization settings
- Try manually uploading coverage for the PR branch
Inconsistent Coverage Reports
Symptoms:
- Different coverage percentages in different views
- Coverage fluctuates between builds without code changes
- Coverage shown in CI logs differs from what appears in Qlty
Potential Causes:
- Different coverage criteria (line vs branch vs statement)
- Test flakiness or non-deterministic tests
- Cache issues in tests
- Different coverage tool configurations
Solutions:
- Standardize coverage configuration across environments
- Fix flaky tests that produce inconsistent results
- Use the same coverage tool and settings consistently
- Implement deterministic test ordering
- Clear caches between test runs
Missing Coverage for Some Files
Symptoms:
- Some files show no coverage data
- Certain directories are missing from coverage reports
- Coverage appears for some languages but not others
Potential Causes:
- Include/exclude patterns filtering out files
- Multi-language projects with incomplete coverage setup
- Files not being exercised by tests
- Generated code or third-party code inclusion/exclusion
Solutions:
- Check coverage tool configuration for include/exclude patterns
- Verify that all relevant files are included in coverage report generation
- Set up coverage for each language in multi-language projects
- Use multiple coverage reports for different parts of the codebase
- Configure path exclusions appropriately in Qlty
Quality Gate Issues
Failing Coverage Gates
Symptoms:
- Pull requests failing due to coverage checks
- “Coverage decreased” warnings even with improved test coverage
- Diff coverage failing despite high coverage in changed files
Potential Causes:
- Thresholds set too high for your project’s current state
- Coverage decreasing in files not directly modified
- Base branch coverage calculation issues
- Coverage calculation includes excluded files
Solutions:
- Adjust coverage gate thresholds to realistic levels
- Investigate unexpected coverage changes
- Temporarily disable gates while building up coverage
- Use path exclusions to ignore files that shouldn’t affect gates
- Focus on diff coverage rather than total coverage for incremental improvement
Coverage Badges Not Updating
Symptoms:
- Outdated coverage percentage in badges
- Coverage badge shows “unknown” or “N/A”
- Badge doesn’t reflect recent coverage improvements
Potential Causes:
- Badge caching
- No coverage data for default branch
- Badge URL issues
Solutions:
- Ensure coverage is being uploaded for your default branch
- Check badge URLs and project settings
- Manually refresh cached badges
- Verify that the badge is pointing to the correct project and metric
- Wait for cache expiration (typically a few hours)
Advanced Issues
Merging Coverage Reports
Symptoms:
- Coverage from parallel tests not combining correctly
- Missing coverage data from certain test suites
- Merged coverage showing lower than expected percentages
Potential Causes:
- Incorrect merging configuration
- Incompatible coverage report formats
- Issues with multi-part uploads
Solutions:
- Review coverage merging documentation
- For client-side merging, ensure all reports use the same format
- For server-side merging, verify the
--total-parts-count
configuration - Check that all parts are successfully uploaded
- Try converting all reports to a common format before merging
Coverage Tag Issues
Symptoms:
- Tagged coverage not appearing separately
- Incorrect coverage shown for specific tags
- Tags not filtering correctly in UI
Potential Causes:
- Incorrect tag specification during upload
- Mixing tagged and untagged uploads
- UI filtering confusion
Solutions:
- Verify tag naming in upload commands:
- Ensure consistent tag usage across uploads
- Check tag configuration in project settings
- Use different tags for different test types (unit, integration, etc.)
Large Repository Issues
Symptoms:
- Coverage uploads timing out
- Very slow coverage rendering in UI
- Missing coverage for some files in large repositories
Potential Causes:
- Coverage reports too large
- Too many files included in coverage
- Performance limits in browser extensions
Solutions:
- Use path exclusions to limit coverage to relevant code
- Split large repositories into smaller projects
- Exclude generated code, vendor code, or test code from coverage
- Use more specific coverage focus for very large repositories
- Contact Qlty support for help with large-scale deployments
Getting Additional Help
If you’ve tried the solutions above and are still experiencing issues:
- Check Logs: Use
QLTY_DEBUG=true
with your commands to get detailed logs - Contact Support: Reach out to Qlty support
- Join Discord: Ask for help in our Discord community
- GitHub Issues: Submit a bug report on our GitHub issue tracker
When asking for help, include:
- The exact command you’re running
- Any error messages (with sensitive information redacted)
- Your CI provider and configuration
- The coverage tool and language you’re using
- Steps you’ve already taken to troubleshoot