Repository navigation
Associate code coverage with test runs and steps - #75
Merged
Merged
Conversation
An extension (extensions/code-coverage) reads the LCOV or Istanbul coverage an app handed over as step attachments, works out per-step differences (baseline, restarts, gaps) and writes results/<name>.code.tsv. Expectation reads it (story::codecov) and shows a separate, labelled Code coverage section on the test's page, apart from the result: totals by step, what each step added, the instrumented revision and scope, and a link to a separately hosted report. Captures count only for their own run and test fingerprint, and missing or unreadable captures are shown as that, not as zero. Closes #73 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust: story::sidecar holds what every extension file shares (finding files by kind and platform, the size cap, field cleaning, run/test crediting); contract coverage and code coverage both use it, and results are told from extension files by one registry of kinds. JS: extensions/kit holds the results reader, attachment finder (links can't leave the directory) and record writer; both extensions use it. Code coverage fixes from review: parse errors in the manual are fixed messages, never the file's words; a counter that goes down or something that stops being counted is a restart; the same line in two files is one line; a step must hold the same files as the first; a .info or coverage.json that isn't coverage is ignored; Istanbul functions are keyed by id; 'spans' is now 'since' so it can't be confused with HAR's; the default output is <runner>.code.tsv; plurals, unique ids and URL encoding. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ptescher
marked this pull request as ready for review
November 9, 2026 19:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #73. An extension (
extensions/code-coverage) associates LCOV or Istanbul coverage that an app handed over as step attachments with the run, test and step, and writesresults/<runner>.code.tsv. Expectation reads it (story::codecov) and adds a labelled Code coverage section to each test page (HTML and Markdown): totals at the start and after each step, what each step added, the instrumented revision and scope, and a link to a separately hosted report.Limits, on purpose: observed execution only (never touches a result or verdict); captures count only for their own run and test fingerprint; missing or unreadable captures are shown as that, not as zero; a step's part is attributed only when counters were cumulative and never went down (restarts and gaps are labelled); raw files stay out of the manual and error notes never quote them.
Shared core:
story::sidecar(Rust: file discovery by kind and platform, size cap, field cleaning, run/test crediting) is used by both contract coverage and code coverage;extensions/kit(JS: results reader, attachment finder that refuses paths leaving the directory, record writer) is used by both extensions. Reviewed by an Opus subagent; its defects are fixed here.Tests: Rust unit and docs tests, kit and extension unit tests, and an end-to-end test (JS client → runner → extension →
expectation docs) run in CI.Stacked on #74 (the JS client's
onAttachments).🤖 Generated with Claude Code