Repository navigation
Fix booting the test application in the prod environment - #100
Merged
Merged
Conversation
The prod Doctrine config wired the ORM caches through Symfony\Component\Cache\DoctrineProvider, which Symfony 6 removed, so the prod container failed with a ClassNotFoundError. The caches now use DoctrineBundle's pool type, which takes the PSR-6 pools directly. Reported in Setono/sylius-conversion-attribution-plugin#14
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.14.x #100 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 2 2
===========================================
Files 2 2
Lines 16 16
===========================================
Hits 16 16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test application's
prod/doctrine.yamlwired the ORM metadata, query and result caches throughSymfony\Component\Cache\DoctrineProvider. Symfony 6 removed that class, so the prod environment didn't boot:The caches now use DoctrineBundle's
poolcache type, which takes the existingdoctrine.system_cache_poolanddoctrine.result_cache_pooldirectly. The separate provider services are gone.Reported in Setono/sylius-conversion-attribution-plugin#14. That plugin runs its e2e tests in prod and had to keep its own copy of this file.
Verification
With Sylius 1.14.21, Symfony 6.4.49 and DoctrineBundle 2.19.3 on PHP 8.1:
APP_ENV=prod bin/console cache:clearfails with the error abovelint:containerpasses. Booting the prod kernel with debug off givesPhpFilesAdapterfor the metadata and query caches andFilesystemAdapterfor the result cachelint:yamlpass