Skip to content

Commit

Permalink
Performance tests: Make theme versions consistent cross-env (WordPres…
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart authored and sethrubenstein committed Jul 13, 2023
1 parent 130d1c0 commit e0f97b8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"wp-content/plugins/gutenberg": ".",
"wp-content/mu-plugins": "./packages/e2e-tests/mu-plugins",
"wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins",
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes"
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes",
"wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip",
"wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip"
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ async function runPerformanceTests( branches, options ) {
performanceTestDirectory,
'test/emptytheme'
),
'https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip',
'https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip',
],
env: {
tests: {
Expand All @@ -352,6 +350,15 @@ async function runPerformanceTests( branches, options ) {
performanceTestDirectory,
'packages/e2e-tests/plugins'
),
'wp-content/themes/gutenberg-test-themes':
path.join(
performanceTestDirectory,
'test/gutenberg-test-themes'
),
'wp-content/themes/gutenberg-test-themes/twentytwentyone':
'https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip',
'wp-content/themes/gutenberg-test-themes/twentytwentythree':
'https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ describe( 'Front End Performance', () => {
};

beforeAll( async () => {
await activateTheme( 'twentytwentythree' );
await activateTheme( 'gutenberg-test-themes/twentytwentythree' );
await logout();
} );

afterAll( async () => {
saveResultsFile( __filename, results );
await activateTheme( 'twentytwentyone' );
} );

it( 'Report TTFB, LCP, and LCP-TTFB', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe( 'Front End Performance', () => {
};

beforeAll( async () => {
await activateTheme( 'twentytwentyone' );
await activateTheme( 'gutenberg-test-themes/twentytwentyone' );
await logout();
} );

Expand Down
6 changes: 6 additions & 0 deletions packages/e2e-tests/specs/performance/post-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import path from 'path';
* WordPress dependencies
*/
import {
activateTheme,
createNewPost,
saveDraft,
insertBlock,
Expand Down Expand Up @@ -83,6 +84,11 @@ describe( 'Post Editor Performance', () => {

let traceResults;

beforeAll( async () => {
// See https://github.com/WordPress/gutenberg/pull/50905/files#r1209014677;
await activateTheme( 'gutenberg-test-themes/twentytwentyone' );
} );

afterAll( async () => {
saveResultsFile( __filename, results );
deleteFile( traceFilePath );
Expand Down
1 change: 0 additions & 1 deletion packages/e2e-tests/specs/performance/site-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ describe( 'Site Editor Performance', () => {
saveResultsFile( __filename, results );
await deleteAllTemplates( 'wp_template' );
await deleteAllTemplates( 'wp_template_part' );
await activateTheme( 'twentytwentyone' );
} );

// Number of loading measurements to take.
Expand Down

0 comments on commit e0f97b8

Please sign in to comment.