-
-
Notifications
You must be signed in to change notification settings - Fork 921
Add a api_platform.metadata_cache parameter #1725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a api_platform.metadata_cache parameter #1725
Conversation
|
||
services: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove this line :P
@@ -457,7 +457,11 @@ private function registerBundlesConfiguration(array $bundles, array $config, Xml | |||
private function registerCacheConfiguration(ContainerBuilder $container) | |||
{ | |||
// Don't use system cache pool in dev | |||
if (!$container->getParameter('kernel.debug')) { | |||
if ($container->hasParameter('api_platform.metadata_cache')) { | |||
if (!$container->getParameter('api_platform.metadata_cache')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we merge these?
16cfb89
to
8d3c291
Compare
@dunglas I'm running test at this very moment, but I think it will do the trick for us as that was the There are two things that I see that is a little "blocking": 👍 for api-platform DX, 👎 for the others (ok "=" for the others, but there are no emoji for that 😃)The fact that the user need to set the cache invalidation
After reading your code and making some test, I'm now wondering why you register all the caches as ArrayAdapter in debug mode instead of letting the |
The tests finished to run on our server (I obfuscated the tests name for confidentiality reason) Without optimization:
And then jenkins crashed 😉 With the
|
if (!$container->getParameter('kernel.debug')) { | ||
return; | ||
if ($container->hasParameter('api_platform.metadata_cache') ? $container->getParameter('api_platform.metadata_cache') : !$container->getParameter('kernel.debug')) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent fail on the return?
7b2585f
to
54ef999
Compare
54ef999
to
b4c4023
Compare
@@ -44,6 +44,7 @@ | |||
use Prophecy\Argument; | |||
use Prophecy\Exception\Doubler\MethodNotFoundException; | |||
use Symfony\Bundle\SecurityBundle\SecurityBundle; | |||
use Symfony\Component\Cache\Adapter\ArrayAdapter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless.
b4c4023
to
52a3a32
Compare
Not sure this is the right way to do it, or that the naming is obvious enough... |
Backport #1725 into 2.2 branch.
just a hint that this extremely useful parameter does not seem to be documented, and this comes up on slack at least a few times a week. |
TLDR:
Add the following in
config/packages/test/framework.yaml
to dramatically improve the speed of Behat tests:Follows #1724 (comment)
TODO: fix tests
It's significant on my computer:
Before
Behat: 2m18.08s (2.16Gb)
PHPUnit: Time: 21.17 seconds, Memory: 104.25MB
After
Behat: 0m42.23s (498.70Mb)
Time: 25.72 seconds, Memory: 102.25MB
Can you try with your code base @jdeniau?