Skip to content

How it works

From the first agent to a pull request check

Four steps. The first two produce coverage; the last two put it to work in review and CI. A pilot usually starts with one service and one suite.

The steps

  1. 01

    Attach an agent to each service

    Register the agent in CoverOps and start the service with it. On Kubernetes, a mutating webhook attaches the Java and Node.js agents to any pod with the coverageops.io/attach annotation.

    java -javaagent:coverageops-agent.jar -jar app.jar
    NODE_OPTIONS="--require @coverageops/node-agent/register" node server.js
  2. 02

    Let each test say who it is

    Coverage is attributed to a test through the X-CoverageOps-Test header. The Playwright and Cypress plugins and the JUnit 5 extension set it; any other client (Postman, k6, your own) sends it on its requests. For manual testing, start a monitoring run and stop it when the testing ends.

  3. 03

    Read coverage and impact

    Each run shows coverage per service, file and test. The Impact screen matches a window of commits from your repository against the tests' footprints and lists the tests that reached the change, the changed lines nothing reached, and a risk ranking.

  4. 04

    Put it in the pipeline

    The CLI uses the agent token the pipeline already has.

    coverageops select --base origin/main --format skip   # or pytest --coverops-select,
                                                           # COVERAGEOPS_SELECT=true for JUnit 5 / TestNG
    coverageops gate --base origin/main --min-changed 80

    Selection skips only tests whose recorded footprint misses the change. A new test, a test with no footprint and a test whose own file changed always run, and when the change touches code no agent measures the whole suite runs.

    The gate exits 0 (pass), 1 (fail) or 2 (misconfigured) and posts a commit status to GitHub, GitLab, Azure DevOps or Bitbucket. The gate endpoint answers every request with a verdict and leaves the decision to the pipeline.

Agents by language

Setup and measurement differ by runtime. This is what each agent needs and reports.

What each CoverOps agent measures and how it attaches
LanguageHow it attachesLine and method coverageBranch coveragePer test
Java (JVM)One -javaagent flagYesYesLines each test ran
Node.jsOne --require (or NODE_OPTIONS) entryYesYesLines each test ran
.NETA post-build weaving step and a startup hookYesNoLines each test ran
PHPauto_prepend_file, with the pcov or Xdebug extensionYesNoLines each test ran
PythonThe agent package and a one-line WSGI or ASGI middlewareYesNoLines each test ran
GoBuild with -cover -covermode=atomic and add the middleware (a code change)YesNoLines each test ran

Where CoverOps runs

Cloud

The hosted service on AWS in Frankfurt (eu-central-1). Nothing to install besides the agents.

Private cloud or on-prem

Docker Compose, Helm or Terraform in your own infrastructure, with install, backup and health-check scripts.

Air-gapped

An offline bundle for networks without internet access, licensed with a signed licence file.

Which options a package includes is on the pricing page; what is stored, and where, is on the security page.

Plan the first service with us

In a demo we pick the service and suite to start with and show what the agent setup looks like on your runtime.