- How do I install d0x2f/clover-merge for a Laravel project?
- Install it as a Composer dev dependency, for example with composer require --dev d0x2f/clover-merge. It is a CLI and CI utility, not a runtime Laravel package, so it should not be added to production dependencies. Run it after your PHPUnit or Pest jobs have generated their Clover XML files.
- Does d0x2f/clover-merge work with PHPUnit and Pest coverage reports?
- Yes. It merges Clover XML coverage reports, which both PHPUnit and Pest can produce when coverage output is configured as Clover. The tool is framework-agnostic and does not care whether the XML came from Laravel feature tests, unit tests, or split suites. Make sure each test job writes a distinct Clover file before running the merge.
- How do I merge coverage from parallel Laravel test runs in CI?
- Configure each parallel PHPUnit or Pest job to emit its own Clover XML file, then run d0x2f/clover-merge once after all jobs finish to combine those files into a single report. This gives dashboards and coverage services one coherent artifact instead of several fragments. The merge step can live in a dedicated CI job that depends on the test shards.
- Is d0x2f/clover-merge compatible with PHP 8 and Laravel 10 or 11?
- The package is framework-agnostic and does not integrate with Laravel at runtime, so Laravel version compatibility is mainly about running it on the PHP version in your CI image. You should confirm the exact PHP and Composer constraints declared by the v1.0.5 release before adoption. A quick install and merge in a test pipeline is the safest compatibility check.
- How does the --enforce threshold flag work in v1.0.5?
- Version 1.0.5 adds a --enforce or -e flag that lets the command act as a coverage gate by failing when coverage does not meet a configured threshold. It is intended to collapse the merge and gate steps into one CI invocation. Before relying on it, verify whether the threshold is evaluated against merged totals, whether it uses line coverage only, and how boundary values are handled.
- Does clover-merge write the merged file when coverage enforcement fails?
- Check the release notes and README, because this behavior determines whether a failed build still publishes an artifact for debugging. Do not assume the output file is written on a threshold failure. A short proof of concept should test a passing merge, a below-threshold merge, and a malformed input case.
- Are exit codes from clover-merge different for low coverage and bad input?
- The package's exit-code semantics need to be confirmed in its documentation and tested in your pipeline. You want to distinguish coverage below threshold from missing or malformed Clover XML so CI can report the right failure. If the codes are not distinct, wrap the command in a small script that inspects output or pre-validates inputs.
- Can I use d0x2f/clover-merge as my only coverage gate in CI?
- It can serve as a merger and, in v1.0.5, optionally as a threshold gate. However, the package is old and low-adoption, so making it the sole pass or fail authority increases build risk. Teams with existing coverage-gate tooling should keep clover-merge as the merger and let the established gate handle enforcement.
- What are alternatives if clover-merge is abandoned or breaks?
- Fallbacks include a small custom Clover merger script, built-in or third-party PHPUnit coverage merging workflows, or a maintained coverage aggregation tool in your CI stack. Because Clover XML is a known format, the logic can be reproduced if necessary. Keep the merge step isolated so it can be replaced without changing test jobs.
- How should I test clover-merge before adding it to a Laravel pipeline?
- Run a proof of concept with real Clover files from your Laravel test suite, including multiple inputs, parallel shards, and an intentionally empty or missing file. Confirm that per-file metrics are preserved and totals match your existing coverage reports. If using --enforce, also test exactly-at-threshold and below-threshold cases and inspect the exit codes and output artifacts.