What does one pull request cost to test?

A monthly CI bill tells you what you spent. A per-PR estimate helps explain which work, retries, and pipeline choices contributed to it.

PRLane EditorialPublished 3 min read
Track the cost per PR.
On this page

A pull request changes three lines. Its pipeline builds the application, runs integration tests, and starts an end-to-end suite. Then someone pushes a correction and the process starts again.

The size of the diff tells you very little about the cost of testing it. To understand that cost, follow the jobs associated with the pull request, including retries and subsequent commits.

Start with a deliberately simple estimate

For each billable job, multiply its runtime by the applicable runner rate. Add those estimates across the runs associated with the PR:

Estimated PR CI cost = sum of job runtime × applicable runner rate.

Keep the units consistent. A rate quoted per minute needs runtime in minutes. Different runner types may have different rates, so do not multiply every job by one blended number unless you explicitly label that approximation.

For an illustrative calculation, suppose three jobs each run for ten minutes at a hypothetical rate of $0.02 per minute. The estimated cost is $0.60. If all three jobs run again, the combined estimate becomes $1.20. These are example inputs, not a claim about a particular provider's pricing.

CI cost reflects the runner matrix, repeated jobs, and billable duration.

Count repeated work, not just the final green run

A PR's final successful run can hide the expensive part of its history. Include failed attempts, reruns, and superseded runs when they consume billable resources. Otherwise, the estimate rewards pipelines that look clean only after several attempts.

Decide what belongs to the PR before comparing totals. A branch push may trigger several workflows. A shared nightly suite may not belong cleanly to any single change. Record the attribution rule rather than assigning shared work arbitrarily.

Keep these categories separate when possible:

  • Jobs triggered by a new commit.
  • Reruns of the same commit.
  • Work cancelled after a newer commit arrived.
  • Shared or unattributed pipeline work.

Use cost to ask a better question

A high estimate is a starting point for investigation, not proof of waste. A database migration may justify more testing than a documentation update. An expensive job can be valuable if it detects a failure that cheaper checks miss.

Look for repeated patterns: a flaky suite restarted without a code change, an oversized runner doing lightweight work, or a long-running test triggered by changes outside its relevant scope. Inspect the workflow and its coverage before reducing anything.

For example, if README-only updates repeatedly launch an application build, investigate whether path-based filtering would be safe. Do not assume the filter is harmless: documentation examples, generated references, or packaging steps may still depend on that build.

Treat the estimate as an operational signal

PRLane's Fleet cards show estimated CI cost for individual pull requests while their jobs run. That makes the number useful during triage, when someone can still investigate a stalled or unexpectedly expensive run.

It is not an invoice reconciliation tool. Provider billing rules, included usage, discounts, and charges outside the tracked jobs can create differences between an estimate and the amount billed.

The useful outcome is a better decision: investigate a costly rerun pattern, right-size a job, or leave an expensive but necessary check alone. Review the change afterward using both cost and test reliability. Saving compute is not a win if important failures stop being detected.

Related guide: How to Hand Failing CI to a Coding Agent.

Sign up for PRLane to see your pull requests together and put CI cost in context.

ShareLinkedInX
Filed underCI

PRLane Editorial

The people who build PRLane

We build PRLane, a dashboard for managing GitHub pull requests from people and coding agents across many repositories. These guides come from running that workflow on our own repositories every day.

Get new guides by subscribing or with the RSS feed.

Get your PR fleet under control

Connect GitHub, see every open pull request across your repositories, and start merging the ready ones. The Free plan has no monthly fee.