Changeset 63410
- Timestamp:
- 08/31/2026 05:03:14 PM (2 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 2 edited
-
.github/workflows/phpunit-tests.yml (modified) (1 diff)
-
.github/workflows/reusable-phpunit-tests-v3.yml (modified) (3 diffs)
-
tests/phpunit/includes/class-wp-phpunit-timing-metrics.php (added)
-
tests/phpunit/prepare-timing-results.php (added)
-
tests/phpunit/tests/includes/junitTimingMetrics.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/phpunit-tests.yml
r63396 r63410 82 82 contents: read 83 83 secrets: 84 CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} 84 85 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 85 86 WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} -
trunk/.github/workflows/reusable-phpunit-tests-v3.yml
r63163 r63410 84 84 default: '' 85 85 secrets: 86 CODEVITALS_PROJECT_TOKEN: 87 description: 'The authorization token for publishing results to CodeVitals.' 88 required: false 86 89 CODECOV_TOKEN: 87 90 description: 'The Codecov token required for uploading reports.' … … 124 127 # - Install WordPress within the Docker container. 125 128 # - Run the PHPUnit tests. 129 # - Publish PHPUnit timing metrics to CodeVitals. 126 130 # - Upload the code coverage report to Codecov.io. 127 131 # - Ensures version-controlled files are not modified or deleted. … … 270 274 MULTISITE_FLAG: ${{ inputs.multisite && 'multisite' || 'single' }} 271 275 276 - name: Publish PHPUnit timing metrics 277 continue-on-error: true 278 if: | 279 github.event_name == 'push' && 280 github.ref == 'refs/heads/trunk' && 281 inputs.php == '8.5' && 282 inputs.report 283 env: 284 CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} 285 shell: bash 286 run: | 287 if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then 288 echo "PHPUnit timing metrics could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set" 289 exit 1 290 fi 291 COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format='%cI')" 292 RESPONSE="$( 293 php tests/phpunit/prepare-timing-results.php \ 294 tests/phpunit/build/logs/junit.xml \ 295 trunk \ 296 "$GITHUB_SHA" \ 297 "$COMMITTED_AT" \ 298 | curl --fail-with-body --silent --show-error \ 299 --request POST \ 300 --header 'Content-Type: application/json' \ 301 --data-binary @- \ 302 "https://codevitals.run/api/log?token=${CODEVITALS_PROJECT_TOKEN}" 303 )" 304 if ! php -r "\$d = json_decode(file_get_contents('php://stdin'), true); exit(is_array(\$d) && (\$d['status'] ?? null) === 'ok' && (int) (\$d['count'] ?? 0) === 6 ? 0 : 1);" <<< "$RESPONSE"; then 305 echo 'CodeVitals did not accept all six PHPUnit timing metrics.' 306 exit 1 307 fi 308 echo 'Published six PHPUnit timing metrics to CodeVitals.' 309 272 310 - name: Run AJAX tests 273 311 if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)