Skip to content

Commit 9b8cf32

Browse files
authored
Merge pull request #158 from wp-cli/improve/mark-tests-broken-trunk
Add ability to mark tests as broken on `trunk` and `nightly`
2 parents d19f754 + 0d5e822 commit 9b8cf32

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
colors="true"
44
>
55
<testsuites>
6-
<testsuite>
6+
<testsuite name="default">
77
<directory prefix="spec-" suffix=".php">tests/</directory>
88
<directory prefix="test-" suffix=".php">tests/</directory>
99
</testsuite>

tests/test-behat-tags.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) {
4444
file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents );
4545

4646
$output = exec( "cd {$this->temp_dir}; $env php $behat_tags" );
47-
$this->assertSame( '--tags=' . $expected . '&&~@broken', $output );
47+
48+
$expected .= '&&~@broken';
49+
if ( in_array( $env, array( 'WP_VERSION=trunk', 'WP_VERSION=nightly' ), true ) ) {
50+
$expected .= '&&~@broken-trunk';
51+
}
52+
$this->assertSame( '--tags=' . $expected, $output );
4853

4954
putenv( false === $env_wp_version ? 'WP_VERSION' : "WP_VERSION=$env_wp_version" );
5055
putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" );

utils/behat-tags.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ function version_tags(
7676
# Skip tests known to be broken.
7777
$skip_tags[] = '@broken';
7878

79+
if ( $wp_version && in_array( $wp_version, array( 'nightly', 'trunk' ), true ) ) {
80+
$skip_tags[] = '@broken-trunk';
81+
}
82+
7983
# Require PHP extension, eg 'imagick'.
8084
function extension_tags( $features_folder = 'features' ) {
8185
$extension_tags = array();

0 commit comments

Comments
 (0)