-
Notifications
You must be signed in to change notification settings - Fork 70
tests: fix integration_runner opcache module loading #1097
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
Conversation
Previously it was assumed that the Zend OPCache module was NOT loaded in the environment which integration and mutliverse tests were run. Now the PHP Docker images have Zend OPCache loaded by default, causing errors when the integration_runner also tried to load this module. These changes identify if the module is loaded by default and handles setting the opcache.enable and opcache.enable_cli INI value based on the value of the "-opcache_off" command line option.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1097 +/- ##
==========================================
- Coverage 77.27% 77.20% -0.08%
==========================================
Files 199 199
Lines 28342 28343 +1
==========================================
- Hits 21902 21882 -20
- Misses 6440 6461 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
setOPCacheEnableCLI = false | ||
} | ||
} | ||
if ctx.UseOPCache { |
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.
ctx.UseOPCache
is actually the negation of the value of the --opcacheoff
flag passed to integration_runner
, which is false
by default. This means that this branch is the default behavior. This also means that that --opcacheoff
does not affect presence of opcache.so
module.
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.
That seems correct.
The MakeRun() function serves as a common starting point for tests and it was brought up that the manipulatiuon of the settings which occurrd in PhpTx() and CgiTx() could be unified here to clean up the code. This code also asserts if a C test case is run as that is not a supported configuration.
Co-authored-by: Michal Nowacki <[email protected]>
With recent official PHP docker images the Zend OPCache extension is loaded by default. This is causing some test failures as PHP will output a warning message when the `integration_runner` attempts to load this extension. As a result any `EXPECT` statements in tests will fail due to this extra output. The solution chosen was to use the “-m” option for the `php` and `php-cgi` binaries to probe if the Zend OPCache module is loaded by default in the PHP environment. Both binaries are used in testing so the defaults of both are considered. The value of the integration_runner command line option `opcache_off` is also noted. When a test is going to be run this information is used to determine if the `zend_extension=opcache.so` is needed as well as setting the values of `opcache.enable` and `opcache.enable_cli`. These INI values needed special handling because it is possible these are overwritten by values in the INI stanza of a given test case. Also consideration is needed to if the `PHPMODULES` stanza exists in the test case and specifies loading the `opcache.so` module. --------- Co-authored-by: Michal Nowacki <[email protected]>
With recent official PHP docker images the Zend OPCache extension is loaded by default. This is causing some test failures as PHP will output a warning message when the `integration_runner` attempts to load this extension. As a result any `EXPECT` statements in tests will fail due to this extra output. The solution chosen was to use the “-m” option for the `php` and `php-cgi` binaries to probe if the Zend OPCache module is loaded by default in the PHP environment. Both binaries are used in testing so the defaults of both are considered. The value of the integration_runner command line option `opcache_off` is also noted. When a test is going to be run this information is used to determine if the `zend_extension=opcache.so` is needed as well as setting the values of `opcache.enable` and `opcache.enable_cli`. These INI values needed special handling because it is possible these are overwritten by values in the INI stanza of a given test case. Also consideration is needed to if the `PHPMODULES` stanza exists in the test case and specifies loading the `opcache.so` module. --------- Co-authored-by: Michal Nowacki <[email protected]>
With recent official PHP docker images the Zend OPCache extension is loaded by default. This is causing some test failures as PHP will output a warning message when the
integration_runner
attempts to load this extension. As a result anyEXPECT
statements in tests will fail due to this extra output.The solution chosen was to use the “-m” option for the
php
andphp-cgi
binaries to probe if the Zend OPCache module is loaded by default in the PHP environment. Both binaries are used in testing so the defaults of both are considered. The value of the integration_runner command line optionopcache_off
is also noted. When a test is going to be run this information is used to determine if thezend_extension=opcache.so
is needed as well as setting the values ofopcache.enable
andopcache.enable_cli
. These INI values needed special handling because it is possible these are overwritten by values in the INI stanza of a given test case. Also consideration is needed to if thePHPMODULES
stanza exists in the test case and specifies loading theopcache.so
module.