Skip to content

Count functional tests towards code coverage - #95

Merged
loevgaard merged 2 commits into
2.2.xfrom
code-coverage-test-application-2.2.x
Oct 19, 2026
Merged

loevgaard merged 2 commits into
2.2.xfrom
code-coverage-test-application-2.2.x

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Follow-up to Setono/sylius-plugin#5, released in setono/sylius-plugin 2.5.0. The code-coverage action now sets up the test application like functional-tests does: MySQL, assets, schema and fixtures. It then runs all PHPUnit suites with pcov, so the functional suite's coverage counts towards the 90% Codecov target. The skeleton uses code-coverage@v2, so that part needs no workflow change. This PR's CI run is the first skeleton run on the new action.

Changes

  • build.yaml: pass symfony: "~7.4.0" to the coverage job, the new input 2.5.0 added, like the matrix jobs do.
    • Flex's SYMFONY_REQUIRE also holds the Symfony packages that only arrive transitively (symfony/var-exporter, symfony/type-info, …) to 7.4.
    • Today this changes nothing: the action defaults to PHP 8.3, where Symfony 8 can't be installed.
    • On PHP 8.4, unpinned, Symfony 8 components would mix into the 7.4 application, and symfony/var-exporter 8 breaks the kernel boot with doctrine/orm 3.6 ("Symfony LazyGhost is not available").
    • In the tests for Measure code coverage with the test application's database, so functional tests count sylius-plugin#5, PHP 8.4 with ~7.4.0 locked 0 of 76 Symfony packages at 8.x, and the functional tests passed.
  • CLAUDE.md:
    • The coverage gate now says unit and functional tests both count.
    • The local --coverage-text check notes that the functional suite needs the test application's database.
    • The CI section describes the coverage job's setup.

setono/sylius-plugin 2.5.0 gave the code-coverage action a symfony input, which
it passes to Flex as SYMFONY_REQUIRE like the matrix jobs do. Without it, the
Symfony packages that only arrive transitively (symfony/var-exporter,
symfony/type-info, ...) are not held to 7.4. That is harmless on the action's
default PHP 8.3, where Symfony 8 can't be installed, but on PHP 8.4 it mixes
Symfony 8 components into a 7.4 application. symfony/var-exporter 8 then breaks
the kernel boot with doctrine/orm 3.6 ("Symfony LazyGhost is not available"),
which is exactly what the functional tests in the coverage job now do.
Since setono/sylius-plugin 2.5.0, the code-coverage action sets up the test
application like the functional tests do (MySQL, assets, schema, fixtures), so
the functional suite's coverage counts towards the 90% target.
See Setono/sylius-plugin#5.
@loevgaard
loevgaard merged commit 4a4855c into 2.2.x Oct 19, 2026
94 checks passed
@loevgaard
loevgaard deleted the code-coverage-test-application-2.2.x branch October 19, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant