From fde20f98363ac2e56a7b546f90b668fea8ced5a7 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sun, 16 Aug 2026 10:51:10 -0700 Subject: [PATCH 1/5] Build/Test Tools: Upload scheduled PHPUnit timing results --- .../workflows/reusable-phpunit-tests-v3.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 4f7addcd4e60e..6c6fea5dc7399 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -123,6 +123,7 @@ jobs: # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. # - Run the PHPUnit tests. + # - Upload JUnit test results for scheduled runs. # - Upload the code coverage report to Codecov.io. # - Ensures version-controlled files are not modified or deleted. # - Checks out the WordPress Test reporter repository. @@ -254,7 +255,7 @@ jobs: - name: Run external HTTP tests if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-external-http.xml' || '' }} - name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }} continue-on-error: ${{ inputs.allow-errors }} @@ -264,6 +265,7 @@ jobs: --verbose \ -c "${PHPUNIT_CONFIG}" \ ${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \ + ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-main.xml' || '' }} \ ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml"' || '' }} env: TEST_GROUPS: ${{ inputs.phpunit-test-groups }} @@ -272,18 +274,27 @@ jobs: - name: Run AJAX tests if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-ajax.xml' || '' }} - name: Run ms-files tests as a multisite install if: ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-ms-files.xml' || '' }} # __fakegroup__ is excluded to force PHPUnit to ignore the settings in phpunit.xml.dist. - name: Run (Xdebug) tests if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ + run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-xdebug.xml' || '' }} + + - name: Upload PHPUnit test results + if: ${{ always() && github.event_name == 'schedule' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: phpunit-results-php-${{ inputs.php }}-${{ inputs.db-type }}-${{ inputs.db-version }}-${{ inputs.multisite && 'multisite' || 'single-site' }}-${{ inputs.memcached && 'memcached' || 'default' }}${{ inputs.phpunit-test-groups && format('-{0}', inputs.phpunit-test-groups) || '' }}${{ 'example.org' != inputs.tests-domain && '-custom-domain' || '' }} + path: tests/phpunit/build/logs/*.xml + if-no-files-found: error + retention-days: 14 - name: Upload test coverage report to Codecov if: ${{ inputs.coverage-report }} From 2602d2dcb5ce63afadc01b38cdf1dfe6a8863114 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sun, 16 Aug 2026 11:55:07 -0700 Subject: [PATCH 2/5] Build/Test Tools: Simplify PHPUnit timing artifact --- .../workflows/reusable-phpunit-tests-v3.yml | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 6c6fea5dc7399..cca52290bf803 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -123,7 +123,7 @@ jobs: # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. # - Run the PHPUnit tests. - # - Upload JUnit test results for scheduled runs. + # - Upload JUnit timing results for scheduled runs. # - Upload the code coverage report to Codecov.io. # - Ensures version-controlled files are not modified or deleted. # - Checks out the WordPress Test reporter repository. @@ -255,7 +255,7 @@ jobs: - name: Run external HTTP tests if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-external-http.xml' || '' }} + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http - name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }} continue-on-error: ${{ inputs.allow-errors }} @@ -265,36 +265,39 @@ jobs: --verbose \ -c "${PHPUNIT_CONFIG}" \ ${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \ - ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-main.xml' || '' }} \ ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml"' || '' }} env: TEST_GROUPS: ${{ inputs.phpunit-test-groups }} MULTISITE_FLAG: ${{ inputs.multisite && 'multisite' || 'single' }} + # Use the existing host test reporting job as the canonical timing environment. + - name: Upload PHPUnit timing results + if: | + always() && + github.event_name == 'schedule' && + inputs.php == '8.5' && + inputs.report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: phpunit-timing-results + path: tests/phpunit/build/logs/junit.xml + if-no-files-found: error + - name: Run AJAX tests if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-ajax.xml' || '' }} + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax - name: Run ms-files tests as a multisite install if: ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-ms-files.xml' || '' }} + run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files # __fakegroup__ is excluded to force PHPUnit to ignore the settings in phpunit.xml.dist. - name: Run (Xdebug) tests if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} - run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ ${{ github.event_name == 'schedule' && '--log-junit tests/phpunit/build/logs/junit-xdebug.xml' || '' }} - - - name: Upload PHPUnit test results - if: ${{ always() && github.event_name == 'schedule' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: phpunit-results-php-${{ inputs.php }}-${{ inputs.db-type }}-${{ inputs.db-version }}-${{ inputs.multisite && 'multisite' || 'single-site' }}-${{ inputs.memcached && 'memcached' || 'default' }}${{ inputs.phpunit-test-groups && format('-{0}', inputs.phpunit-test-groups) || '' }}${{ 'example.org' != inputs.tests-domain && '-custom-domain' || '' }} - path: tests/phpunit/build/logs/*.xml - if-no-files-found: error - retention-days: 14 + run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ - name: Upload test coverage report to Codecov if: ${{ inputs.coverage-report }} From d2733e0f5d80f42b0b1ccf5da133edcdd15e8968 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sun, 16 Aug 2026 13:12:48 -0700 Subject: [PATCH 3/5] Test only: Enable PHPUnit timing artifact on pull request --- .github/workflows/reusable-phpunit-tests-v3.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index cca52290bf803..de614ad45d3e5 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -274,7 +274,8 @@ jobs: - name: Upload PHPUnit timing results if: | always() && - github.event_name == 'schedule' && + ( github.event_name == 'schedule' || + ( github.event_name == 'pull_request' && github.event.pull_request.number == 13070 ) ) && inputs.php == '8.5' && inputs.report uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 8ccbcd4b8219b0958a974384cfa96d48ddfc9ece Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sun, 16 Aug 2026 13:26:25 -0700 Subject: [PATCH 4/5] Test only: Restore scheduled-only timing artifact --- .github/workflows/reusable-phpunit-tests-v3.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index de614ad45d3e5..cca52290bf803 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -274,8 +274,7 @@ jobs: - name: Upload PHPUnit timing results if: | always() && - ( github.event_name == 'schedule' || - ( github.event_name == 'pull_request' && github.event.pull_request.number == 13070 ) ) && + github.event_name == 'schedule' && inputs.php == '8.5' && inputs.report uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 3ff9c1994664a98458da6a1bd5ece797dd25a678 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sun, 16 Aug 2026 17:47:38 -0700 Subject: [PATCH 5/5] Build/Test Tools: Upload timing artifacts for trunk commits --- .github/workflows/reusable-phpunit-tests-v3.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index cca52290bf803..a1975b2eaa4f4 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -123,7 +123,7 @@ jobs: # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. # - Run the PHPUnit tests. - # - Upload JUnit timing results for scheduled runs. + # - Upload JUnit timing results as an artifact. # - Upload the code coverage report to Codecov.io. # - Ensures version-controlled files are not modified or deleted. # - Checks out the WordPress Test reporter repository. @@ -270,11 +270,11 @@ jobs: TEST_GROUPS: ${{ inputs.phpunit-test-groups }} MULTISITE_FLAG: ${{ inputs.multisite && 'multisite' || 'single' }} - # Use the existing host test reporting job as the canonical timing environment. - - name: Upload PHPUnit timing results + - name: Upload PHPUnit timing results as an artifact if: | always() && - github.event_name == 'schedule' && + github.event_name == 'push' && + github.ref == 'refs/heads/trunk' && inputs.php == '8.5' && inputs.report uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1