You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e844d35
Browse filesBrowse the repository at this point in the historyBrowse files
Two points from review:
* The wp-versions artifact already marks the current release with a "latest"
status, so the separate request to api.wordpress.org was redundant. Both the
"latest" and the X.Y resolution now come out of that one file, which means one
cached artifact and at most one network request per run instead of two.
* Behat's step definition snippets are not only printed when writing new step
definitions; they are also how a typo in an existing step surfaces. That makes
them a diagnostic rather than noise, and they only appear when something is
already wrong, so suppressing them under WP_CLI_TEST_QUIET saved nothing in
the passing case and cost information in the failing one. Dropped, which
leaves WP_CLI_TEST_QUIET with no effect on Behat.
Also adds lint-gherkin to the setup instructions, which listed the scripts a
consuming package should wire up but not the new one.
Refs wp-cli/wp-cli#6161
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VcGmbu6CYzGGhP3jXuWDkJ
Copy file name to clipboardExpand all lines: .readme-partials/USING.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,14 @@ To make use of the WP-CLI testing framework, you need to complete the following
11
11
"behat": "run-behat-tests",
12
12
"behat-rerun": "rerun-behat-tests",
13
13
"lint": "run-linter-tests",
14
+
"lint-gherkin": "run-gherkin-lint-tests",
14
15
"phpcs": "run-phpcs-tests",
15
16
"phpcbf": "run-phpcbf-cleanup",
16
17
"phpunit": "run-php-unit-tests",
17
18
"prepare-tests": "install-package-tests",
18
19
"test": [
19
20
"@lint",
21
+
"@lint-gherkin",
20
22
"@phpcs",
21
23
"@phpunit",
22
24
"@behat"
@@ -137,7 +139,7 @@ this package's `package.json`, which exists only to hold that pin.
137
139
Two environment variables make the test tools less chatty. Both are unset by default, which leaves the output exactly as it has always been.
138
140
139
141
- `NO_COLOR` (the [no-color.org](https://no-color.org/) convention) stops the runners from forcing ANSI color codes on, and leaves the decision to each tool's own terminal detection. Set this when capturing output to a file or a pipe, where the escape sequences are noise.
140
-
- `WP_CLI_TEST_QUIET` switches the reporters to their most compact form: PHP_CodeSniffer reports one `file:line:col` line per violation with no progress ticker, PHPStan reports one `file:line:message` line per error with no progress bar and no result table, and Behat stops printing step definition snippets for undefined steps.
142
+
- `WP_CLI_TEST_QUIET` switches the reporters to their most compact form: PHP_CodeSniffer reports one `file:line:col` line per violation with no progress ticker, PHPStan reports one `file:line:message` line per error with no progress bar and no result table. Behat's own output is already minimal, so it is unaffected.
141
143
142
144
`NO_COLOR` also covers the Gherkin linter, which colors its report unconditionally and has no plain output format of its own.
143
145
@@ -167,11 +169,12 @@ Here's how to run your tests against the latest trunk version of WordPress:
167
169
WP_VERSION=trunk composer behat
168
170
```
169
171
170
-
Resolving `latest`, or a `X.Y` version without a patch number, needs a network
171
-
request. The answer is cached in the system temp directory for a day, so that
172
-
repeated runs do not repeat the lookup, and so that a run without connectivity
173
-
falls back to the last known answer. `WP_CLI_TEST_WP_VERSION_CACHE_TTL` sets the
174
-
lifetime of that cache in seconds;`0` looks the version up every time.
172
+
Resolving `latest`, or a `X.Y` version without a patch number, needs the
173
+
WordPress versions data, which is fetched once and cached in the system temp
174
+
directory for a day. Repeated runs do not repeat the request, and a run without
175
+
connectivity falls back to the last known copy.
176
+
`WP_CLI_TEST_WP_VERSION_CACHE_TTL` sets the lifetime of that cache in seconds;
Copy file name to clipboardExpand all lines: README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,14 @@ To make use of the WP-CLI testing framework, you need to complete the following
22
22
"behat": "run-behat-tests",
23
23
"behat-rerun": "rerun-behat-tests",
24
24
"lint": "run-linter-tests",
25
+
"lint-gherkin": "run-gherkin-lint-tests",
25
26
"phpcs": "run-phpcs-tests",
26
27
"phpcbf": "run-phpcbf-cleanup",
27
28
"phpunit": "run-php-unit-tests",
28
29
"prepare-tests": "install-package-tests",
29
30
"test": [
30
31
"@lint",
32
+
"@lint-gherkin",
31
33
"@phpcs",
32
34
"@phpunit",
33
35
"@behat"
@@ -148,7 +150,7 @@ this package's `package.json`, which exists only to hold that pin.
148
150
Two environment variables make the test tools less chatty. Both are unset by default, which leaves the output exactly as it has always been.
149
151
150
152
- `NO_COLOR` (the [no-color.org](https://no-color.org/) convention) stops the runners from forcing ANSI color codes on, and leaves the decision to each tool's own terminal detection. Set this when capturing output to a file or a pipe, where the escape sequences are noise.
151
-
- `WP_CLI_TEST_QUIET` switches the reporters to their most compact form: PHP_CodeSniffer reports one `file:line:col` line per violation with no progress ticker, PHPStan reports one `file:line:message` line per error with no progress bar and no result table, and Behat stops printing step definition snippets for undefined steps.
153
+
- `WP_CLI_TEST_QUIET` switches the reporters to their most compact form: PHP_CodeSniffer reports one `file:line:col` line per violation with no progress ticker, PHPStan reports one `file:line:message` line per error with no progress bar and no result table. Behat's own output is already minimal, so it is unaffected.
152
154
153
155
`NO_COLOR` also covers the Gherkin linter, which colors its report unconditionally and has no plain output format of its own.
154
156
@@ -178,11 +180,12 @@ Here's how to run your tests against the latest trunk version of WordPress:
178
180
WP_VERSION=trunk composer behat
179
181
```
180
182
181
-
Resolving `latest`, or a `X.Y` version without a patch number, needs a network
182
-
request. The answer is cached in the system temp directory for a day, so that
183
-
repeated runs do not repeat the lookup, and so that a run without connectivity
184
-
falls back to the last known answer. `WP_CLI_TEST_WP_VERSION_CACHE_TTL` sets the
185
-
lifetime of that cache in seconds;`0` looks the version up every time.
183
+
Resolving `latest`, or a `X.Y` version without a patch number, needs the
184
+
WordPress versions data, which is fetched once and cached in the system temp
185
+
directory for a day. Repeated runs do not repeat the request, and a run without
186
+
connectivity falls back to the last known copy.
187
+
`WP_CLI_TEST_WP_VERSION_CACHE_TTL` sets the lifetime of that cache in seconds;
0 commit comments