Pre-release. Parity is not publicly available yet: the CLI, the GitHub Action and the hosted workspace open at launch. The demo runs on example data.

Skip to content

Behavioural regression testing for APIs

Your code changed.
Did its behaviour?

Parity compares how your APIs actually behave, catching unintended changes before they reach production.

Free CLI. Runs on your machine and in CI. No account required.

Install and first run
# Build the CLI from source (needs a Rust toolchain)
git clone https://github.com/x1991labs/parity && cd parity
cargo install --path crates/parity-cli

# In your API's repository
parity init
parity compare

Demo data — the Shop API example from this repository, with deliberately seeded regressions.

Open the full demo

This is the real comparison view on a real engine report. Step 3 answers 200 in both versions; only reading the order back in step 4 shows that the candidate never saved the discount.

Two ways to run it

Compare two running versions from your terminal while you work, then let CI make the same comparison on every pull request.

01Compare

Start the version you trust and the version under review, then run parity compare. Parity sends every scenario to both, compares the responses under your rules, and names each difference by its path.

parity report --open turns the same run into a self-contained HTML report.

examples/shop-api
$ parity compare

  baseline   http://localhost:8080
  candidate  http://localhost:8081
  scenarios  89 from 3 sources · seed 42 · concurrency 8

  ✗ GET /products/{sku} · valid request  openapi · 2ms
      ~ `$.price` changed type from number to string (39.99 → "39.99").
      + `$.currency` was added ("EUR").

  ✗ Order lifecycle with discount  workflow · 4 steps · 3ms
      step 4 · Retrieve the order · GET /orders/ord_1014
      ~ `$.discount` changed from {"code":"WELCOME10","percent":10} to null.
      ~ `$.total` changed from 57.59 to 63.99 (Δ +6.4).

  …  12 more changed scenarios

  ? GET /health · valid request
      Every difference also appears between two runs of the baseline, so it
      cannot be attributed to the candidate. Add ignore rules for: $.uptime_ms.

  89 scenarios  ·  73 unchanged  ·  14 changed  ·  2 inconclusive
  42 differences · 209 requests · 0.0s · seed 42

  ✗ Behaviour changed in 14 of 89 scenarios
    policy: 14 scenarios with behavioural changes → exit 1

Real output from the Shop API example, trimmed.

02CI

The GitHub Action runs the same comparison in your workflow, writes the differences to the job summary, attaches the reports, and fails the job by exit code.

Make it a required status check to stop unreviewed behaviour changes from merging.

.github/workflows/parity.yml
- name: Check API behaviour
  uses: x1991labs/parity-action@v1
  with:
    baseline: http://localhost:8080
    candidate: http://localhost:8081
    config: parity.yaml

Pre-release: the action lives in this repository and is not on the Marketplace yet. See the GitHub Actions guide for how to use it today.

Exit codes
0No policy violation
1Behavioural changes
2Environment errors — nothing can be concluded
3Invalid configuration or usage
4Inconclusive, or nothing was compared

Watch — continuous comparison of deployed environments — is planned and not available yet.

What it does differently

Four properties, each with the example from this repository that demonstrates it.

Stateful workflows, one variable context per environment

A workflow creates a resource, extracts its identifier and uses it in later steps. Each environment keeps its own variables, so an ID generated by the baseline is never sent to the candidate.

Extracted values are correlated automatically: two different order IDs that mean the same order are not a difference. The state behind them is.

StepBaselineCandidate
POST /orders201 · order_id = ord_1014201 · order_id = ord_af278cf8fa
POST /orders/{{order_id}}/discount200200
GET /orders/{{order_id}}discount.code = WELCOME10 · total 57.59discount = null · total 63.99
Order lifecycle with discount, from the Shop API example. The identifiers differ and are not reported; the missing discount is.

Three distinct outcomes

A behavioural change, an environment that could not be reached, and a comparison that proved nothing are different facts, and Parity never folds them into one red mark.

Each has its own exit code and its own policy, so an outage in the test environment cannot be mistaken for a regression — or for a pass.

  • Changed

    `$.price` changed type from number to string (39.99 → "39.99").

  • Environment error

    The candidate environment failed: connection refused. This is an infrastructure failure, not a behavioural result.

  • Inconclusive

    Every difference also appears between two runs of the baseline, so it cannot be attributed to the candidate.

Messages as the CLI prints them. A run with only environment errors exits 2, never 1.

Deterministic

No model decides a result. Scenarios are generated from your OpenAPI document by fixed rules and a seed; the same document and seed give the same scenarios, in the same order.

Comparison is a pure function of the two responses and your rules. A difference is reported with its path and both values, so you can check it by hand.

  ✓ openapi   openapi.yaml  82 scenarios
  ✓ workflow  tests/parity  5 scenarios
  ✓ request   tests/requests.yaml  2 scenarios

  89 scenarios selected (60 mutating) · seed 42 · sha256:ebc8d505a4c8
Output of parity validate in the Shop API example. The fingerprint covers the comparison and generation settings.

Runs where your code runs

The CLI runs on your machine or your CI runner and talks to your environments directly. Nothing has to be reachable from the internet, and no account is needed.

The hosted workspace is optional and only ever receives finished, redacted results. See security and data handling.

{
  "method": "GET",
  "url": "http://localhost:8080/orders/ord_1014",
  "headers": {
    "accept": "application/json",
    "authorization": "[REDACTED]"
  }
}
A request as recorded in the report. Credentials are replaced before the report is written to disk.

How it works

  1. 01

    Point it at two versions

    A baseline you trust and a candidate under review — two local processes, two containers in CI, or two test deployments.

  2. 02

    Give it scenarios

    Generated from an OpenAPI 3 document, written as YAML workflows or single requests, or imported from a Postman collection.

  3. 03

    It runs both and compares

    Each request goes to both environments. Status, chosen headers and JSON bodies are compared under your ignore, tolerance and array rules.

  4. 04

    Read the verdict

    A terminal summary, a JSON report, optional HTML, JUnit and Markdown, and an exit code your pipeline can act on.

Parity compares the scenarios it is given. An unchanged result means those scenarios behaved the same in both versions — not that the two versions are equivalent.

Pricing

The CLI is free. The hosted workspace is optional.

Free

$0no account required

The CLI and everything it does on your machine and in CI.

Pro

$9.99per month

A hosted place to keep runs and review what changed.

TeamProposed pricing

$19.99per seat, per month

Shared review for teams that gate releases on behaviour.

Billing is not live yet — it runs in test mode only, and nobody is charged. Prices may change before launch. The CLI and basic CI use stay free.

Compare plans

Try it on the example in five minutes

Two local servers, one command, fourteen changed scenarios to read through.