mirror of
git://develop.git.wordpress.org/
synced 2025-02-25 00:52:55 +01:00
This adds a new GitHub Action workflow that measures a set of performance metrics on every commit, so we can track changes in the performance of WordPress over time and more easily identify changes that are responsible for significant performance improvements or regressions during development cycles. The workflow measures the homepage of a classic theme (Twenty Twenty-One) and a block theme (Twenty Twenty-Three) set up with demo content from the Theme Test Data project. Using the e2e testing framework, it makes 20 requests and records the median value of the following Server Timing metrics, generated by an mu-plugin installed as part of this workflow: - Total server response time - Server time before templates are loaded - Server time during template rendering In addition to measuring the performance metrics of the current commit, it also records performance metrics of a consistent version of WordPress (6.1.1) to be used as a baseline measurement in order to remove variance caused by the GitHub workers themselves from our reporting. The measurements are collected and displayed at https://www.codevitals.run/project/wordpress. Props adamsilverstein, mukesh27, flixos90, youknowriad, oandregal, desrosj, costdev, swissspidy. Fixes #57687. git-svn-id: https://develop.svn.wordpress.org/trunk@55459 602fd350-edb4-49c9-b593-d223f7449a82
17 lines
511 B
JavaScript
17 lines
511 B
JavaScript
/**
|
|
* External dependencies.
|
|
*/
|
|
const dotenv = require( 'dotenv' );
|
|
const dotenv_expand = require( 'dotenv-expand' );
|
|
const { execSync } = require( 'child_process' );
|
|
|
|
// WP_BASE_URL interpolates LOCAL_PORT, so needs to be parsed by dotenv_expand().
|
|
dotenv_expand.expand( dotenv.config() );
|
|
|
|
// Run the tests, passing additional arguments through to the test script.
|
|
execSync(
|
|
'wp-scripts test-e2e --config tests/performance/jest.config.js ' +
|
|
process.argv.slice( 2 ).join( ' ' ),
|
|
{ stdio: 'inherit' }
|
|
);
|