Skip to content

fix(tests): exit non-zero when the TestBootstrapper cannot be found - #224

Merged
Jozsef Damokos (jozsefdamokos) merged 3 commits into
trunkfrom
fix/phpunit-bootstrap-exit-code
Sep 10, 2026
Merged

Jozsef Damokos (jozsefdamokos) merged 3 commits into
trunkfrom
fix/phpunit-bootstrap-exit-code

Conversation

@jozsefdamokos

@jozsefdamokos Jozsef Damokos (jozsefdamokos) commented Sep 9, 2026 •

Copy link
Copy Markdown
Member
  1. exit('message') terminates with status 0, so failing to locate the platform TestBootstrapper left the PHPUnit job green with zero tests executed — this writes to stderr and exits 1 instead.
  2. Add codecov

Part of shopware/shopware#18667.

exit('message') terminates the process with status 0, so a failure to locate
the platform TestBootstrapper left the PHPUnit job green with not a single
test executed. The three fallback paths exist because the platform layout
already moved twice (shopware/platform monorepo, shopware/core split,
in-tree), so a third move would have silently greened this job.

CompletionGuard cannot cover this: it is registered inside
TestBootstrapper::bootstrap(), which is never reached here.

Refs shopware/shopware#18667
Only the Integration workflow opts in: it runs on pull requests and on push to
trunk, so Codecov gets the trunk baseline its project status compares against.
Nightly runs the same suite and would add nothing.

.github/codecov.yml sets the project and patch thresholds. Neither status is a
required check in this repository, so a coverage drop reports red without
blocking a merge. CODECOV_TOKEN is an organization secret already available
here, so no new secret is needed.

Refs shopware/shopware#18667
SwagCmsExtensions, SwagSocialShopping and SwagPublisher all upload clover from
an absolute working directory with root_dir set, and so does
shopware/github-actions/phpunit. Matching that keeps the four migration
repositories from being a fifth dialect, and clover is the format the PHPUnit
shipped with Shopware 5 also understands, so every repository can use one.

Drops .github/codecov.yml: no other plugin ships one, Codecov posts both
statuses from its own defaults without it, and the file only replaced those
defaults with the platform's tolerances. It also failed the admin lint job,
which prettier-checks .github/**/*.yml.

Replaces #[CoversClass(MigrationLogEntry::class)] with the abstract class the
test actually exercises. MigrationLogEntry is an interface, which PHPUnit
rejects as a coverage target, and with failOnWarning="true" that turned the
suite red for all 37 tests in the class as soon as coverage was switched on.
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@jozsefdamokos
Jozsef Damokos (jozsefdamokos) merged commit bd95438 into trunk Sep 10, 2026
16 of 17 checks passed
@jozsefdamokos
Jozsef Damokos (jozsefdamokos) deleted the fix/phpunit-bootstrap-exit-code branch September 10, 2026 09:31
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.

4 participants