Skip to content

Improve MariaDB tests #309

@swissspidy

Description

@swissspidy

They are still allowed to fail but would be nice to get them to green. There are currently quite a few failing tests, almost all because of --ssl-verify-server-cert warnings cluttering STDERR.

Perhaps we need to pass it manually like was done in wp-cli/wp-cli-tests#297?

Examples:

Failed steps:

001 Scenario: Display information about a non default WordPress table                                                # features/db-columns.feature:44
      And I run `wp db query "CREATE TABLE not_wp ( date DATE NOT NULL, awesome_stuff TEXT, PRIMARY KEY (date) );;"` # features/db-columns.feature:46
        $ wp db query "CREATE TABLE not_wp ( date DATE NOT NULL, awesome_stuff TEXT, PRIMARY KEY (date) );;"
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c7c6bcc3.53632177/
        run time: 0.16866993904114
        exit status: 0 (RuntimeException)

002 Scenario: Database exports with random hash applied # features/db-export.feature:3
      When I run `wp db export --porcelain`             # features/db-export.feature:6
        $ wp db export --porcelain
        wp_cli_test-2026-02-08-68c4205.sql
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c848a357.72059523/
        run time: 0.19305086135864
        exit status: 0 (RuntimeException)

003 Scenario: Database export to a specified file path      # features/db-export.feature:13
      When I run `wp db export wp_cli_test.sql --porcelain` # features/db-export.feature:16
        $ wp db export wp_cli_test.sql --porcelain
        wp_cli_test.sql
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c8c233a4.45982247/
        run time: 0.19237279891968
        exit status: 0 (RuntimeException)

004 Scenario: Exclude tables when exporting the database                              # features/db-export.feature:23
      When I run `wp db export wp_cli_test.sql --exclude_tables=wp_users --porcelain` # features/db-export.feature:26
        $ wp db export wp_cli_test.sql --exclude_tables=wp_users --porcelain
        wp_cli_test.sql
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c94b0ca7.31860636/
        run time: 0.18274307250977
        exit status: 0 (RuntimeException)

005 Scenario: Export database to STDOUT # features/db-export.feature:37
      When I run `wp db export -`       # features/db-export.feature:40
        $ wp db export -

        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c9c54811.18958571/
        run time: 0.19263005256653
        exit status: 0 (RuntimeException)

006 Scenario: Export database with mysql defaults to STDOUT # features/db-export.feature:46
      When I run `wp db export --defaults -`                # features/db-export.feature:49
        $ wp db export --defaults -

        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0c9c54811.18958571/
        run time: 0.19263005256653
        exit status: 0 (RuntimeException)

008 Scenario: Export database with passed-in options                 # features/db-export.feature:64
      When I run `wp db export - --dbpass=password1 --skip-comments` # features/db-export.feature:67
        $ wp db export - --dbpass=password1 --skip-comments

        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0cb900c03.97350758/
        run time: 0.18559980392456
        exit status: 0 (RuntimeException)

009 Scenario: Import from database name path by default # features/db-import.feature:3
      When I run `wp db export wp_cli_test.sql`         # features/db-import.feature:6
        $ wp db export wp_cli_test.sql
        Success: Exported to 'wp_cli_test.sql'.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0cd0bbfc5.61320675/
        run time: 0.18721199035645
        exit status: 0 (RuntimeException)

010 Scenario: Import from database name path by default with mysql defaults # features/db-import.feature:15
      When I run `wp db export wp_cli_test.sql`                             # features/db-import.feature:18
        $ wp db export wp_cli_test.sql
        Success: Exported to 'wp_cli_test.sql'.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0cd83b685.54213382/
        run time: 0.188236951828
        exit status: 0 (RuntimeException)

011 Scenario: Import from database name path by default with --no-defaults # features/db-import.feature:27
      When I run `wp db export wp_cli_test.sql`                            # features/db-import.feature:30
        $ wp db export wp_cli_test.sql
        run time: 0.16494393348694
        exit status: 0 (RuntimeException)

027 Scenario: Search should cater for field/table names that use reserved words or unusual characters # features/db-search.feature:994
      When I run `wp db query "SOURCE esc_sql_ident.sql;"`                                            # features/db-search.feature:1003
        $ wp db query "SOURCE esc_sql_ident.sql;"
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0e2e44fc2.19447902/
        run time: 0.1659779548645
        exit status: 0 (RuntimeException)

