Skip to content

Commit

Permalink
Fix the performance tests jobs (#48094)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Feb 21, 2023
1 parent b935741 commit fece133
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ async function runPerformanceTests( branches, options ) {
log( ` >> Fetching the ${ fancyBranch } branch` );
// @ts-ignore
await SimpleGit( buildPath ).reset( 'hard' ).checkout( branch );

log( ` >> Building the ${ fancyBranch } branch` );
await runShellScript(
'npm ci && npm run prebuild:packages && node ./bin/packages/build.js && npx wp-scripts build',
buildPath
);
}

log( ` >> Building the ${ fancyBranch } branch` );
await runShellScript(
'npm ci && npm run prebuild:packages && node ./bin/packages/build.js && npx wp-scripts build',
buildPath
);

await runShellScript(
'cp ' +
path.resolve(
Expand Down
18 changes: 10 additions & 8 deletions packages/e2e-test-utils/src/site-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ export async function openPreviousGlobalStylesPanel() {
* Enters edit mode.
*/
export async function enterEditMode() {
const isViewMode = await page.$(
'.edit-site-visual-editor__editor-canvas[role="button"]'
);
// This check is necessary for the performance tests in old branches
// where the site editor toggle was not implemented yet.
if ( ! isViewMode ) {
return;
try {
await page.waitForSelector(
'.edit-site-visual-editor__editor-canvas[role="button"]',
{ timeout: 3000 }
);

await canvas().click( 'body' );
} catch {
// This catch is necessary for the performance tests in old branches
// where the site editor toggle was not implemented yet.
}
await canvas().click( 'body' );
}
4 changes: 0 additions & 4 deletions packages/e2e-tests/specs/performance/site-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ describe( 'Site Editor Performance', () => {
await visitSiteEditor( {
postId: id,
postType: 'page',
// This shouldn't be necessary, but without it the tests fail.
// Could be related to having the necessary cookies in the browser.
// See https://github.com/WordPress/gutenberg/pull/48240/files#r1111760556
path: '/navigation/single',
} );
} );

Expand Down

1 comment on commit fece133

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in fece133.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4232351187
📝 Reported issues:

Please sign in to comment.