Skip to content

Commit

Permalink
tmp: fake flaky tests to verify artifacts merging
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed May 4, 2024
1 parent 62fa31e commit 713455c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/specs/editor/blocks/avatar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ test.describe( 'Avatar', () => {
const updatedAvatarImage = avatarBlock.locator( 'img' );
const newSrc = await updatedAvatarImage.getAttribute( 'src' );

if ( ! process.env.TMP_SHOULD_PASS ) {
process.env.TMP_SHOULD_PASS = 1;
throw new Error( 'Faking flakiness: test 2' );

Check failure on line 75 in test/e2e/specs/editor/blocks/avatar.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed

1) [chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed Error: Faking flakiness: test 2 73 | if ( ! process.env.TMP_SHOULD_PASS ) { 74 | process.env.TMP_SHOULD_PASS = 1; > 75 | throw new Error( 'Faking flakiness: test 2' ); | ^ 76 | } 77 | 78 | expect( newSrc ).not.toBe( originalSrc ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/avatar.spec.js:75:10

Check failure on line 75 in test/e2e/specs/editor/blocks/avatar.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed

1) [chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Faking flakiness: test 2 73 | if ( ! process.env.TMP_SHOULD_PASS ) { 74 | process.env.TMP_SHOULD_PASS = 1; > 75 | throw new Error( 'Faking flakiness: test 2' ); | ^ 76 | } 77 | 78 | expect( newSrc ).not.toBe( originalSrc ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/avatar.spec.js:75:10

Check failure on line 75 in test/e2e/specs/editor/blocks/avatar.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed

1) [chromium] › editor/blocks/avatar.spec.js:29:2 › Avatar › should change image when user is changed Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Faking flakiness: test 2 73 | if ( ! process.env.TMP_SHOULD_PASS ) { 74 | process.env.TMP_SHOULD_PASS = 1; > 75 | throw new Error( 'Faking flakiness: test 2' ); | ^ 76 | } 77 | 78 | expect( newSrc ).not.toBe( originalSrc ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/avatar.spec.js:75:10
}

expect( newSrc ).not.toBe( originalSrc );
} );
} );
5 changes: 5 additions & 0 deletions test/e2e/specs/editor/blocks/missing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ test.describe( 'missing block', () => {
// Give the browser time to show the alert.
await page.evaluate( () => new Promise( window.requestIdleCallback ) );

if ( ! process.env.TMP_SHOULD_PASS ) {
process.env.TMP_SHOULD_PASS = 1;
throw new Error( 'Faking flakiness: test 1' );

Check failure on line 30 in test/e2e/specs/editor/blocks/missing.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes

1) [chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes Error: Faking flakiness: test 1 28 | if ( ! process.env.TMP_SHOULD_PASS ) { 29 | process.env.TMP_SHOULD_PASS = 1; > 30 | throw new Error( 'Faking flakiness: test 1' ); | ^ 31 | } 32 | 33 | expect( hasAlert ).toBe( false ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/missing.spec.js:30:10

Check failure on line 30 in test/e2e/specs/editor/blocks/missing.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes

1) [chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Faking flakiness: test 1 28 | if ( ! process.env.TMP_SHOULD_PASS ) { 29 | process.env.TMP_SHOULD_PASS = 1; > 30 | throw new Error( 'Faking flakiness: test 1' ); | ^ 31 | } 32 | 33 | expect( hasAlert ).toBe( false ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/missing.spec.js:30:10

Check failure on line 30 in test/e2e/specs/editor/blocks/missing.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes

1) [chromium] › editor/blocks/missing.spec.js:11:2 › missing block › should strip potentially malicious on* attributes Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Faking flakiness: test 1 28 | if ( ! process.env.TMP_SHOULD_PASS ) { 29 | process.env.TMP_SHOULD_PASS = 1; > 30 | throw new Error( 'Faking flakiness: test 1' ); | ^ 31 | } 32 | 33 | expect( hasAlert ).toBe( false ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/missing.spec.js:30:10
}

expect( hasAlert ).toBe( false );
} );

Expand Down

0 comments on commit 713455c

Please sign in to comment.