Skip to content

Fix wp db repair --verbose test for MariaDB - #336

Merged
schlessera merged 2 commits into
mainfrom
fix/db-repair-verbose-mariadb-335
Jul 21, 2026
Merged

Fix wp db repair --verbose test for MariaDB#336
schlessera merged 2 commits into
mainfrom
fix/db-repair-verbose-mariadb-335

Conversation

@schlessera

@schlessera schlessera commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

features/db.feature's "DB Operations with passed-in options" scenario asserted
that wp db repair --verbose writes Connecting to STDERR. That only holds on
MySQL: its mysqlcheck writes # Connecting to ... to STDERR at a single
--verbose, but MariaDB's mariadb-check writes Processing databases to
STDOUT and only prints connection information at a higher verbosity level. So the
assertion passed on MySQL and failed on MariaDB.

Approach

There is no single verbose-only string both clients emit at one --verbose, so
the step now merges the streams (2>&1) and matches either client's marker
(# Connecting to or Processing databases), plus the wp db repair success
message so the scenario still proves the command ran.

This is the one remaining MariaDB failure after #334 (which silenced the
--ssl-verify-server-cert warnings). This PR is based on that branch so its CI
exercises both fixes together; it should be retargeted to the default branch once
#334 lands.

Fixes #335.

Summary by CodeRabbit

  • Bug Fixes
    • Improved database repair verification across MySQL and MariaDB.
    • Confirmed successful repairs by validating the appropriate connection or processing message and the final success notice.

The "DB Operations with passed-in options" scenario asserted that
`wp db repair --verbose` writes "Connecting" to STDERR. That only holds on
MySQL: its mysqlcheck writes `# Connecting to ...` to STDERR at a single
`--verbose`, but MariaDB's mariadb-check writes `Processing databases` to STDOUT
and only prints connection information at a higher verbosity level, so the
assertion failed on MariaDB.

There is no single verbose-only string both clients emit at one `--verbose`, so
merge the streams and match either client's marker, and assert the `wp db repair`
success message so the scenario still proves the command ran.
@schlessera schlessera added this to the 2.1.7 milestone Jul 21, 2026
@schlessera schlessera added command:db Related to 'db' command scope:testing Related to testing labels Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a6cc8bce-2531-4aaa-9236-bbacabad394a

📥 Commits

Reviewing files that changed from the base of the PR and between 9150b8d and 2bdc4c4.

📒 Files selected for processing (1)
  • features/db.feature

📝 Walkthrough

Walkthrough

The database repair scenario now combines verbose output streams, accepts MySQL or MariaDB progress markers, checks a zero return code, and confirms the database repaired message.

Changes

Database repair test

Layer / File(s) Summary
Repair output assertions
features/db.feature
The scenario redirects STDERR to STDOUT, matches MySQL or MariaDB verbose markers, verifies return code 0, and checks Success: Database repaired. in STDOUT.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: fixing the wp db repair verbose test for MariaDB.
Linked Issues check ✅ Passed The change matches #335 by adjusting the repair test to work with MariaDB and MySQL verbosity output.
Out of Scope Changes check ✅ Passed The edits stay focused on the DB repair Behat scenario and do not introduce unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/db-repair-verbose-mariadb-335

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added bug command:db-repair Related to 'db repair' command labels Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Base automatically changed from fix/mariadb-ssl-verify-warning-309 to main July 21, 2026 10:45
@schlessera
schlessera marked this pull request as ready for review July 21, 2026 10:46
@schlessera
schlessera requested a review from a team as a code owner July 21, 2026 10:46
@schlessera
schlessera merged commit 6a3b1a4 into main Jul 21, 2026
67 of 118 checks passed
@schlessera
schlessera deleted the fix/db-repair-verbose-mariadb-335 branch July 21, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:db Related to 'db' command command:db-repair Related to 'db repair' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MariaDB: wp db repair --verbose test fails because mariadb-check only prints "Connecting" at higher verbosity

1 participant