Skip to content

Commit 715888e

Browse files
authored
Merge pull request #336 from wp-cli/fix/db-repair-verbose-mariadb-335
Fix `wp db repair --verbose` test for MariaDB
2 parents d80865d + f267e57 commit 715888e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎features/db.feature‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,18 @@ Feature: Perform database operations
181181
"""
182182
And STDOUT should be empty
183183
184-
# Verbose option prints to STDERR.
185-
When I try `wp db repair --verbose`
184+
# `--verbose` makes the check command print progress information. MySQL's
185+
# mysqlcheck writes "# Connecting to ..." to STDERR at a single --verbose,
186+
# while MariaDB's mariadb-check writes "Processing databases" to STDOUT and
187+
# only prints connection information at a higher verbosity. Merge the streams
188+
# and accept either client's marker.
189+
When I try `wp db repair --verbose 2>&1`
186190
Then the return code should be 0
187-
And STDERR should contain:
191+
And STDOUT should match /(?:# Connecting to |Processing databases)/
192+
And STDOUT should contain:
188193
"""
189-
Connecting
194+
Success: Database repaired.
190195
"""
191-
And STDOUT should not be empty
192196

193197
@skip-sqlite
194198
Scenario: db repair with --quiet flag should only show errors

0 commit comments

Comments
 (0)