From 3138481f0769f0f475a30186186a90b7643c099b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Sat, 3 Oct 2026 18:14:33 +0300 Subject: [PATCH] test: exclude the overhead benchmark from the coverage job PCOV instrumentation inflates wall-clock timings, so the GR-8 2% budget flaked in the coverage job (2.01-2.06%) on CI-only changes. The benchmark is now in the 'benchmark' group and excluded there; the uninstrumented PHP matrix jobs still enforce the budget. --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- tests/OverheadBenchmarkTest.php | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b776a7c..12d747e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: Install dependencies run: composer update --prefer-dist --no-interaction --no-progress - name: Tests with coverage - run: vendor/bin/phpunit --coverage-clover=coverage.xml + run: vendor/bin/phpunit --coverage-clover=coverage.xml --exclude-group benchmark - name: Enforce coverage gate run: php bin/check-coverage.php coverage.xml 90 diff --git a/composer.json b/composer.json index d6958c2..6c6190a 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "scripts": { "analyse": "phpstan analyse", "test": "phpunit", - "test:coverage": "phpunit --coverage-clover=coverage.xml", + "test:coverage": "phpunit --coverage-clover=coverage.xml --exclude-group benchmark", "coverage:check": "php bin/check-coverage.php coverage.xml 90" }, "config": { diff --git a/tests/OverheadBenchmarkTest.php b/tests/OverheadBenchmarkTest.php index 59e0626..aaf0753 100644 --- a/tests/OverheadBenchmarkTest.php +++ b/tests/OverheadBenchmarkTest.php @@ -6,6 +6,7 @@ use BabelQueue\Codec\EnvelopeCodec; use BabelQueue\Contracts\PolyglotJob; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; /** @@ -14,7 +15,11 @@ * conservative broker round-trip. Pure CPU — no broker — so the gate is stable and * environment-independent in CI. The same methodology + reference is used by every * SDK's equivalent benchmark. + * + * Grouped as `benchmark` so the coverage job (PCOV instrumentation inflates wall-clock + * timings) excludes it; the uninstrumented PHP matrix jobs still enforce the budget. */ +#[Group('benchmark')] final class OverheadBenchmarkTest extends TestCase { /**