liip / liip/LiipFunctionalTestBundle
Enabling bundle causes significant overhead?
- Dominant language
- PHP
- Stars
- 648
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
Hi all,
I'm working on an app using Symfony4.1 and I noticed my testsuite becoming incredibly slow with this bundle enabled. Some debugging showed me that the container is initialized multiple times per test, causing the cache to get recreated also.
I refactored my test to use the WebTestCase provided by Symfony rather than the one provided by this bundle. That already helped somewhat. If I disable the bundle completely in bundles.php, the issue vanishes completely.
In the end, the time required for 1 test class with 2 tests drops from 1.5m to 4s.
### Preconditions
1. Symfony 4.1
2. PHP 7.2
3. Bundle version 2.0@alpha
### Steps to reproduce
1. Enable bundle using Symfony Flex
2. Create functional test extending WebTestCase from this bundle
3. Execute some tests using the client and grab some services from the container in the test
### Expected result
1. Container should not be recompiled every time.
### Actual result
1. Some debug output in Kernel.php shows me that the container is initialized multiple times and the cache warmer is executed also every time.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the Symfony 4.1 case with the bundle enabled, using the bundle's WebTestCase and a functional test that uses the client and container. Inspect the debug output from Kernel.php and compare behavior after disabling the bundle in bundles.php. Done means the container and cache warmer are not recreated for every test and the reported test slowdown is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- performance, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100