Skip to content

Adopt SimpleCov's run-visibility model: staleness, an env convention, and an off-vs-broken signal #276

Description

@pftg

Scheduled for after v2.0 and v2.1. Filed now so the reasoning is not lost.

Why SimpleCov specifically

It is the closest Ruby analogue this project has: a gem that instruments a test run, accumulates results across processes, writes an HTML report, and has to be switchable off. It has solved both of the problems we solved recently — and it solved them years earlier, with far more users exercising the edges.

We have just shipped our own versions of both:

The question is not whether ours works — it is measured and guarded. It is whether SimpleCov already knows something about the edges we have not hit yet.

What to look at

Result merging:

  • SimpleCov.use_merging, merge_timeout, and SimpleCov::ResultMerger — how results are keyed, where they are stored, how staleness is decided, and what happens to a fragment from a worker that died.
  • How it decides a run is "complete" versus "one process of several". We use the parent's after_run; what does it use, and does it handle runners we do not?
  • SimpleCov.at_exit / at_fork and how it hooks parallel runners (parallel_tests, Knapsack, CI shards). Our fix: the HTML report survives Rails' fork-parallel test runs (#258) #266 solves Rails fork-parallelism only — separate-process runners still get last-writer-wins, documented but unfixed.
  • Whether merged output can be misleading, and what it does about it.

Enable/disable:

  • SimpleCov.start semantics, SIMPLECOV_NO_DEFAULTS, --no-cov-style switches, and what happens when it is loaded but not started.
  • minimum_coverage failing with exit code 2 — a distinct code for "the tool ran fine, your content failed the gate", which we noted in research/competitive-landscape.md and have not adopted.
  • How it reports "nothing was measured", if at all. Our equivalent is the NOTHING WAS VERIFIED line, and we should know whether they concluded something different.

Triage question this must answer

Does any of it actually impact us, or is it interesting and inapplicable? A well-evidenced "no, our shape is different and here is why" is a perfectly good outcome and should be written down so it is not re-asked. Specifically: SimpleCov merges coverage data (mergeable by construction — union of line hits), while we merge assertion records and image paths. That difference may make most of their design irrelevant, or may be exactly why their staleness handling matters more than ours does.

Method: read the source, not blog posts. Cite file:line. Add findings to research/competitive-landscape.md, which already has SimpleCov entries for its threshold failure and its 🎨 Colorblind report toggle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-evidenceMaintainer idea; unproven. Needs demand or measurement before scheduling.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions