Changeset 59577
- Timestamp:
- 01/06/2025 10:29:09 AM (8 days ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/performance.yml
r59507 r59577 33 33 # Runs the performance test suite. 34 34 performance: 35 name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }}35 name: ${{ matrix.multisite && 'Multisite' || 'Single site' }} 36 36 uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk 37 37 permissions: … … 42 42 matrix: 43 43 memcached: [ true, false ] 44 multisite: [ true, false ] 44 45 with: 45 46 memcached: ${{ matrix.memcached }} 47 multisite: ${{ matrix.multisite }} 46 48 secrets: 47 49 CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} -
trunk/.github/workflows/reusable-performance.yml
r59571 r59577 2 2 # A reusable workflow that runs the performance test suite. 3 3 ## 4 name: Performance Tests4 name: Run performance Tests 5 5 6 6 on: … … 24 24 memcached: 25 25 description: 'Whether to enable memcached.' 26 required: false 27 type: 'boolean' 28 default: false 29 multisite: 30 description: 'Whether to use Multisite.' 26 31 required: false 27 32 type: 'boolean' … … 54 59 LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }} 55 60 LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }} 61 LOCAL_MULTISITE: ${{ inputs.multisite }} 56 62 57 63 jobs: … … 66 72 # - Build WordPress. 67 73 # - Start Docker environment. 74 # - Install object cache drop-in. 68 75 # - Log running Docker containers. 69 76 # - Docker debug information. 70 77 # - Install WordPress. 78 # - Enable themes on Multisite. 71 79 # - Install WordPress Importer plugin. 72 80 # - Import mock data. … … 99 107 # - Ensure version-controlled files are not modified or deleted. 100 108 performance: 101 name: Run tests109 name: ${{ inputs.multisite && 'Multisite' || 'Single site' }} / ${{ inputs.memcached && 'Memcached' || 'Default' }} 102 110 runs-on: ubuntu-latest 103 111 permissions: … … 167 175 run: npm run env:install 168 176 177 - name: Enable themes on Multisite 178 if: ${{ inputs.multisite }} 179 run: | 180 npm run env:cli -- theme enable twentytwentyone --network --path=/var/www/${{ env.LOCAL_DIR }} 181 npm run env:cli -- theme enable twentytwentythree --network --path=/var/www/${{ env.LOCAL_DIR }} 182 npm run env:cli -- theme enable twentytwentyfour --network --path=/var/www/${{ env.LOCAL_DIR }} 183 npm run env:cli -- theme enable twentytwentyfive --network --path=/var/www/${{ env.LOCAL_DIR }} 184 169 185 - name: Install WordPress Importer plugin 170 186 run: npm run env:cli -- plugin install wordpress-importer --activate --path=/var/www/${{ env.LOCAL_DIR }} … … 291 307 if: always() 292 308 with: 293 name: performance-artifacts${{ inputs.m emcached && '-memcached' || '' }}-${{ github.run_id }}309 name: performance-artifacts${{ inputs.multisite && '-multisite' || '' }}${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }} 294 310 path: artifacts 295 311 if-no-files-found: ignore … … 304 320 - name: Set the base sha 305 321 # Only needed when publishing results. 306 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}322 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }} 307 323 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 308 324 id: base-sha … … 315 331 - name: Set commit details 316 332 # Only needed when publishing results. 317 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}333 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }} 318 334 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 319 335 id: commit-timestamp … … 326 342 - name: Publish performance results 327 343 # Only publish results on pushes to trunk. 328 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}344 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }} 329 345 env: 330 346 BASE_SHA: ${{ steps.base-sha.outputs.result }} -
trunk/tests/performance/compare-results.js
r58076 r59577 97 97 } 98 98 99 summaryMarkdown += `<details><summary>Results</summary>`; 100 99 101 for ( const { title, results } of afterStats ) { 100 102 const prevStat = beforeStats.find( ( s ) => s.title === title ); … … 144 146 } 145 147 146 summaryMarkdown += ` **${ title }**\n\n`;148 summaryMarkdown += `<b>${ title }</b>\n\n`; 147 149 summaryMarkdown += `${ formatAsMarkdownTable( rows ) }\n`; 148 150 } 151 152 summaryMarkdown += `</details>`; 149 153 150 154 writeFileSync( -
trunk/tests/performance/log-results.js
r59170 r59577 19 19 'Admin › Locale: en_US': 'admin', 20 20 'Admin › Locale: de_DE': 'admin-l10n', 21 ' Front End› Theme: twentytwentyone, Locale: en_US': 'home-classic-theme',22 ' Front End› Theme: twentytwentyone, Locale: de_DE':21 'Homepage › Theme: twentytwentyone, Locale: en_US': 'home-classic-theme', 22 'Homepage › Theme: twentytwentyone, Locale: de_DE': 23 23 'home-classic-theme-l10n', 24 ' Front End› Theme: twentytwentythree, Locale: en_US': 'home-block-theme',25 ' Front End› Theme: twentytwentythree, Locale: de_DE':24 'Homepage › Theme: twentytwentythree, Locale: en_US': 'home-block-theme', 25 'Homepage › Theme: twentytwentythree, Locale: de_DE': 26 26 'home-block-theme-l10n', 27 'Homepage › Theme: twentytwentyfour, Locale: en_US': 'home-twentytwentyfour', 28 'Homepage › Theme: twentytwentyfour, Locale: de_DE': 29 'home-twentytwentyfour-l10n', 30 'Homepage › Theme: twentytwentyfive, Locale: en_US': 'home-twentytwentyfive', 31 'Homepage › Theme: twentytwentyfive, Locale: de_DE': 32 'home-twentytwentyfive-l10n', 27 33 }; 28 34 -
trunk/tests/performance/specs/admin.test.js
r58076 r59577 7 7 * Internal dependencies 8 8 */ 9 import { camelCaseDashes } from '../utils';9 import { camelCaseDashes, locales } from '../utils'; 10 10 11 11 const results = { 12 12 timeToFirstByte: [], 13 13 }; 14 15 const locales = [ 'en_US', 'de_DE' ];16 14 17 15 test.describe( 'Admin', () => { … … 48 46 for ( let i = 1; i <= iterations; i++ ) { 49 47 test( `Measure load time metrics (${ i } of ${ iterations })`, async ( { 48 page, 50 49 admin, 51 50 metrics, 52 51 } ) => { 52 // Clear caches using the clear-cache.php mu-plugin. Not actually loading the page. 53 await page.goto( '/?clear_cache' ); 54 55 // This is the actual page to test. 53 56 await admin.visitAdminPage( '/' ); 54 57 -
trunk/tests/performance/specs/home.test.js
r59524 r59577 7 7 * Internal dependencies 8 8 */ 9 import { camelCaseDashes } from '../utils';9 import { camelCaseDashes, themes, locales } from '../utils'; 10 10 11 11 const results = { … … 15 15 }; 16 16 17 const themes = [ 'twentytwentyone', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive' ]; 18 19 const locales = [ 'en_US', 'de_DE' ]; 20 21 test.describe( 'Front End', () => { 17 test.describe( 'Homepage', () => { 22 18 test.use( { 23 19 storageState: {}, // User will be logged out. … … 55 51 metrics, 56 52 } ) => { 53 // Clear caches using the clear-cache.php mu-plugin. Not actually loading the page. 54 await page.goto( '/?clear_cache' ); 55 56 // This is the actual page to test. 57 57 await page.goto( '/' ); 58 58 -
trunk/tests/performance/utils.js
r58076 r59577 6 6 7 7 process.env.WP_ARTIFACTS_PATH ??= join( process.cwd(), 'artifacts' ); 8 9 const locales = [ 'en_US', 'de_DE' ]; 10 11 const themes = [ 'twentytwentyone', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive' ]; 8 12 9 13 /** … … 190 194 medianAbsoluteDeviation, 191 195 accumulateValues, 196 themes, 197 locales, 192 198 };
Note: See TracChangeset
for help on using the changeset viewer.