36
36
jobs :
37
37
# Runs the PHPUnit tests for WordPress.
38
38
#
39
+ # Note: Steps running tests for PHP 8.1 jobs are allowed to "continue-on-error".
40
+ # This prevents workflow runs from being marked as "failed" when only PHP 8.1 fails.
41
+ #
39
42
# Performs the following steps:
40
43
# - Set environment variables.
41
44
# - Sets up the environment variables needed for testing with memcached (if desired).
@@ -188,7 +191,7 @@ jobs:
188
191
run : npm run env:install
189
192
190
193
- name : Run slow PHPUnit tests
191
- if : ${{ matrix.php != '8.1' && matrix. split_slow }}
194
+ if : ${{ matrix.split_slow }}
192
195
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
193
196
194
197
- name : Run PHPUnit tests for single site excluding slow tests
@@ -200,63 +203,30 @@ jobs:
200
203
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers
201
204
202
205
- name : Run PHPUnit tests
203
- if : ${{ matrix.php >= '7.0' && matrix.php != '8.1' }}
204
- run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
205
-
206
- - name : Run AJAX tests
207
- if : ${{ matrix.php != '8.1' && ! matrix.split_slow }}
208
- run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
209
-
210
- - name : Run ms-files tests as a multisite install
211
- if : ${{ matrix.php != '8.1' && matrix.multisite && ! matrix.split_slow }}
212
- run : npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
213
-
214
- - name : Run external HTTP tests
215
- if : ${{ matrix.php != '8.1' && ! matrix.multisite && ! matrix.split_slow }}
216
- run : npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
217
-
218
- # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
219
- - name : Run (xDebug) tests
220
- if : ${{ matrix.php != '8.1' && ! matrix.split_slow }}
221
- run : LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
222
-
223
- # ### Duplicate set of test runs specifically for PHP 8.1 while WP is not yet compatible. ####
224
- # Splitting off the test runs for PHP 8.1 allows us to apply "continue-on-error" to the job steps,
225
- # which will prevent the builds from showing as "failed" when they only fail on PHP 8.1.
226
- # This block should be removed once all PHP 8.1 test failures have been fixed.
227
- # When the block is removed, the conditions in the block above should also be adjusted back
228
- # to their original values.
229
- - name : Run slow PHPUnit tests
230
- if : ${{ matrix.php == '8.1' && matrix.split_slow }}
231
- continue-on-error : true
232
- run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
233
-
234
- - name : Run PHPUnit tests
235
- if : ${{ matrix.php == '8.1' }}
236
- continue-on-error : true
206
+ if : ${{ matrix.php >= '7.0' }}
207
+ continue-on-error : ${{ matrix.php == '8.1' }}
237
208
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
238
209
239
210
- name : Run AJAX tests
240
- if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
241
- continue-on-error : true
211
+ if : ${{ ! matrix.split_slow }}
212
+ continue-on-error : ${{ matrix.php == '8.1' }}
242
213
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
243
214
244
215
- name : Run ms-files tests as a multisite install
245
- if : ${{ matrix.php == '8.1' && matrix. multisite && ! matrix.split_slow }}
246
- continue-on-error : true
216
+ if : ${{ matrix.multisite && ! matrix.split_slow }}
217
+ continue-on-error : ${{ matrix.php == '8.1' }}
247
218
run : npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
248
219
249
220
- name : Run external HTTP tests
250
- if : ${{ matrix.php == '8.1' && ! matrix.multisite && ! matrix.split_slow }}
251
- continue-on-error : true
221
+ if : ${{ ! matrix.multisite && ! matrix.split_slow }}
222
+ continue-on-error : ${{ matrix.php == '8.1' }}
252
223
run : npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
253
224
254
225
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
255
226
- name : Run (xDebug) tests
256
- if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
257
- continue-on-error : true
227
+ if : ${{ ! matrix.split_slow }}
228
+ continue-on-error : ${{ matrix.php == '8.1' }}
258
229
run : LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
259
- # ### End of duplicate set of test runs. ####
260
230
261
231
- name : Ensure version-controlled files are not modified or deleted
262
232
run : git diff --exit-code
0 commit comments