Skip to the content
Howdah

being built · no release yet

Search

Skip the list of pages

Get started

From an installed gate to a first verdict, then to CI.

Install

Install lists what the gate needs, and installs it with Composer:

composer config repositories.mutation-gate vcs https://github.com/nightworksio/php-mutation-gate
composer require --dev "nightworksio/mutation-gate:dev-main" -W

The first verdict

vendor/bin/mutation-gate init
vendor/bin/mutation-gate doctor
vendor/bin/mutation-gate

init detects your runner, preset and CI, asks what detection leaves open, writes mutation-gate.php, and adds .mutation-gate/ to .gitignore. It also asks where to set up a pre-push hook that judges each push as CI will, and the default answer is the hook manager the project already configures, or git's own hooks. init --no-hook, or --no-interaction, sets up no hook, and vendor/bin/mutation-gate hook uninstall removes git's. doctor says what would fail or run slowly, each finding with its fix and a link to its section of troubleshooting.

The run measures coverage once, mutates every tree and prints each tree's score, then every mutant the tests let through, with its diff, the tests that ran it, what they miss, and the commands that reproduce and explain it. Reading the report says what each part means.

The config init writes gives no tree a floor, so the first run passes and warns. Write the floors it measured, and commit them with the config:

vendor/bin/mutation-gate baseline --write
git add .gitignore mutation-gate.php mutation-gate.baseline.json

From then on a score may not fall below its floor, and baseline --write raises the floors when scores improve.

In CI

vendor/bin/mutation-gate init --ci writes the definition for the CI it detects. On GitHub Actions it uses this repository as an action, pinned to the commit of the gate you installed, and the action runs the copy your composer.json requires. The comment jobs init writes for GitLab and Bitbucket run the gate's container image, which only a release publishes. Running the gate in CI has a page for each CI.

What the gate does, and why its verdict can be trusted: features.

New to mutation testing: reading the report says what the report shows, what is good and what is not, and what to do next.

Setting up CI: running the gate in CI, then the page for your CI, then proofs and trust before you give any job a credential.

Speeding up a slow suite: holding tests for code every test runs through, and the shards, budget and pest.patch keys in the configuration.

Working locally: the pre-push hook and watch mode, and survivors in your editor.

When the gate refuses, fails or warns: each finding doctor prints links to its section of troubleshooting.

Extending the gate: extending the gate lists every extension point and its contract.

The reference lists every command, configuration key, report, environment variable and file, and says what an upgrade may change in compatibility.