Jenkins
Cobertura plugin provides coverage reports and trends
Skytest supports five coverage output formats. The format is automatically selected based on the output file extension.
| Extension | Format | Use Case | Tools |
|---|---|---|---|
.txt | Text | Terminal, quick inspection | Human readable |
.json | JSON | Custom tooling, APIs | jq, scripts |
.xml | Cobertura | CI systems | Jenkins, GitLab, Azure |
.lcov | LCOV | IDE extensions | VS Code, genhtml |
.html | HTML | Browser viewing | Self-contained |
Human-readable summary for terminal output.
[test.coverage]enabled = trueoutput = "coverage.txt"Coverage Report===============
src/parser.star 87.5% (14/16 lines) Missing: 23-24src/lexer.star 100.0% (12/12 lines)src/utils.star 66.7% (8/12 lines) Missing: 5, 18-20
Total: 85.0% (34/40 lines)Machine-readable format for programmatic access.
[test.coverage]enabled = trueoutput = "coverage.json"{ "timestamp": "2024-01-15T10:30:00Z", "total_lines": 40, "covered_lines": 34, "percentage": 85.0, "files": [ { "path": "src/parser.star", "total_lines": 16, "covered_lines": 14, "percentage": 87.5, "missing_lines": [23, 24] }, { "path": "src/lexer.star", "total_lines": 12, "covered_lines": 12, "percentage": 100.0 }, { "path": "src/utils.star", "total_lines": 12, "covered_lines": 8, "percentage": 66.67, "missing_lines": [5, 18, 19, 20] } ]}| Field | Type | Description |
|---|---|---|
timestamp | string | ISO 8601 timestamp |
total_lines | int | Total executable lines |
covered_lines | int | Lines executed at least once |
percentage | float | Coverage percentage (0-100) |
files | array | Per-file coverage data |
files[].path | string | File path |
files[].missing_lines | array | Line numbers not covered |
# Get overall percentagejq '.percentage' coverage.json
# List files below 80% coveragejq '.files[] | select(.percentage < 80) | .path' coverage.json
# Get missing lines for a filejq '.files[] | select(.path == "src/utils.star") | .missing_lines' coverage.jsonStandard format supported by most CI platforms.
[test.coverage]enabled = trueoutput = "coverage.xml"Jenkins
Cobertura plugin provides coverage reports and trends
GitLab CI
Built-in coverage visualization in merge requests
Azure DevOps
PublishCodeCoverageResults task
Codecov
Full Cobertura format support
<?xml version="1.0" encoding="UTF-8"?><coverage line-rate="0.8500" branch-rate="0" version="1.0" timestamp="1705312200" lines-valid="40" lines-covered="34"> <sources> <source>.</source> </sources> <packages> <package name="src" line-rate="0.8500" branch-rate="0" complexity="0"> <classes> <class name="parser.star" filename="src/parser.star" line-rate="0.8750" branch-rate="0" complexity="0"> <lines> <line number="1" hits="1"/> <line number="2" hits="3"/> <line number="10" hits="5"/> <line number="23" hits="0"/> <line number="24" hits="0"/> </lines> </class> <class name="lexer.star" filename="src/lexer.star" line-rate="1.0000" branch-rate="0" complexity="0"> <lines> <line number="1" hits="2"/> <line number="2" hits="2"/> </lines> </class> </classes> </package> </packages></coverage>| Element | Attribute | Description |
|---|---|---|
coverage | line-rate | Overall coverage (0.0-1.0) |
coverage | lines-valid | Total executable lines |
coverage | lines-covered | Covered lines |
package | name | Directory/package name |
class | filename | Source file path |
line | number | Line number (1-based) |
line | hits | Execution count |
Tracefile format compatible with genhtml and IDE extensions.
[test.coverage]enabled = trueoutput = "coverage.lcov"VS Code
Coverage Gutters extension shows inline coverage
JetBrains
Built-in coverage visualization
genhtml
Generate HTML reports from LCOV
SonarQube
Import LCOV for analysis
TN:SF:src/parser.starFN:10,parse_expressionFNDA:5,parse_expressionFN:25,parse_statementFNDA:3,parse_statementFNF:2FNH:2DA:1,1DA:2,3DA:10,5DA:11,5DA:23,0DA:24,0LF:16LH:14end_of_recordTN:SF:src/lexer.starDA:1,2DA:2,2DA:3,2LF:12LH:12end_of_record| Field | Format | Description |
|---|---|---|
TN: | TN:<name> | Test name (usually empty) |
SF: | SF:<path> | Source file path |
FN: | FN:<line>,<name> | Function definition: start line and name |
FNDA: | FNDA:<hits>,<name> | Function hit data: call count and name |
FNF: | FNF:<count> | Functions found (total) |
FNH: | FNH:<count> | Functions hit (covered) |
DA: | DA:<line>,<hits> | Line data: line number and hit count |
LF: | LF:<count> | Lines found (total) |
LH: | LH:<count> | Lines hit (covered) |
end_of_record | - | End of file record |
# Generate LCOVskytest --coverage --coverage-output=coverage.lcov tests/
# Convert to HTMLgenhtml coverage.lcov --output-directory coverage-html
# Open in browseropen coverage-html/index.htmlbrew install lcovapt-get install lcovdnf install lcovSelf-contained HTML report with embedded CSS. No external dependencies.
[test.coverage]enabled = trueoutput = "coverage.html"The HTML report includes:
┌─────────────────────────────────────────────────┐│ Coverage Report ││ ═══════════════ ││ ││ ████████████░░░░ 85.0% 34 Lines 3 Files ││ Covered ││ ││ ┌─────────────────────────────────────────┐ ││ │ src/parser.star 14/16 87.5% │ ││ │ ▼ (click to expand) │ ││ │ 1 │ 1x │ def parse(): │ ││ │ 2 │ 3x │ token = next() │ ││ │ 23 │ 0x │ return error ← RED │ ││ └─────────────────────────────────────────┘ ││ ┌─────────────────────────────────────────┐ ││ │ src/lexer.star 12/12 100.0% │ ││ └─────────────────────────────────────────┘ │└─────────────────────────────────────────────────┘# Generate HTML reportskytest --coverage --coverage-output=coverage.html tests/
# Open in browseropen coverage.htmlCombine coverage from multiple test runs:
# Run different test suitesskytest --coverage --coverage-output=unit.lcov tests/unit/skytest --coverage --coverage-output=integration.lcov tests/integration/
# Merge with lcovlcov -a unit.lcov -a integration.lcov -o combined.lcov
# Generate combined reportgenhtml combined.lcov -o coverage-html/| Feature | Text | JSON | Cobertura | LCOV | HTML |
|---|---|---|---|---|---|
| Human readable | ✅ | ❌ | ❌ | ❌ | ✅ |
| Machine parseable | ❌ | ✅ | ✅ | ✅ | ❌ |
| CI integration | ❌ | ⚠️ | ✅ | ⚠️ | ❌ |
| IDE support | ❌ | ❌ | ❌ | ✅ | ❌ |
| Self-contained | ✅ | ✅ | ✅ | ✅ | ✅ |
| Function coverage | ❌ | ❌ | ❌ | ✅ | ❌ |
| Hit counts | ❌ | ❌ | ✅ | ✅ | ✅ |