[StimulusBundle] Bound the test kernel cache directory and drop dead phpunit env vars - #3850
Merged
Merged
Conversation
…phpunit env vars | Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT `StimulusIntegrationTestKernel::getCacheDir()` derived its path from `spl_object_hash($this)`, the object handle, so the directory changed whenever the allocation pattern did, and nothing ever removed it. On the machine this was written on, the temp directory had accumulated 655 of these directories, 514 MB. The path is now fixed, so there's one known location holding one cache; `getLogDir()` gets the same treatment for consistency. This is about bounding the accumulation, not about test speed: the suite runs in about the same time either way. `phpunit.dist.xml` carried two environment variables inherited from Autocomplete's configuration: `KERNEL_CLASS`, pointing at a `Symfony\UX\Autocomplete\Tests\Fixtures\Kernel` class this package can't autoload, and `DATABASE_URL`, for a database it has no dependency on. Nothing reads either one, since the only `WebTestCase` here overrides `getKernelClass()`. Both are removed.
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.
StimulusIntegrationTestKernel::getCacheDir()derived its path fromspl_object_hash($this), the object handle, so the directory changed whenever the allocation pattern did, and nothing ever removed it. On the machine this was written on, the temp directory had accumulated 655 of these directories, 514 MB. The path is now fixed, so there's one known location holding one cache;getLogDir()gets the same treatment for consistency. This is about bounding the accumulation, not about test speed: the suite runs in about the same time either way.phpunit.dist.xmlcarried two environment variables inherited from Autocomplete's configuration:KERNEL_CLASS, pointing at aSymfony\UX\Autocomplete\Tests\Fixtures\Kernelclass this package can't autoload, andDATABASE_URL, for a database it has no dependency on. Nothing reads either one, since the onlyWebTestCasehere overridesgetKernelClass(). Both are removed.