From 67f4571bb14d3161cd7fa26e461b5e8026fe7a65 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 15:25:45 +0000 Subject: [PATCH 1/3] Initial plan From 78703147bfc171c76b5be3049c38513baa5bbfc4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 15:28:53 +0000 Subject: [PATCH 2/3] Add support for @skip-mysql, @skip-mariadb, @skip-sqlite tags - Updated utils/behat-tags.php to add skip tags based on database type - Updated all test cases in tests/tests/TestBehatTags.php to expect new skip tags - Added new test method test_behat_tags_skip_db_type to specifically test the skip tags Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- tests/tests/TestBehatTags.php | 51 +++++++++++++++++++++++++++++++++++ utils/behat-tags.php | 5 ++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/tests/tests/TestBehatTags.php b/tests/tests/TestBehatTags.php index 5b3ca49c1..d89e95c60 100644 --- a/tests/tests/TestBehatTags.php +++ b/tests/tests/TestBehatTags.php @@ -66,16 +66,19 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ): void case 'mariadb': $expected .= '&&~@require-mysql'; $expected .= '&&~@require-sqlite'; + $expected .= '&&~@skip-mariadb'; break; case 'sqlite': $expected .= '&&~@require-mariadb'; $expected .= '&&~@require-mysql'; $expected .= '&&~@require-mysql-or-mariadb'; + $expected .= '&&~@skip-sqlite'; break; case 'mysql': default: $expected .= '&&~@require-mariadb'; $expected .= '&&~@require-sqlite'; + $expected .= '&&~@skip-mysql'; break; } @@ -150,16 +153,19 @@ public function test_behat_tags_php_version(): void { case 'mariadb': $expected .= '&&~@require-mysql'; $expected .= '&&~@require-sqlite'; + $expected .= '&&~@skip-mariadb'; break; case 'sqlite': $expected .= '&&~@require-mariadb'; $expected .= '&&~@require-mysql'; $expected .= '&&~@require-mysql-or-mariadb'; + $expected .= '&&~@skip-sqlite'; break; case 'mysql': default: $expected .= '&&~@require-mariadb'; $expected .= '&&~@require-sqlite'; + $expected .= '&&~@skip-mysql'; break; } @@ -187,16 +193,19 @@ public function test_behat_tags_extension(): void { case 'mariadb': $expecteds[] = '~@require-mysql'; $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mariadb'; break; case 'sqlite': $expecteds[] = '~@require-mariadb'; $expecteds[] = '~@require-mysql'; $expecteds[] = '~@require-mysql-or-mariadb'; + $expecteds[] = '~@skip-sqlite'; break; case 'mysql': default: $expecteds[] = '~@require-mariadb'; $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mysql'; break; } @@ -231,6 +240,7 @@ public function test_behat_tags_db_version(): void { $contents = "@require-mariadb-$minimum_db_version @less-than-mariadb-$db_version"; $expecteds[] = '~@require-mysql'; $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mariadb'; $expecteds[] = "~@require-mariadb-$minimum_db_version"; $expecteds[] = "~@less-than-mariadb-$db_version"; break; @@ -238,12 +248,14 @@ public function test_behat_tags_db_version(): void { $expecteds[] = '~@require-mariadb'; $expecteds[] = '~@require-mysql'; $expecteds[] = '~@require-mysql-or-mariadb'; + $expecteds[] = '~@skip-sqlite'; break; case 'mysql': default: $contents = "@require-mysql-$minimum_db_version @less-than-mysql-$db_version"; $expecteds[] = '~@require-mariadb'; $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mysql'; $expecteds[] = "~@require-mysql-$minimum_db_version"; $expecteds[] = "~@less-than-mysql-$db_version"; break; @@ -255,4 +267,43 @@ public function test_behat_tags_db_version(): void { $output = exec( "cd {$this->temp_dir}; php $behat_tags" ); $this->assertSame( $expected, $output ); } + + public function test_behat_tags_skip_db_type(): void { + $env_github_token = getenv( 'GITHUB_TOKEN' ); + $db_type = getenv( 'WP_CLI_TEST_DBTYPE' ); + + putenv( 'GITHUB_TOKEN' ); + + $behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php'; + + file_put_contents( $this->temp_dir . '/features/skip_db.feature', '@skip-mysql @skip-mariadb @skip-sqlite' ); + + $expecteds = array(); + + switch ( $db_type ) { + case 'mariadb': + $expecteds[] = '~@require-mysql'; + $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mariadb'; + break; + case 'sqlite': + $expecteds[] = '~@require-mariadb'; + $expecteds[] = '~@require-mysql'; + $expecteds[] = '~@require-mysql-or-mariadb'; + $expecteds[] = '~@skip-sqlite'; + break; + case 'mysql': + default: + $expecteds[] = '~@require-mariadb'; + $expecteds[] = '~@require-sqlite'; + $expecteds[] = '~@skip-mysql'; + break; + } + + $expected = '--tags=' . implode( '&&', array_merge( array( '~@github-api', '~@broken' ), $expecteds ) ); + $output = exec( "cd {$this->temp_dir}; php $behat_tags" ); + $this->assertSame( $expected, $output ); + + putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" ); + } } diff --git a/utils/behat-tags.php b/utils/behat-tags.php index 4da5af53a..f1a011bda 100644 --- a/utils/behat-tags.php +++ b/utils/behat-tags.php @@ -173,7 +173,7 @@ function get_db_version() { case 'mariadb': $skip_tags = array_merge( $skip_tags, - [ '@require-mysql', '@require-sqlite' ], + [ '@require-mysql', '@require-sqlite', '@skip-mariadb' ], version_tags( 'require-mariadb', $db_version, '<', $features_folder ), version_tags( 'less-than-mariadb', $db_version, '>=', $features_folder ) ); @@ -182,12 +182,13 @@ function get_db_version() { $skip_tags[] = '@require-mariadb'; $skip_tags[] = '@require-mysql'; $skip_tags[] = '@require-mysql-or-mariadb'; + $skip_tags[] = '@skip-sqlite'; break; case 'mysql': default: $skip_tags = array_merge( $skip_tags, - [ '@require-mariadb', '@require-sqlite' ], + [ '@require-mariadb', '@require-sqlite', '@skip-mysql' ], version_tags( 'require-mysql', $db_version, '<', $features_folder ), version_tags( 'less-than-mysql', $db_version, '>=', $features_folder ) ); From c7eb2e7d41dfc46b09c2054416dfcae53d948829 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 15:30:17 +0000 Subject: [PATCH 3/3] Add test scenarios demonstrating @skip- tags in features/testing.feature Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/testing.feature | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/features/testing.feature b/features/testing.feature index 47b0377dd..7b98cb1e9 100644 --- a/features/testing.feature +++ b/features/testing.feature @@ -80,3 +80,34 @@ Feature: Test that WP-CLI loads. """ 6.3.1 """ + + @skip-mysql + Scenario: Skip on MySQL databases + Given a WP install + + When I run `wp eval 'echo "This should only run on MariaDB or SQLite";'` + Then STDOUT should contain: + """ + This should only run on MariaDB or SQLite + """ + + @skip-mariadb + Scenario: Skip on MariaDB databases + Given a WP install + + When I run `wp eval 'echo "This should only run on MySQL or SQLite";'` + Then STDOUT should contain: + """ + This should only run on MySQL or SQLite + """ + + @skip-sqlite + Scenario: Skip on SQLite databases + Given a WP install + + When I run `wp eval 'echo "This should only run on MySQL or MariaDB";'` + Then STDOUT should contain: + """ + This should only run on MySQL or MariaDB + """ +