Fix MariaDB test failures caused by ssl-verify-server-cert warnings in STDERR#231
Fix MariaDB test failures caused by ssl-verify-server-cert warnings in STDERR#231
Conversation
Agent-Logs-Url: https://github.com/wp-cli/.github/sessions/c36fe78c-cf30-4dea-bdb3-fa2d47816735 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
|
@copilot that looks kinda hacky. can't we instead tweak the mariadb settings when setting up the database? |
…er-cert warnings Agent-Logs-Url: https://github.com/wp-cli/.github/sessions/ffe107ab-bf0d-425c-b414-3366b78154ce Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Replaced the wrapper scripts with a proper database setup change (86737db). The MariaDB 11.4+ warning fires only when all these conditions are true: The fix overrides Also removed the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
MariaDB 11.4+ prints
WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.to STDERR whenever WP-CLI invokesmysql/mysqldumpusingMYSQL_PWDover a TCP connection. This contaminates STDERR and causes Behat steps usingWhen I runto throwRuntimeException, failing most MariaDB tests.The warning fires only when all of these conditions are true:
MYSQL_PWDis set,ssl-verify-server-certis not explicitly configured (bypassed by--no-defaults), and the protocol is TCP. The existing[client] disable-ssl-verify-server-certinmy-cnfwas also ineffective since--no-defaultsbypasses all config files.Changes
[client] disable-ssl-verify-server-certlines frommy-cnf(were always bypassed by--no-defaults)Configure MariaDB to connect via Unix socket— runs only wheninputs.dbtype == 'mariadb'; overridesWP_CLI_TEST_DBHOSTto use the Unix socket path instead of TCP:WP-CLI already handles the
localhost:/path/to/socketformat inmysql_host_to_cli_args(), extracting the socket path and passing--socket=...tomysql/mysqldump. Since Unix socket is not TCP, the MariaDB warning condition is never met and no warning is printed — for every mysql tool call made during the test run.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.