Share a SimpleCov coverage report

Every Ruby project has the same ritual. CI prints Line Coverage: 78.4%, someone screenshots it, and the actual report — the one that shows which lines are uncovered — never leaves the runner.

SimpleCov's default formatter writes a real, browsable artifact:

coverage/
  index.html
  assets/0.12.3/…      # css, js, DataTables, the sort widgets
  .last_run.json

Which is a folder, not a file. That is the whole reason it never gets shared.

Publish the folder

Drag coverage/ (or a zip of it) into the app:

  • index.html becomes the report body.
  • assets/ uploads alongside it with the relative references rewritten to the uploaded copies.
  • Scripts run inside a sandboxed iframe, so the group tabs, the sortable file table and the per-file source view all work.

From CI

# spec/spec_helper.rb
require "simplecov"
SimpleCov.start "rails"
bundle exec rspec

curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html coverage/index.html \
        --arg title "Coverage — $GITHUB_SHA" '{title: $title, html: $html}')"

PATCHing one report id per repository keeps a single URL for "our coverage" and appends a revision per run — so a drop is a diff between two revisions instead of a number someone half-remembers from last sprint.

Wrap the publish step so it runs on failure too (if: always() on GitHub Actions, when: always on GitLab and CircleCI, post { always { … } } on Jenkins).

What review adds

Coverage arguments are never about the percentage. They are about which uncovered lines matter:

  • Anchored threads on the file or the line range — see commenting on HTML.
  • Revisions so a coverage cliff has a visible before and after.
  • Access per report — private, team, domain-gated, or named reviewers. See the sharing model.

Limits

  • Entry HTML: 5 MB. A monolith's file index can get close; SimpleCov groups help. Assets: 25 MB per file, 250 MB and 500 files total.
  • 60 requests/minute per token.

Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision history.

Publish a coverage report →

Related