<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[59577] trunk: Build/Test Tools: Expand performance tests setup.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/59577">59577</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/59577","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>swissspidy</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2025-01-06 10:29:09 +0000 (Mon, 06 Jan 2025)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Test Tools: Expand performance tests setup.

Run tests against Multisite (possible since <a href="https://core.trac.wordpress.org/changeset/58097">[58097]</a>) and on single post pages. Also improve cache flushes/resets between iterations.

Props swissspidy, flixos90, desrosj, mukesh27.
Fixes <a href="https://core.trac.wordpress.org/ticket/62725">#62725</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgithubworkflowsperformanceyml">trunk/.github/workflows/performance.yml</a></li>
<li><a href="#trunkgithubworkflowsreusableperformanceyml">trunk/.github/workflows/reusable-performance.yml</a></li>
<li><a href="#trunktestsperformancecompareresultsjs">trunk/tests/performance/compare-results.js</a></li>
<li><a href="#trunktestsperformancelogresultsjs">trunk/tests/performance/log-results.js</a></li>
<li><a href="#trunktestsperformancespecsadmintestjs">trunk/tests/performance/specs/admin.test.js</a></li>
<li><a href="#trunktestsperformancespecshometestjs">trunk/tests/performance/specs/home.test.js</a></li>
<li><a href="#trunktestsperformanceutilsjs">trunk/tests/performance/utils.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsperformancespecssingleposttestjs">trunk/tests/performance/specs/single-post.test.js</a></li>
<li><a href="#trunktestsperformancewpcontentmupluginsclearcachephp">trunk/tests/performance/wp-content/mu-plugins/clear-cache.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgithubworkflowsperformanceyml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.github/workflows/performance.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.github/workflows/performance.yml   2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/.github/workflows/performance.yml     2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> jobs:
</span><span class="cx" style="display: block; padding: 0 10px">   # Runs the performance test suite.
</span><span class="cx" style="display: block; padding: 0 10px">   performance:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    name: ${{ matrix.multisite && 'Multisite' || 'Single site' }}
</ins><span class="cx" style="display: block; padding: 0 10px">     uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk
</span><span class="cx" style="display: block; padding: 0 10px">     permissions:
</span><span class="cx" style="display: block; padding: 0 10px">       contents: read
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,8 +41,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">       fail-fast: false
</span><span class="cx" style="display: block; padding: 0 10px">       matrix:
</span><span class="cx" style="display: block; padding: 0 10px">         memcached: [ true, false ]
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        multisite: [ true, false ]
</ins><span class="cx" style="display: block; padding: 0 10px">     with:
</span><span class="cx" style="display: block; padding: 0 10px">       memcached: ${{ matrix.memcached }}
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      multisite: ${{ matrix.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px">     secrets:
</span><span class="cx" style="display: block; padding: 0 10px">       CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunkgithubworkflowsreusableperformanceyml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.github/workflows/reusable-performance.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.github/workflows/reusable-performance.yml  2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/.github/workflows/reusable-performance.yml    2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,7 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ##
</span><span class="cx" style="display: block; padding: 0 10px"> # A reusable workflow that runs the performance test suite.
</span><span class="cx" style="display: block; padding: 0 10px"> ##
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-name: Performance Tests
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+name: Run performance Tests
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> on:
</span><span class="cx" style="display: block; padding: 0 10px">   workflow_call:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,6 +26,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">         required: false
</span><span class="cx" style="display: block; padding: 0 10px">         type: 'boolean'
</span><span class="cx" style="display: block; padding: 0 10px">         default: false
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      multisite:
+        description: 'Whether to use Multisite.'
+        required: false
+        type: 'boolean'
+        default: false
</ins><span class="cx" style="display: block; padding: 0 10px">     secrets:
</span><span class="cx" style="display: block; padding: 0 10px">       CODEVITALS_PROJECT_TOKEN:
</span><span class="cx" style="display: block; padding: 0 10px">         description: 'The authorization token for https://www.codevitals.run/project/wordpress.'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,6 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">   LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
</span><span class="cx" style="display: block; padding: 0 10px">   LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }}
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  LOCAL_MULTISITE: ${{ inputs.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> jobs:
</span><span class="cx" style="display: block; padding: 0 10px">   # Performs the following steps:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,9 +71,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">   # - Install Playwright browsers.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Build WordPress.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Start Docker environment.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  # - Install object cache drop-in.
</ins><span class="cx" style="display: block; padding: 0 10px">   # - Log running Docker containers.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Docker debug information.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Install WordPress.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  # - Enable themes on Multisite.
</ins><span class="cx" style="display: block; padding: 0 10px">   # - Install WordPress Importer plugin.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Import mock data.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Deactivate WordPress Importer plugin.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">   # - Publish performance results.
</span><span class="cx" style="display: block; padding: 0 10px">   # - Ensure version-controlled files are not modified or deleted.
</span><span class="cx" style="display: block; padding: 0 10px">   performance:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    name: Run tests
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    name: ${{ inputs.multisite && 'Multisite' || 'Single site' }} / ${{ inputs.memcached && 'Memcached' || 'Default' }}
</ins><span class="cx" style="display: block; padding: 0 10px">     runs-on: ubuntu-latest
</span><span class="cx" style="display: block; padding: 0 10px">     permissions:
</span><span class="cx" style="display: block; padding: 0 10px">       contents: read
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,6 +174,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">       - name: Install WordPress
</span><span class="cx" style="display: block; padding: 0 10px">         run: npm run env:install
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      - name: Enable themes on Multisite
+        if: ${{ inputs.multisite }}
+        run: |
+          npm run env:cli -- theme enable twentytwentyone --network --path=/var/www/${{ env.LOCAL_DIR }}
+          npm run env:cli -- theme enable twentytwentythree --network --path=/var/www/${{ env.LOCAL_DIR }}
+          npm run env:cli -- theme enable twentytwentyfour --network --path=/var/www/${{ env.LOCAL_DIR }}
+          npm run env:cli -- theme enable twentytwentyfive --network --path=/var/www/${{ env.LOCAL_DIR }}
+
</ins><span class="cx" style="display: block; padding: 0 10px">       - name: Install WordPress Importer plugin
</span><span class="cx" style="display: block; padding: 0 10px">         run: npm run env:cli -- plugin install wordpress-importer --activate --path=/var/www/${{ env.LOCAL_DIR }}
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,7 +306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
</span><span class="cx" style="display: block; padding: 0 10px">         if: always()
</span><span class="cx" style="display: block; padding: 0 10px">         with:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-          name: performance-artifacts${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          name: performance-artifacts${{ inputs.multisite && '-multisite' || '' }}${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
</ins><span class="cx" style="display: block; padding: 0 10px">           path: artifacts
</span><span class="cx" style="display: block; padding: 0 10px">           if-no-files-found: ignore
</span><span class="cx" style="display: block; padding: 0 10px">           include-hidden-files: true
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">       - name: Set the base sha
</span><span class="cx" style="display: block; padding: 0 10px">         # Only needed when publishing results.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px">         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
</span><span class="cx" style="display: block; padding: 0 10px">         id: base-sha
</span><span class="cx" style="display: block; padding: 0 10px">         with:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,7 +330,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">       - name: Set commit details
</span><span class="cx" style="display: block; padding: 0 10px">         # Only needed when publishing results.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px">         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
</span><span class="cx" style="display: block; padding: 0 10px">         id: commit-timestamp
</span><span class="cx" style="display: block; padding: 0 10px">         with:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,7 +341,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">       - name: Publish performance results
</span><span class="cx" style="display: block; padding: 0 10px">         # Only publish results on pushes to trunk.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px">         env:
</span><span class="cx" style="display: block; padding: 0 10px">           BASE_SHA: ${{ steps.base-sha.outputs.result }}
</span><span class="cx" style="display: block; padding: 0 10px">           COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
</span></span></pre></div>
<a id="trunktestsperformancecompareresultsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/performance/compare-results.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/compare-results.js        2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/tests/performance/compare-results.js  2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,6 +96,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+summaryMarkdown += `<details><summary>Results</summary>`;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> for ( const { title, results } of afterStats ) {
</span><span class="cx" style="display: block; padding: 0 10px">        const prevStat = beforeStats.find( ( s ) => s.title === title );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,10 +145,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                console.log( '(no results)' );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        summaryMarkdown += `**${ title }**\n\n`;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ summaryMarkdown += `<b>${ title }</b>\n\n`;
</ins><span class="cx" style="display: block; padding: 0 10px">         summaryMarkdown += `${ formatAsMarkdownTable( rows ) }\n`;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+summaryMarkdown += `</details>`;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> writeFileSync(
</span><span class="cx" style="display: block; padding: 0 10px">        join( process.env.WP_ARTIFACTS_PATH, '/performance-results.md' ),
</span><span class="cx" style="display: block; padding: 0 10px">        summaryMarkdown
</span></span></pre></div>
<a id="trunktestsperformancelogresultsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/performance/log-results.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/log-results.js    2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/tests/performance/log-results.js      2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,12 +18,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const testSuiteMap = {
</span><span class="cx" style="display: block; padding: 0 10px">        'Admin › Locale: en_US': 'admin',
</span><span class="cx" style="display: block; padding: 0 10px">        'Admin › Locale: de_DE': 'admin-l10n',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        'Front End › Theme: twentytwentyone, Locale: en_US': 'home-classic-theme',
-       'Front End › Theme: twentytwentyone, Locale: de_DE':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Homepage › Theme: twentytwentyone, Locale: en_US': 'home-classic-theme',
+       'Homepage › Theme: twentytwentyone, Locale: de_DE':
</ins><span class="cx" style="display: block; padding: 0 10px">                 'home-classic-theme-l10n',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        'Front End › Theme: twentytwentythree, Locale: en_US': 'home-block-theme',
-       'Front End › Theme: twentytwentythree, Locale: de_DE':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Homepage › Theme: twentytwentythree, Locale: en_US': 'home-block-theme',
+       'Homepage › Theme: twentytwentythree, Locale: de_DE':
</ins><span class="cx" style="display: block; padding: 0 10px">                 'home-block-theme-l10n',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        'Homepage › Theme: twentytwentyfour, Locale: en_US': 'home-twentytwentyfour',
+       'Homepage › Theme: twentytwentyfour, Locale: de_DE':
+               'home-twentytwentyfour-l10n',
+       'Homepage › Theme: twentytwentyfive, Locale: en_US': 'home-twentytwentyfive',
+       'Homepage › Theme: twentytwentyfive, Locale: de_DE':
+               'home-twentytwentyfive-l10n',
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsperformancespecsadmintestjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/performance/specs/admin.test.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/specs/admin.test.js       2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/tests/performance/specs/admin.test.js 2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,14 +6,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Internal dependencies
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-import { camelCaseDashes } from '../utils';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+import { camelCaseDashes, locales } from '../utils';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> const results = {
</span><span class="cx" style="display: block; padding: 0 10px">        timeToFirstByte: [],
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-const locales = [ 'en_US', 'de_DE' ];
-
</del><span class="cx" style="display: block; padding: 0 10px"> test.describe( 'Admin', () => {
</span><span class="cx" style="display: block; padding: 0 10px">        for ( const locale of locales ) {
</span><span class="cx" style="display: block; padding: 0 10px">                test.describe( `Locale: ${ locale }`, () => {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,9 +45,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        const iterations = Number( process.env.TEST_RUNS );
</span><span class="cx" style="display: block; padding: 0 10px">                        for ( let i = 1; i <= iterations; i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                test( `Measure load time metrics (${ i } of ${ iterations })`, async ( {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        page,
</ins><span class="cx" style="display: block; padding: 0 10px">                                         admin,
</span><span class="cx" style="display: block; padding: 0 10px">                                        metrics,
</span><span class="cx" style="display: block; padding: 0 10px">                                } ) => {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        // Clear caches using the clear-cache.php mu-plugin. Not actually loading the page.
+                                       await page.goto( '/?clear_cache' );
+
+                                       // This is the actual page to test.
</ins><span class="cx" style="display: block; padding: 0 10px">                                         await admin.visitAdminPage( '/' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        const serverTiming = await metrics.getServerTiming();
</span></span></pre></div>
<a id="trunktestsperformancespecshometestjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/performance/specs/home.test.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/specs/home.test.js        2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/tests/performance/specs/home.test.js  2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Internal dependencies
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-import { camelCaseDashes } from '../utils';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+import { camelCaseDashes, themes, locales } from '../utils';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> const results = {
</span><span class="cx" style="display: block; padding: 0 10px">        timeToFirstByte: [],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,11 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        lcpMinusTtfb: [],
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-const themes = [ 'twentytwentyone', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive' ];
-
-const locales = [ 'en_US', 'de_DE' ];
-
-test.describe( 'Front End', () => {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+test.describe( 'Homepage', () => {
</ins><span class="cx" style="display: block; padding: 0 10px">         test.use( {
</span><span class="cx" style="display: block; padding: 0 10px">                storageState: {}, // User will be logged out.
</span><span class="cx" style="display: block; padding: 0 10px">        } );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,6 +50,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                page,
</span><span class="cx" style="display: block; padding: 0 10px">                                                metrics,
</span><span class="cx" style="display: block; padding: 0 10px">                                        } ) => {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                // Clear caches using the clear-cache.php mu-plugin. Not actually loading the page.
+                                               await page.goto( '/?clear_cache' );
+
+                                               // This is the actual page to test.
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 await page.goto( '/' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                                const serverTiming = await metrics.getServerTiming();
</span></span></pre></div>
<a id="trunktestsperformancespecssingleposttestjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/performance/specs/single-post.test.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/specs/single-post.test.js                         (rev 0)
+++ trunk/tests/performance/specs/single-post.test.js   2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,79 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * WordPress dependencies
+ */
+import { test } from '@wordpress/e2e-test-utils-playwright';
+
+/**
+ * Internal dependencies
+ */
+import { camelCaseDashes, themes, locales } from '../utils';
+
+const results = {
+       timeToFirstByte: [],
+       largestContentfulPaint: [],
+       lcpMinusTtfb: [],
+};
+
+test.describe( 'Single Post', () => {
+       test.use( {
+               storageState: {}, // User will be logged out.
+       } );
+
+       for ( const theme of themes ) {
+               for ( const locale of locales ) {
+                       test.describe( `Theme: ${ theme }, Locale: ${ locale }`, () => {
+                               test.beforeAll( async ( { requestUtils } ) => {
+                                       await requestUtils.activateTheme( theme );
+                                       await requestUtils.updateSiteSettings( {
+                                               language: 'en_US' === locale ? '' : locale,
+                                       } );
+                               } );
+
+                               test.afterAll( async ( { requestUtils }, testInfo ) => {
+                                       await testInfo.attach( 'results', {
+                                               body: JSON.stringify( results, null, 2 ),
+                                               contentType: 'application/json',
+                                       } );
+
+                                       await requestUtils.updateSiteSettings( {
+                                               language: '',
+                                       } );
+
+                                       results.largestContentfulPaint = [];
+                                       results.timeToFirstByte = [];
+                                       results.lcpMinusTtfb = [];
+                               } );
+
+                               const iterations = Number( process.env.TEST_RUNS );
+                               for ( let i = 1; i <= iterations; i++ ) {
+                                       test( `Measure load time metrics (${ i } of ${ iterations })`, async ( {
+                                               page,
+                                               metrics,
+                                       } ) => {
+                                               // Clear caches using the clear-cache.php mu-plugin. Not actually loading the page.
+                                               await page.goto( '/?clear_cache' );
+
+                                               // This is the actual page to test.
+                                               await page.goto( '/2018/11/03/block-image/' );
+
+                                               const serverTiming = await metrics.getServerTiming();
+
+                                               for ( const [ key, value ] of Object.entries(
+                                                       serverTiming
+                                               ) ) {
+                                                       results[ camelCaseDashes( key ) ] ??= [];
+                                                       results[ camelCaseDashes( key ) ].push( value );
+                                               }
+
+                                               const ttfb = await metrics.getTimeToFirstByte();
+                                               const lcp = await metrics.getLargestContentfulPaint();
+
+                                               results.largestContentfulPaint.push( lcp );
+                                               results.timeToFirstByte.push( ttfb );
+                                               results.lcpMinusTtfb.push( lcp - ttfb );
+                                       } );
+                               }
+                       } );
+               }
+       }
+} );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/performance/specs/single-post.test.js
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsperformanceutilsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/performance/utils.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/utils.js  2025-01-05 22:12:25 UTC (rev 59576)
+++ trunk/tests/performance/utils.js    2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,6 +6,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> process.env.WP_ARTIFACTS_PATH ??= join( process.cwd(), 'artifacts' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+const locales = [ 'en_US', 'de_DE' ];
+
+const themes = [ 'twentytwentyone', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive' ];
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Parse test files into JSON objects.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,4 +193,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        standardDeviation,
</span><span class="cx" style="display: block; padding: 0 10px">        medianAbsoluteDeviation,
</span><span class="cx" style="display: block; padding: 0 10px">        accumulateValues,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        themes,
+       locales,
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span></span></pre></div>
<a id="trunktestsperformancewpcontentmupluginsclearcachephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/performance/wp-content/mu-plugins/clear-cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/performance/wp-content/mu-plugins/clear-cache.php                             (rev 0)
+++ trunk/tests/performance/wp-content/mu-plugins/clear-cache.php       2025-01-06 10:29:09 UTC (rev 59577)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,27 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+add_action(
+       'plugins_loaded',
+       static function () {
+               if ( isset( $_GET['clear_cache'] ) ) {
+                       if ( function_exists( 'opcache_reset' ) ) {
+                               opcache_reset();
+                       }
+
+                       if ( function_exists( 'apcu_clear_cache' ) ) {
+                               apcu_clear_cache();
+                       }
+
+                       wp_cache_flush();
+
+                       delete_expired_transients( true );
+
+                       clearstatcache( true );
+
+                       status_header( 202 );
+
+                       die;
+               }
+       },
+       1
+);
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/performance/wp-content/mu-plugins/clear-cache.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>