From aaaaa81adb84c1608a5b24c33426dc9358dcc45c Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 9 Jan 2023 16:37:29 -0800 Subject: [PATCH 1/3] Add ability to mark tests as broken on `trunk` and `nightly` --- utils/behat-tags.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/behat-tags.php b/utils/behat-tags.php index d9eb2f954..659c96cdb 100644 --- a/utils/behat-tags.php +++ b/utils/behat-tags.php @@ -76,6 +76,10 @@ function version_tags( # Skip tests known to be broken. $skip_tags[] = '@broken'; +if ( $wp_version && in_array( $wp_version, array( 'nightly', 'trunk' ), true ) ) { + $skip_tags[] = '@broken-trunk'; +} + # Require PHP extension, eg 'imagick'. function extension_tags( $features_folder = 'features' ) { $extension_tags = array(); From 5bfe3c2017c3d371a468c76f87cc29b4fd1ea740 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 17 Jan 2023 05:28:43 +0100 Subject: [PATCH 2/3] Add @broken-trunk to unit test expectations --- tests/test-behat-tags.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test-behat-tags.php b/tests/test-behat-tags.php index 1cf82c7f3..d92289c11 100644 --- a/tests/test-behat-tags.php +++ b/tests/test-behat-tags.php @@ -44,7 +44,12 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) { file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents ); $output = exec( "cd {$this->temp_dir}; $env php $behat_tags" ); - $this->assertSame( '--tags=' . $expected . '&&~@broken', $output ); + + $expected .= '&&~@broken'; + if ( in_array( $env, array( 'WP_VERSION=trunk', 'WP_VERSION=nightly' ), true ) ) { + $expected .= '&&~@broken-trunk'; + } + $this->assertSame( '--tags=' . $expected, $output ); putenv( false === $env_wp_version ? 'WP_VERSION' : "WP_VERSION=$env_wp_version" ); putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" ); From 0d5e822fb7d86c911e7e6963f15f9568bd6dc6a9 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 17 Jan 2023 05:28:56 +0100 Subject: [PATCH 3/3] Fix PHPUnit validation issue --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 529dae0ef..6d71ef1bd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,7 +3,7 @@ colors="true" > - + tests/ tests/