Fix wp db repair --verbose test for MariaDB#336
Merged
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesDatabase repair test
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
schlessera
marked this pull request as ready for review
July 21, 2026 10:46
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.
Summary
features/db.feature's "DB Operations with passed-in options" scenario assertedthat
wp db repair --verbosewritesConnectingto STDERR. That only holds onMySQL: its
mysqlcheckwrites# Connecting to ...to STDERR at a single--verbose, but MariaDB'smariadb-checkwritesProcessing databasestoSTDOUT 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, sothe step now merges the streams (
2>&1) and matches either client's marker(
# Connecting toorProcessing databases), plus thewp db repairsuccessmessage so the scenario still proves the command ran.
This is the one remaining MariaDB failure after #334 (which silenced the
--ssl-verify-server-certwarnings). This PR is based on that branch so its CIexercises both fixes together; it should be retargeted to the default branch once
#334 lands.
Fixes #335.
Summary by CodeRabbit