Skip to content

Coverage Output Formats

Skytest supports five coverage output formats. The format is automatically selected based on the output file extension.

ExtensionFormatUse CaseTools
.txtTextTerminal, quick inspectionHuman readable
.jsonJSONCustom tooling, APIsjq, scripts
.xmlCoberturaCI systemsJenkins, GitLab, Azure
.lcovLCOVIDE extensionsVS Code, genhtml
.htmlHTMLBrowser viewingSelf-contained

Human-readable summary for terminal output.

sky.toml
[test.coverage]
enabled = true
output = "coverage.txt"
Coverage Report
===============
src/parser.star 87.5% (14/16 lines)
Missing: 23-24
src/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)
  • Per-file coverage percentage
  • Line counts (covered/total)
  • Missing line numbers displayed as ranges
  • Aggregate total at bottom
  • Quick terminal inspection
  • Commit hooks
  • Local development feedback

Machine-readable format for programmatic access.

sky.toml
[test.coverage]
enabled = true
output = "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]
}
]
}
FieldTypeDescription
timestampstringISO 8601 timestamp
total_linesintTotal executable lines
covered_linesintLines executed at least once
percentagefloatCoverage percentage (0-100)
filesarrayPer-file coverage data
files[].pathstringFile path
files[].missing_linesarrayLine numbers not covered
Terminal window
# Get overall percentage
jq '.percentage' coverage.json
# List files below 80% coverage
jq '.files[] | select(.percentage < 80) | .path' coverage.json
# Get missing lines for a file
jq '.files[] | select(.path == "src/utils.star") | .missing_lines' coverage.json
  • Custom dashboards
  • Coverage trend analysis
  • Integration with internal tools

Standard format supported by most CI platforms.

sky.toml
[test.coverage]
enabled = true
output = "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>
ElementAttributeDescription
coverageline-rateOverall coverage (0.0-1.0)
coveragelines-validTotal executable lines
coveragelines-coveredCovered lines
packagenameDirectory/package name
classfilenameSource file path
linenumberLine number (1-based)
linehitsExecution count
  • Jenkins with Cobertura plugin
  • GitLab CI coverage reports
  • Azure DevOps pipelines
  • Any CI requiring XML coverage

Tracefile format compatible with genhtml and IDE extensions.

sky.toml
[test.coverage]
enabled = true
output = "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.star
FN:10,parse_expression
FNDA:5,parse_expression
FN:25,parse_statement
FNDA:3,parse_statement
FNF:2
FNH:2
DA:1,1
DA:2,3
DA:10,5
DA:11,5
DA:23,0
DA:24,0
LF:16
LH:14
end_of_record
TN:
SF:src/lexer.star
DA:1,2
DA:2,2
DA:3,2
LF:12
LH:12
end_of_record
FieldFormatDescription
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
Terminal window
# Generate LCOV
skytest --coverage --coverage-output=coverage.lcov tests/
# Convert to HTML
genhtml coverage.lcov --output-directory coverage-html
# Open in browser
open coverage-html/index.html
Terminal window
brew install lcov
  • IDE coverage visualization
  • VS Code Coverage Gutters
  • JetBrains coverage
  • Generating detailed HTML with genhtml

Self-contained HTML report with embedded CSS. No external dependencies.

sky.toml
[test.coverage]
enabled = true
output = "coverage.html"
  • Dark theme - Easy on the eyes
  • Collapsible files - Click to expand/collapse per-file details
  • Color-coded badges:
    • 🟢 Green: ≥80% coverage
    • 🟡 Yellow: 50-79% coverage
    • 🔴 Red: <50% coverage
  • Per-line hit counts - See exactly how many times each line ran
  • No external dependencies - Single file, works offline

The HTML report includes:

  1. Summary section - Overall percentage, covered/total lines, file count
  2. Progress bar - Visual coverage indicator
  3. File list - Each file with coverage badge
  4. Line details - Expand any file to see line-by-line coverage
┌─────────────────────────────────────────────────┐
│ 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% │ │
│ └─────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
Terminal window
# Generate HTML report
skytest --coverage --coverage-output=coverage.html tests/
# Open in browser
open coverage.html
  • Sharing coverage with team
  • Local development review
  • Offline viewing
  • No external tool dependencies needed

Combine coverage from multiple test runs:

Terminal window
# Run different test suites
skytest --coverage --coverage-output=unit.lcov tests/unit/
skytest --coverage --coverage-output=integration.lcov tests/integration/
# Merge with lcov
lcov -a unit.lcov -a integration.lcov -o combined.lcov
# Generate combined report
genhtml combined.lcov -o coverage-html/

FeatureTextJSONCoberturaLCOVHTML
Human readable
Machine parseable
CI integration⚠️⚠️
IDE support
Self-contained
Function coverage
Hit counts