Skip to content

Commit

Permalink
Perf Tests: Store Chrome trace profile for post-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Jan 27, 2023
1 parent 6a64cdf commit c0ac577
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ jobs:
if: github.event_name == 'pull_request'
run: ./bin/plugin/cli.js perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA

- name: Store post-editor perf trace
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
with:
name: perf-test-trace
path: /home/runner/perf-post-editor-trace.json

- name: Compare performance with current WordPress Core and previous Gutenberg versions
if: github.event_name == 'release'
env:
Expand Down
6 changes: 3 additions & 3 deletions packages/e2e-tests/specs/performance/post-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
*/
import {
readFile,
deleteFile,
getTypingEventDurations,
getClickEventDurations,
getHoverEventDurations,
Expand Down Expand Up @@ -77,7 +76,9 @@ describe( 'Post Editor Performance', () => {
inserterHover: [],
inserterSearch: [],
};
const traceFile = __dirname + '/trace.json';
const traceFile = '/home/runner/perf-post-editor-trace.json';
// eslint-disable-next-line no-console
console.log( `Storing trace in ${ traceFile }` );
let traceResults;

afterAll( async () => {
Expand All @@ -86,7 +87,6 @@ describe( 'Post Editor Performance', () => {
join( __dirname, resultsFilename ),
JSON.stringify( results, null, 2 )
);
deleteFile( traceFile );
} );

beforeEach( async () => {
Expand Down

0 comments on commit c0ac577

Please sign in to comment.