@@ -211,6 +211,7 @@ jobs:
211211 php ./vendor/bin/phpunit \
212212 --verbose \
213213 -c "${PHPUNIT_CONFIG}" \
214+ --log-junit "phpunit-results-${MULTISITE_FLAG}.xml" \
214215 ${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \
215216 ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml" --coverage-html "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}"' || '' }}
216217 env :
@@ -220,23 +221,58 @@ jobs:
220221 - name : Run AJAX tests
221222 if : ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
222223 continue-on-error : ${{ inputs.allow-errors }}
223- run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax
224+ run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax --log-junit "phpunit-results-ajax-${MULTISITE_FLAG}.xml"
225+ env :
226+ MULTISITE_FLAG : ${{ inputs.multisite && 'multisite' || 'single' }}
224227
225228 - name : Run ms-files tests as a multisite install
226229 if : ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
227230 continue-on-error : ${{ inputs.allow-errors }}
228- run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files
231+ run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files --log-junit "phpunit-results-ms-files.xml"
229232
230233 - name : Run external HTTP tests
231234 if : ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
232235 continue-on-error : ${{ inputs.allow-errors }}
233- run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http
236+ run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http --log-junit "phpunit-results-external-http.xml"
234237
235238 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
236239 - name : Run (Xdebug) tests
237240 if : ${{ inputs.php != '8.4' && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
238241 continue-on-error : ${{ inputs.allow-errors }}
239- run : LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
242+ run : LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ --log-junit "phpunit-results-xdebug.xml"
243+
244+ - name : Extract skipped tests from JUnit XML
245+ id : extract-skipped
246+ env :
247+ PHP_VERSION : ${{ inputs.php }}
248+ DB_TYPE : ${{ inputs.db-type }}
249+ DB_VERSION : ${{ inputs.db-version }}
250+ MULTISITE : ${{ inputs.multisite && 'multisite' || 'single' }}
251+ MEMCACHED : ${{ inputs.memcached && 'memcached' || 'no-memcached' }}
252+ TEST_GROUPS : ${{ inputs.phpunit-test-groups && inputs.phpunit-test-groups || 'all-groups' }}
253+ run : |
254+ CONFIG_OUTPUT=$(./.github/scripts/extract-skipped-tests.sh \
255+ "${PHP_VERSION}" \
256+ "${DB_TYPE}" \
257+ "${DB_VERSION}" \
258+ "${MULTISITE}" \
259+ "${MEMCACHED}" \
260+ "${TEST_GROUPS}")
261+
262+ # Extract CONFIG_ID from the script output
263+ CONFIG_ID=$(echo "$CONFIG_OUTPUT" | grep "CONFIG_ID=" | cut -d= -f2)
264+ echo "CONFIG_ID=${CONFIG_ID}" >> $GITHUB_OUTPUT
265+
266+ - name : Upload skipped tests summary
267+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
268+ with :
269+ name : skipped-tests-${{ steps.extract-skipped.outputs.CONFIG_ID }}
270+ path : skipped-tests-*.txt
271+ retention-days : 1
272+ if-no-files-found : ignore
273+
274+ - name : Clean up test artifacts
275+ run : rm -f phpunit-results-*.xml skipped-tests-*.txt
240276
241277 - name : Upload test coverage report to Codecov
242278 if : ${{ inputs.coverage-report }}
0 commit comments