WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.37k stars 4.15k forks source link

Test fixtures: Look at options for sharing block test fixtures #40672

Open glendaviesnz opened 2 years ago

glendaviesnz commented 2 years ago

What problem does this address?

Currently there is some duplication of block test fixtures between Gutenberg plugin and WordPress core, and 3rd party plugins can't easily access and make use of these fixtures in their own tests.

What is your proposed solution?

Look for a way to make the fixtures shareable, and decide where the one source of truth for these should be.

Related discussion

talldan commented 2 years ago

@manooweb Would you be able to add some background on why these fixture files would be useful for you.

manooweb commented 2 years ago

We have a feature to be able to make translation on the fly for some blocks. For example:

To check about any changes in them (as it happened recently with the gallery block), we wrote some PHPUnit tests based on these fixtures which are in a Gutenberg package at the beginning, until Gutenberg 11.1.0 in packages/e2e-tests/fixtures/blocks. Now it has been moved from this place to test/integration/fixtures/blocks which isn't sharable anymore.

At this time, we didn't see that this fixtures also exist in the WordPress tests suite. As we already download the WordPress tests suite to run all our PHPUnit tests in our CI environment, we wonder if it's relevant to use these fixtures at this place.

With the latest talks with @gziolo and @glendaviesnz it looks like the fixtures isn't really updated in the WordPress tests suite from the Gutenberg project.

That's why this issue has been opened.