Skip to content

Commit

Permalink
docs: Fix report-flaky-test link (#53848)
Browse files Browse the repository at this point in the history
* docs: Fix report-flaky-test link

The previous URL resulted in a 404 Not Found error.

* docs: Format documentation with Prettier
  • Loading branch information
dcalhoun authored Aug 21, 2023
1 parent 13bcad8 commit 9bd56dc
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions docs/contributors/code/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,10 @@ test( 'fires onChange when a new value is typed', () => {
**Good**: using `user-event` to simulate user events.
```javascript

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

test('fires onChange when a new value is typed', async () => {
test( 'fires onChange when a new value is typed', async () => {
const user = userEvent.setup();

const spyOnChange = jest.fn();
Expand All @@ -287,7 +286,7 @@ test('fires onChange when a new value is typed', async () => {
await user.selectOptions( select, [ 'optionValue' ] );

// ...
})
} );
```
### Integration testing for block UI
Expand All @@ -301,9 +300,7 @@ The advantage of this approach is that the bulk of a block editor's functionalit
To set up a jest file for integration tests:
```js
import {
initializeEditor
} from 'test/integration/helpers/integration-test-editor';
import { initializeEditor } from 'test/integration/helpers/integration-test-editor';

async function setup( attributes ) {
const testBlock = { name: 'core/cover', attributes };
Expand Down Expand Up @@ -470,9 +467,7 @@ Similarly, the `toMatchStyleDiffSnapshot` function allows to snapshot only the d
test( 'should render margin', () => {
const { container: spacer } = render( <Spacer /> );
const { container: spacerWithMargin } = render( <Spacer margin={ 5 } /> );
expect( spacerWithMargin ).toMatchStyleDiffSnapshot(
spacer
);
expect( spacerWithMargin ).toMatchStyleDiffSnapshot( spacer );
} );
```
Expand Down Expand Up @@ -516,7 +511,7 @@ There is an ongoing effort to add integration tests to the native mobile project

Most existing End-to-end tests currently use [Puppeteer](https://github.com/puppeteer/puppeteer) as a headless Chromium driver to run the tests in `packages/e2e-tests`, and are otherwise still run by a [Jest](https://jestjs.io/) test runner.

There's an ongoing [project](https://github.com/WordPress/gutenberg/issues/38851) to migrate them from Puppeteer to Playwright. **It's recommended to write new e2e tests in Playwright whenever possible**. The sections below mostly apply to the old Jest + Puppeteer framework. See the dedicated [guide](/docs/contributors/code/e2e/README.md) if you're writing tests with Playwright.**
There's an ongoing [project](https://github.com/WordPress/gutenberg/issues/38851) to migrate them from Puppeteer to Playwright. **It's recommended to write new e2e tests in Playwright whenever possible**. The sections below mostly apply to the old Jest + Puppeteer framework. See the dedicated [guide](/docs/contributors/code/e2e/README.md) if you're writing tests with Playwright.
### Using wp-env
Expand Down Expand Up @@ -598,7 +593,7 @@ Every core block is required to have at least one set of fixture files for its m

### Flaky Tests

A test is considered to be **flaky** when it can pass and fail across multiple retry attempts without any code changes. We auto retry failed tests at most **twice** on CI to detect and report them to GitHub issues automatically under the [`[Type] Flaky Test`](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22%5BType%5D+Flaky+Test%22) label via [`report-flaky-tests`](https://github.com/WordPress/gutenberg/blob/trunk/.github/report-flaky-tests/index.js) GitHub action. Note that a test that failed three times in a row is not counted as a flaky test and will not be reported to an issue.
A test is considered to be **flaky** when it can pass and fail across multiple retry attempts without any code changes. We auto retry failed tests at most **twice** on CI to detect and report them to GitHub issues automatically under the [`[Type] Flaky Test`](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22%5BType%5D+Flaky+Test%22) label via [`report-flaky-tests`](https://github.com/WordPress/gutenberg/tree/trunk/packages/report-flaky-tests) GitHub action. Note that a test that failed three times in a row is not counted as a flaky test and will not be reported to an issue.

## PHP Testing

Expand Down

1 comment on commit 9bd56dc

@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 9bd56dc.
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/5927904441
📝 Reported issues:

Please sign in to comment.