Skip to content

Fix MariaDB test failures caused by ssl-verify-server-cert warnings in STDERR#231

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/improve-mariadb-tests
Draft

Fix MariaDB test failures caused by ssl-verify-server-cert warnings in STDERR#231
Copilot wants to merge 3 commits intomainfrom
copilot/improve-mariadb-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

MariaDB 11.4+ prints WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login. to STDERR whenever WP-CLI invokes mysql/mysqldump using MYSQL_PWD over a TCP connection. This contaminates STDERR and causes Behat steps using When I run to throw RuntimeException, failing most MariaDB tests.

The warning fires only when all of these conditions are true: MYSQL_PWD is set, ssl-verify-server-cert is not explicitly configured (bypassed by --no-defaults), and the protocol is TCP. The existing [client] disable-ssl-verify-server-cert in my-cnf was also ineffective since --no-defaults bypasses all config files.

Changes

  • Removed the ineffective [client] disable-ssl-verify-server-cert lines from my-cnf (were always bypassed by --no-defaults)
  • New step: Configure MariaDB to connect via Unix socket — runs only when inputs.dbtype == 'mariadb'; overrides WP_CLI_TEST_DBHOST to use the Unix socket path instead of TCP:
echo "WP_CLI_TEST_DBHOST=localhost:${{ steps.setup-mysql.outputs.base-dir }}/tmp/mysql.sock" >> "$GITHUB_ENV"

WP-CLI already handles the localhost:/path/to/socket format in mysql_host_to_cli_args(), extracting the socket path and passing --socket=... to mysql/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.

Copilot AI changed the title [WIP] Fix MariaDB tests to pass SSL verification Fix MariaDB test failures caused by ssl-verify-server-cert warnings in STDERR Mar 27, 2026
Copilot AI requested a review from swissspidy March 27, 2026 09:48
@swissspidy
Copy link
Copy Markdown
Member

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot that looks kinda hacky. can't we instead tweak the mariadb settings when setting up the database?

Replaced the wrapper scripts with a proper database setup change (86737db).

The MariaDB 11.4+ warning fires only when all these conditions are true: MYSQL_PWD is set, ssl-verify-server-cert isn't explicitly configured (bypassed by --no-defaults), and the protocol is TCP. Connecting via Unix socket bypasses the TCP condition entirely.

The fix overrides WP_CLI_TEST_DBHOST to localhost:/path/to/mysql.sock for MariaDB runs. WP-CLI already parses the host:socket_path format (via mysql_host_to_cli_args()) and passes --socket=... to mysql/mysqldump, so all DB tool invocations use socket instead of TCP.

Also removed the [client] disable-ssl-verify-server-cert my-cnf setting that was never effective since --no-defaults bypasses config files.

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:

  • https://api.github.com/repos/MariaDB/server/contents/client
    • Triggering command: /usr/bin/curl curl -sL REDACTED (http block)
  • https://api.github.com/search/code
    • Triggering command: /usr/bin/curl curl -sL REDACTED (http block)
  • jira.mariadb.org
    • Triggering command: /usr/bin/curl curl -sL REDACTED (dns block)
  • mariadb.com
    • Triggering command: /usr/bin/curl curl -sL REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scope:testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants