ext/mysql: Don't mention errors for optional part of the test#17466
Closed
NattyNarwhal wants to merge 1 commit into
Closed
ext/mysql: Don't mention errors for optional part of the test#17466NattyNarwhal wants to merge 1 commit into
NattyNarwhal wants to merge 1 commit into
Conversation
If the user we're running the tests as in MySQL is an unprivileged user, we skip the CREATE DATABASE and CREATE SERVER tests. However, the cleanup code still assumes they're there, and will fail with instead. Instead, we simply don't print the messages for the equivalent DROP calls. However, we still do for TABLE, since if we can't run anything in the test database as the user we're running as, far more tests will fail. I don't know if this is the best approach; silencing the errors for when those tests do run is unwise.
Closed
Member
|
I'd rather we not do that. If the test suite is using an unprivileged user (which it ideally shouldn't) then the test shouldn't be executed at all. |
Member
|
I agree with @kamil-tekiela . There should be a more advanced skip for the whole test instead. |
NattyNarwhal
added a commit
to NattyNarwhal/php-src
that referenced
this pull request
Jan 20, 2025
This test needs CREATE DATABASE and CREATE SERVER, and will fail in the cleanup step if it doesn't have it. If the test is running as a user that can't do these, then we should skip instead of borking. Alternative to phpGH-17466.
Member
Author
|
I've opened GH-17531 as an alternative to skip the test instead. |
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.
If the user we're running the tests as in MySQL is an unprivileged user, we skip the CREATE DATABASE and CREATE SERVER tests. However, the cleanup code still assumes they're there, and will fail with instead.
Instead, we simply don't print the messages for the equivalent DROP calls. However, we still do for TABLE, since if we can't run anything in the test database as the user we're running as, far more tests will fail.
I don't know if this is the best approach; silencing the errors for when those tests do run is unwise.
This PR is because of GH-17258; currently, the runner is running in the same system as MySQL, so running it unprivileged seemed wise. This should benefit other platforms wanting to run tests not as root now though; the only thing needed is to grant privileges to a user for a database (oh, and change binary logging off or allow it for functions).