Make WordPress Core

Opened 8 months ago

Last modified 7 weeks ago

#55571 reopened task (blessed)

Gallery block fixtures in phpunit tests need updating

Reported by: glendaviesnz's profile glendaviesnz Owned by: glendaviesnz's profile glendaviesnz
Milestone: 6.2 Priority: normal
Severity: normal Version: 5.9
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

In 5.9 the Gallery block was updated to use nested image blocks, and to be wrapped in a figure tag, but the block fixtures still us the old ul and internal image format.

The fixtures should be updated to the new block format.

Attachments (1)

Screenshot 2022-04-26 at 08.54.51.png (227.9 KB) - added by gziolo 7 months ago.

Download all attachments as: .zip

Change History (13)

This ticket was mentioned in PR #2579 on WordPress/wordpress-develop by glendaviesnz.


8 months ago
#1

  • Keywords has-unit-tests added

The Gallery block unit tests still use the old format, so this PR updates it to the new format that uses nested Image blocks.
---
Fixes: https://core.trac.wordpress.org/ticket/55571
## To test

Run:

  • npm run test:php -- --filter Tests_Blocks_wpBlockParser
  • npm run test:php -- --filter Tests_Blocks_Render

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

#2 @costdev
8 months ago

  • Component changed from Gallery to Build/Test Tools
  • Milestone changed from Awaiting Review to 6.0
  • Type changed from enhancement to task (blessed)

#3 @gziolo
7 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 53261:

Tests: Update Gallery block unit tests to new gallery format

The Gallery block unit tests still use the old format, so this updates it to the new format that uses nested Image blocks.

Props glendaviesnz.
Fixes #55571.

#5 @peterwilsoncc
7 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I missed this earlier, sorry.

I think it would be good to maintain tests for both the updated and legacy format. That will ensure that any code changes don't break the legacy format on sites that haven't upgraded.

Will putting the fixture back as core__gallery-legacy.* cause problems?

I'll reopen this for now while it's discussed.

#6 @glendaviesnz
7 months ago

Will putting the fixture back as coregallery-legacy.* cause problems?

Good question, @gziolo do you know what the process has been in the past for deprecated block formats in these fixtures - the only other deprecated fixtures here are for columns and paragraphs, and these only have a single deprecation, but there have been many other deprecations that aren't covered at all in these fixtures?

#7 @gziolo
7 months ago

I didn't think about keeping both versions, it makes a lot of sense!

I would have to double-check the implementation in the core, but in Gutenberg, we have multiple versions per block, including a few deprecated versions so what @peterwilsoncc suggested would work.

#8 @peterwilsoncc
7 months ago

Thanks folks, let's go with __deprecated-1 rather than -legacy so the naming convention is consistent between repositories.

Tests can go in at any time so this can wait until after RC 1 if you have other higher priority tasks to do.

#9 @glendaviesnz
7 months ago

Ok, will take a look at adding these back sometime in the next few days.

#10 @hellofromTonya
7 months ago

  • Milestone changed from 6.0 to 6.1
  • Version changed from trunk to 5.9

Though tests can go in at anytime, moving this to 6.1 milestone to clear 6.0 for RC1 (which is tomorrow).

#11 @desrosj
2 months ago

I came across this one scrubbing tickets today, and I'm wondering. Would this help us find and prevent backwards compatibility problems such as the ones described in #53617? Or am I misunderstanding what the tests check for?

#12 @desrosj
7 weeks ago

  • Milestone changed from 6.1 to 6.2

RC1 is in a few hours. Going to punt this to 6.2.

Note: See TracTickets for help on using tickets.