Do not run CLEAN section of PHPT test in separate process when it is free of side effects that modify the parent process#5999
Merged
sebastianbergmann merged 1 commit intosebastianbergmann:11.5from Oct 19, 2024
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 11.5 #5999 +/- ##
=========================================
Coverage 94.78% 94.78%
- Complexity 6814 6821 +7
=========================================
Files 720 720
Lines 21626 21642 +16
=========================================
+ Hits 20498 20514 +16
Misses 1128 1128 ☔ View full report in Codecov by Sentry. |
b6dcfa9 to
82bfe56
Compare
7bda895 to
787f13c
Compare
staabm
commented
Oct 19, 2024
Comment on lines
-27
to
-28
| Child Process Started | ||
| Child Process Finished |
Contributor
Author
There was a problem hiding this comment.
here we can see the new feature in action. a pre-existing test no longer needs a subprocess to cleanup
CLEAN section of PHPT test in separate process when it is free of side effects that modify the parent process
Contributor
Author
|
Blogged about it: https://staabm.github.io/2024/10/19/phpunit-codesprint-munich.html |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Don't use subprocess for
—CLEAN—as long as the code cannot modify the parent process (e.g. file IO is fine within the parent process).utilizes https://github.com/staabm/side-effects-detector
followup to #5998
php phpunit tests/end-to-end/event/phpt-clean.phptbefore this PR 109-110ms
after this PR: 85-87ms
tested on PHP 8.3.12 macos m1 pro