Repository navigation
Only count a socket the scenarios can find as available - #434
Open
swissspidy wants to merge 1 commit into
Open
swissspidy wants to merge 1 commit into
swissspidy wants to merge 1 commit into
Conversation
@require-mysql-socket treated a socket path given as the suffix of WP_CLI_TEST_DBHOST as available. The scenarios carrying the tag look for the socket in WP_CLI_TEST_DBSOCKET and the two default locations only, so where the host was the only source, the tag let the scenario run and it still failed with "No socket found". The tag now looks in exactly the places those scenarios do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Follow-up to #357, from a CodeRabbit finding on wp-cli/config-command#239.
@require-mysql-socketcounted a socket path given as the suffix ofWP_CLI_TEST_DBHOST(for examplelocalhost:/path/to/mysql.sock) as available. The scenarios carrying the tag can't use that path: the one in config-command runs afind-socket.phpthat only checksWP_CLI_TEST_DBSOCKET(through{DB_SOCKET}),/var/run/mysqld/mysqld.sockand/tmp/mysql.sock. So in a setup where the host was the only source of a socket, the tag let the scenario run and it still failed with "No socket found".has_mysql_socket()now checks exactly the places those scenarios do. The tag should follow what the test can use, not the other way round.The new unit test fails without the change (the tag isn't filtered out) and passes with it. It skips itself on a machine that has a socket at one of the default paths, since that counts as available regardless of the host. The other six tag tests still pass, and lint and phpcs are clean.
Generated by Claude Code
Summary by CodeRabbit
@require-mysql-sockettag no longer treats a socket path embedded in the database host setting as evidence that a MySQL socket is available. Detection continues to check the dedicated socket setting and the standard socket locations.