Japan Voyage Code Coverage

Track Your Test Coverage

Japan Voyage Code Coverage is a self-hosted test coverage tracking service. Upload coverage data from CI, view per-file reports, compare branches, and embed badges in your README.

Features

Everything you need to track and improve your test coverage

Coverage Tracking

Upload coverage data from your CI pipeline. View line-by-line coverage for every file with highlighted hit/miss indicators.

Badge Generation

Embed dynamic SVG coverage badges in your README. Badges auto-update with every build and use color coding for quick status checks.

Branch Comparison

Compare coverage between branches. See exactly which files gained or lost coverage in a pull request before merging.

Quick Start

Get Japan Voyage Code Coverage running in 4 steps

1

Sign in with GitHub & create a project

Sign in with your GitHub account, then add a new project from the dashboard. You'll receive an API token for uploading coverage data.

2

Add the gem to your Gemfile

# Gemfile
group :test do
  gem "simplecov", require: false
  gem "simplecov-japan-voyage", require: false
end

Then run <code class="bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-sm">bundle install</code>.

3

Configure test_helper.rb

# test/test_helper.rb (or spec/spec_helper.rb)
require "simplecov"
require "simplecov_japan_voyage"

SimpleCov.start "rails" do
  add_filter "/test/"
  add_filter "/config/"
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCovJapanVoyage::Formatter
])

The formatter reads <code class="bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-sm">VOYAGE_COVERAGE_TOKEN</code> from ENV automatically. When absent (local dev), it skips the upload silently.

4

Set VOYAGE_COVERAGE_TOKEN in CI

# .github/workflows/ci.yml
- name: Run tests
  env:
    RAILS_ENV: test
    VOYAGE_COVERAGE_TOKEN: ${{ secrets.VOYAGE_COVERAGE_TOKEN }}
  run: bin/rails test

Add the project's API token as a repository secret in your CI provider. The gem defaults to <code class="bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-sm">https://coverage.japanvoyage.jp</code>.

API Reference

RESTful endpoints for Japan Voyage Code Coverage

POST /api/v1/builds

Upload a coverage build. Requires token authentication.

Authentication

Authorization: Bearer <VOYAGE_COVERAGE_TOKEN>

Request Body (JSON)

{
  "commit_sha": "abc123",
  "branch": "main",
  "commit_message": "Add tests",
  "commit_author": "dev@example.com",
  "covered_percent": 87.5,
  "lines_covered": 1750,
  "lines_missed": 250,
  "lines_total": 2000,
  "ci_service": "github_actions",
  "ci_build_url": "https://github.com/...",
  "files": [
    {
      "file_path": "app/models/user.rb",
      "covered_percent": 95.0,
      "lines_covered": 19,
      "lines_missed": 1,
      "lines_total": 20,
      "line_coverage": [1, 1, null, 0, 1, ...]
    }
  ]
}

Response (201 Created)

{
  "id": 42,
  "covered_percent": 87.5,
  "coverage_delta": 1.2,
  "url": "https://coverage.japanvoyage.jp/projects/my-app/builds/42"
}
GET /api/v1/status/:badge_token

Get the latest coverage status for a project. Public, no authentication required.

Response (200 OK)

{
  "project": "my-app",
  "branch": "main",
  "covered_percent": 87.5,
  "lines_covered": 1750,
  "lines_missed": 250,
  "lines_total": 2000,
  "commit_sha": "abc123",
  "created_at": "2026-02-26T10:00:00Z"
}
GET /badges/:badge_token.svg

Returns a dynamic SVG coverage badge. Public, no authentication required. Cached for 5 minutes.

Badge Colors

90%+ (bright green) 80-89% (yellow-green) 70-79% (yellow) 60-69% (orange) Below 60% (red)

Badge Examples

Add a Japan Voyage Code Coverage badge to your project README

Markdown

![Japan Voyage Code Coverage](https://coverage.japanvoyage.jp/badges/YOUR_BADGE_TOKEN.svg)

HTML

<img src="https://coverage.japanvoyage.jp/badges/YOUR_BADGE_TOKEN.svg" alt="Japan Voyage Code Coverage">

Configuration

Environment variables for the Japan Voyage Code Coverage formatter

Variable Required Default Description
VOYAGE_COVERAGE_TOKEN Yes Project API token from the dashboard. Upload is skipped when absent.

Ready to track your coverage?

Sign up for Japan Voyage Code Coverage and start uploading data from your CI in minutes.