028 Scenario: Listing a site's tables should only list that site's tables # features/db-tables.feature:122
      When I run `wp db query "ALTER TABLE wp_blogs AUTO_INCREMENT=21"`   # features/db-tables.feature:131
        $ wp db query "ALTER TABLE wp_blogs AUTO_INCREMENT=21"
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f0f95f42f0.14381699/
        run time: 0.16593098640442
        exit status: 0 (RuntimeException)

029 Scenario: DB CRUD           # features/db.feature:3
      When I run `wp db create` # features/db.feature:24
        $ wp db create
        Success: Database created.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f101663b18.34654819/
        run time: 0.16298508644104
        exit status: 0 (RuntimeException)

030 Scenario: DB CRUD with passed-in dbuser/dbpass   # features/db.feature:55
      When I run `wp db create --dbuser=wp_cli_test` # features/db.feature:68
        $ wp db create --dbuser=wp_cli_test
        Success: Database created.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f1022e6856.99698188/
        run time: 0.16257500648499
        exit status: 0 (RuntimeException)

031 Scenario: Clean up a WordPress install without dropping its database entirely but tables with prefix. # features/db.feature:110
      When I run `wp db query "create table custom_table as select * from wp_users;"`                     # features/db.feature:113
        $ wp db query "create table custom_table as select * from wp_users;"
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f102ce6e00.54167756/
        run time: 0.16586208343506
        exit status: 0 (RuntimeException)

032 Scenario: DB Operations with passed-in options # features/db.feature:150
      And STDERR should contain:                   # features/db.feature:182
        $ wp db repair --verbose
        Processing databases
        wp_cli_test
        wp_cli_test.wp_commentmeta
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_comments
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_links
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_options
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_postmeta
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_posts
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_term_relationships
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_term_taxonomy
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_termmeta
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_terms
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_usermeta
        note     : The storage engine for the table doesn't support repair
        wp_cli_test.wp_users
        note     : The storage engine for the table doesn't support repair
        Success: Database repaired.
        
        cwd: /tmp/wp-cli-test-run--6987f1041b9750.75424311/
        run time: 0.15636110305786
        exit status: 0
        
        --- Expected
        +++ Actual
        @@ @@
        -Connecting
         (Exception)

033 Scenario: DB Query                                                  # features/db.feature:210
      When I run `wp db query 'SELECT COUNT(*) as total FROM wp_posts'` # features/db.feature:213
        $ wp db query 'SELECT COUNT(*) as total FROM wp_posts'
        total
        3
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f106c307c1.39572220/
        run time: 0.16389203071594
        exit status: 0 (RuntimeException)

034 Scenario: DB export/import                        # features/db.feature:239
      When I run `wp db export /tmp/wp-cli-behat.sql` # features/db.feature:248
        $ wp db export /tmp/wp-cli-behat.sql
        Success: Exported to '/tmp/wp-cli-behat.sql'.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f1074be300.86174825/
        run time: 0.19354820251465
        exit status: 0 (RuntimeException)

035 Scenario: DB export no charset # features/db.feature:287
      When I run `wp db create`    # features/db.feature:300
        $ wp db create
        Success: Database created.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f10821cf47.86131353/
        run time: 0.1698169708252
        exit status: 0 (RuntimeException)

036 Scenario: Persist DB charset and collation # features/db.feature:309
      When I run `wp db create`                # features/db.feature:316
        $ wp db create
        Success: Database created.
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f1089d74f6.84717897/
        run time: 0.1664412021637
        exit status: 0 (RuntimeException)

037 Scenario: Row modifying queries should return the number of affected rows # features/db.feature:352
      When I run `wp db query "SELECT * FROM wp_users WHERE ID = 1"`          # features/db.feature:360
        $ wp db query "SELECT * FROM wp_users WHERE ID = 1"
        ID	user_login	user_pass	user_nicename	user_email	user_url	user_registered	user_activation_key	user_status	display_name
        1	admin	$wp$2y$10$w4/nW.vJ.1WXXPt0a3EZNunhYEn6TrT1xAMWfNt1ZLbbKBfe0v6vu	admin	admin@example.com	https://example.com/	2026-02-08 02:11:13		1	admin
        
        WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
        cwd: /tmp/wp-cli-test-run--6987f10923f527.95682120/
        run time: 0.16375589370728
        exit status: 0 (RuntimeException)

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions